coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: masterzhan on October 11, 2007, 07:29:08 PM

Title: Why is so many sql queries?!
Post by: masterzhan on October 11, 2007, 07:29:08 PM
Hello, all!

I optimized my configuration of my gallery... Turned off everythinig (like counting comments, names, etc...)

I have:
(
   
Title: Re: Why is so many sql queries?!
Post by: Nibbler on October 11, 2007, 07:34:30 PM
You need to enable the MySQL query cache. Your server is either underpowered or overloaded judging by those numbers.
Title: Re: Why is so many sql queries?!
Post by: masterzhan on October 11, 2007, 07:40:14 PM
Quote from: Nibbler on October 11, 2007, 07:34:30 PM
Your server is either underpowered or overloaded judging by those numbers.

What does it mean and why so think?
Title: Re: Why is so many sql queries?!
Post by: Nibbler on October 11, 2007, 07:48:30 PM
If it's not your server then you need to talk to your webhost. Definitely mention enabling the query cache.
Title: Re: Why is so many sql queries?!
Post by: masterzhan on October 11, 2007, 07:59:42 PM
Quote from: Nibbler on October 11, 2007, 07:48:30 PM
If it's not your server then you need to talk to your webhost. Definitely mention enabling the query cache.

please, share with me - how to enable query cache? Where? Is it in my.ini? Or where i should enable this option?
Title: Re: Why is so many sql queries?!
Post by: Nibbler on October 11, 2007, 08:05:09 PM
Yes - review the MySQL documentation for details.
Title: Re: Why is so many sql queries?!
Post by: masterzhan on October 11, 2007, 08:07:56 PM
Quote from: Nibbler on October 11, 2007, 08:05:09 PM
Yes - review the MySQL documentation for details.

Are there any other ways?
Title: Re: Why is so many sql queries?!
Post by: Nibbler on October 11, 2007, 08:13:13 PM
Look, either you have someone (ie, webhost or managed hosting) who runs your server for you and you ask them to do it or you run it yourself in which case it is your job to read the manual and learn.
Title: Re: Why is so many sql queries?!
Post by: dke on October 11, 2007, 11:04:27 PM
that isn't many queries, as noted, you need query cache... however if you want to lower the numbers of queries you can make all the album thumbnails static, instead of "last image uploaded" that should reduce it quiet some bit.. however i don't think 33 queries is any trouble anyway.

to enable query cache on windows mysql go to my.ini and add


query_cache_type = 1
query_cache_size = 128M


modify 128 to the number of MB you want to dedicate to your query cache (this depends a lot on how much ram you have in your server machine)

hope it helps.
Title: Re: Why is so many sql queries?!
Post by: dke on October 11, 2007, 11:06:13 PM
I forgot to add, that if you don't use a php optimizer you'll get a big slowdown as coppermine uses alot of php.

I personally use eAccellerator, google it up on how to install it for your php setup.
Title: Re: Why is so many sql queries?!
Post by: Joachim Müller on October 14, 2007, 10:28:05 AM
Running a webserver of your own (aka "Self-Hosting") is not recommended if you have no or little idea how to operate and maintain the server. As Nibbler suggested: RTFM and change the settings accordingly. If you're not willing to do so, then don't go for self-hosting, but shared webhosting. This board deals with Coppermine only. Asking for support how to set up and maintain a webserver is beyond the scope of this board.