coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Infernal on January 06, 2008, 07:48:33 PM

Title: 2 X cpf fetch VS. 1 Cpmfetch
Post by: Infernal on January 06, 2008, 07:48:33 PM
Question having 1 cpm fetch on a page for let's say latest that shows 10 pics and a cpm fetch that shows another 10 top rated
will this eat up more cpu then 1 cpm fetch that shows 20 pictures let's say mop rated ?
Title: Re: 2 X cpf fetch VS. 1 Cpmfetch
Post by: vuud on January 06, 2008, 11:38:42 PM
Quote from: Infernal on January 06, 2008, 07:48:33 PM
Question having 1 cpm fetch on a page for let's say latest that shows 10 pics and a cpm fetch that shows another 10 top rated
will this eat up more cpu then 1 cpm fetch that shows 20 pictures let's say mop rated ?

The short answers:

On the client CPU, no.
On the server CPU, not really if you use the same cpmfetch object... Don't create another.  Top rated uses a bit more horsepower than say a random 20 pictures...
On the database CPU, a little bit.  Basically you are executing two SQL statements...

The long answer:

Your second scenario uses more - but will this really make a difference operationally?  People get into a mind set of over optimization when the difference is so minimal to begin with...  I have seen though, in large galleries of say 20,000 photos or more some performance issues in top rated, etc, etc...  So the real answer is to run it and see how it works... If you have a normal gallery (less than a few thousand photos) I would be surprised if anything you did with CpmFetch caused an issue...

Hope this helps somewhat!
Title: Re: 2 X cpf fetch VS. 1 Cpmfetch
Post by: Infernal on January 07, 2008, 06:27:44 PM
yes it does
well my real plan is out of the 36 pictures i have posted on my main page top rated http://www.add-fun.com
to get 12 latest additions and leave the rest top rated
i am asking this because i have had a big server cpu problem when i had random images allowed because i have 12000 pictures in my album it gets crawled a lot and i am around 7000 pics seen a day
i get 1200 uniques in the main page with the cpmfetch atm

so if i split them in to 12 latest additions and 24 top rated the server cpu shouldn't have to get worked up a lot more ?