G2 CPU Hog / performance issues

jelevy01

Joined: 2004-07-20
Posts: 7
Posted: Mon, 2005-03-14 17:08

I installed G2 Dark Fibre over the weekend and noticed today that it is hogging resources at an enourmous rate, after browsing the site for a few minutes load average is upto 15.

This the first PHP/MySQL site that I have run so I am not sure there aren't some settings that I should tweek. When I switch back to G1 my machine operates normally.

I have also noticed that my URL shortcuts don't work in G2 either (I migrated from G1)

Any help would be appreachiated.

----

Gallery URL (optional):
G1: http://pics.jeremylevy.com
G2: http://www.jeremylevy.com/gallery2/main.php
Gallery version: Dark Fibre
Webserver (with version): Apache 2.0.40
Datatabase (with version): 4.1.10a-standard
PHP version (eg 4.2.1): 4.2.2
phpinfo URL (optional): http://www.jeremylevy.com/info.php
Graphics Toolkit(s):
Operating system:RH9
Web browser/version:
G1 version (for migration bugs):

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-14 17:15

upgrade to the current nightly snapshot of G2
http://galleryupdates.jpmullan.com

G2 is now much faster/less cpu intensive for public viewable albums.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-03-14 17:29

instructions for G1->G2 redirection are in Site Admin / Import/Gallery 1

 
jelevy01

Joined: 2004-07-20
Posts: 7
Posted: Mon, 2005-03-14 17:44

I upgraded to the snapshot from the 14th, however the issue continues.

If I do ps -A f I see multiple threads for MySQL as well as httpd, more then I normally see.

Are there any PHP / MySQL settings I can tweak?

JL

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-03-15 01:42

It's normal to see multiple threads for MySQL and httpd, that just means that it's prepared to handle multiple simultaneous requests. The question is, is Gallery placing an undue load on your system?

With the latest code, every time we create a new publicly visible thumbnail/resize image (most galleries are 90+% public) G2 creates a "fast download" file for that image. The next time the thumb is viewed, we take a shortcut to the fast download file and serve up the image very quickly, keeping the load down on your server. We added this feature after B1. With B1 and before; every image view is pretty intensive on the server and drives the load average up quickly.

After upgrading, you have to wait a bit for all of your images to be viewed and these fast-download files to be created. You can get an idea of what percentage of your gallery is already prepared for fast downloads by doing this:

Count the number of thumbnails/resizes:
mysql> select count(*) from g2_Derivative;

Count the number of fast download files:
find ../g2data/cache -name '*fast*' | wc -l

Give it a little time, and if the load average is still really high, then let's talk. In the meantime, what kind of hardware are you running on? Your site seems pretty responsive to me right now...