coppermine-gallery.com/forum

Support => Looking for Freelancers / Paid help => Topic started by: Dr_Michael on October 14, 2007, 02:30:56 PM

Title: Heavy query which causes high server load
Post by: Dr_Michael on October 14, 2007, 02:30:56 PM
I have noticed using this tool: www.dpgr.gr/status.php that there is a very strange query in my coppermine gallery, which takes some seconds (at least 1-2 seconds) to execute.

The query is:

SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords,title, caption, owner_id, owner_name, aid, hits FROM usercpg11d_pictures WHERE approved = 'YES' AND aid IN (5,8,9,10,12,13,14,16,17,18,19,20,21,24,25,26,29,30,31,32,33,35,36,38,39,40,41,42,43,45,46,48,49,50,51,52,53,54,55,56,57,58,59,61,62,63,65,66,67,68,69,71,72, ... , 13377)  ORDER BY pid DESC  LIMIT 785 ,10
Title: Re: Heavy query which causes high server load
Post by: Nibbler on October 14, 2007, 04:12:45 PM
Looks like a perfectly normal query from several pages into the lastup meta album. The list of albums is so long because you have a lot of albums below that category.
Title: Re: Heavy query which causes high server load
Post by: Dr_Michael on October 14, 2007, 04:22:13 PM
Quote from: Nibbler on October 14, 2007, 04:12:45 PM
Looks like a perfectly normal query from several pages into the lastup meta album. The list of albums is so long because you have a lot of albums below that category.

There is one main category "user galleries" where every user can create his albums. What should I do to optimise it?
Title: Re: Heavy query which causes high server load
Post by: Nibbler on October 14, 2007, 05:44:23 PM
Unless you want to dig through the code and optimize that special case,nothing.
Title: Re: Heavy query which causes high server load
Post by: Dr_Michael on October 14, 2007, 07:05:02 PM
Quote from: Nibbler on October 14, 2007, 05:44:23 PM
Unless you want to dig through the code and optimize that special case,nothing.

That means its a disadvantage of coppermine since it cannot handle huge number of albums.
Title: Re: Heavy query which causes high server load
Post by: Joachim Müller on October 15, 2007, 08:05:43 AM
It can handle an unlimited number of albums (at least theoretically). You will have to make sure that the server is powerfull enough.
Title: Re: Heavy query which causes high server load
Post by: Dr_Michael on October 15, 2007, 01:42:17 PM
Quote from: GauGau on October 15, 2007, 08:05:43 AM
It can handle an unlimited number of albums (at least theoretically). You will have to make sure that the server is powerfull enough.

Fair enough. In my gallery with 130.000 photos of 19.000 members, hosted in the above server:
Dedicated server with 2 Dual Xeon 3,2 GHz (4 CPUs), 2 GB RAM and SATA HD, I do face problem.
What would you consider as a "powerful" server for such demands?
Title: Re: Heavy query which causes high server load
Post by: Dr_Michael on October 22, 2007, 10:38:21 PM
Quote from: Nibbler on October 14, 2007, 05:44:23 PM
Unless you want to dig through the code and optimize that special case,nothing.

Anyone interested to optimise the code and get paid?
Title: Re: Heavy query which causes high server load
Post by: Joachim Müller on October 23, 2007, 01:39:29 PM
Moving to paid help section then.