coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Hercules24 on March 22, 2007, 09:41:30 PM

Title: Reducing MySQL pressure by removing overhead.
Post by: Hercules24 on March 22, 2007, 09:41:30 PM
Dear CPG experts,

My gallery sometimes gets a lot of peak traffic and when there's around 340 CPG pages viewed each minute my host kicks the site for 3 minutes due to excesive CPU usage....
I've tried to minimise a lot of functions (disable registration, voting, comments) and try to run it as basic as possible.

On my webhost forum people are very helpfull in saying: 'use caching' 'optimize and index your MySQL tables'. But to me as a photographer instead of a programmer that's not very usefull. I have no idea how to do that.
I did manage to find out something about PHPMyadmin and took this screenshot:
http://i10.tinypic.com/2czr1n6.jpg
There are some unused tables, and the only big one is the table with alle the 20,000 pictures inside it.

My questions:
-Are the CPG tables already indexed, if not is there an easy way to get it done and will it improve CPU load?
-With all the stuff I've disabled and not planning to re-use (due to spam and flamewars I don't need users, comments, votes (voting=most viewed anyway ;D)) can I take some easy extra steps to reduce CPU load?

At this moment these are the average times the server needs to load an CPG page:
Main Index: used  0.21 seconds of cpu time for HTTP Request: www.kuikens.com : GET /pictures/index.php HTTP/1.1
An Album: used  0.14 seconds of cpu time for HTTP Request: www.kuikens.com : GET /pictures/thumbnails.php?album=291 HTTP/1.1
A Picture: used  0.12 seconds of cpu time for HTTP Request: www.kuikens.com : GET /pictures/displayimage.php?album=292&pos=3 HTTP/1.1

I hope my story makes sense and you can give me some pointers.
Many thanks for such a great gallery being around on the web (My gallery alone entertains 1,000 people a day)
My CPG can be found here: http://www.kuikens.com/pictures/
Title: Re: Reducing MySQL pressure by removing overhead.
Post by: Stramm on March 24, 2007, 08:13:55 AM
of course tables are indexed. You could try to show less thumbs per page. That reduces load too.
Title: Re: Reducing MySQL pressure by removing overhead.
Post by: Hercules24 on March 28, 2007, 01:38:30 AM
Thanks for the advice, I will try to do that on peak moments.
However the last days my site's CPU usage flies through the roof with lines like this:
  Tue Mar 27 11:03:28 2007: used  31.00 seconds of cpu time for [[mysql query]]
  Tue Mar 27 11:03:38 2007: used  3.00 seconds of cpu time for [[mysql query]]
  Tue Mar 27 11:03:53 2007: used  2.00 seconds of cpu time for [[mysql query]]

Is there any way that a visitor can cause this by for instance sending an e-card or adding and downloading favorites in a zip file?
I'm sure it wasn't me because it sometimes happens when I'm sleeping etc.
Otherwise I'll ask my host what's going on.