How many photos can Gallery handle?

jlhughes

Joined: 2002-06-05
Posts: 81
Posted: Wed, 2002-08-21 19:50

This is not a problem now so I'm not in the "problem" forum. I'm curious, though, what the outward limit is on how many photos Gallery can handle.

My kid's soccer team has 1,100 photos ( <!-- BBCode Start --><A HREF="http://rcubarcelona.org" TARGET="_blank">rcubarcelona.org</A><!-- BBCode End --> ) and this is just the pre-season tournaments. I expect to have more than 4,000 photos by the end of the year.

Right now I'm getting about 60 visitors a day, with peaks as high as 190 after tournaments. The daily traffic averages 27MB with peaks of 87MB. It is possible this will increase as the site becomes wider known among the teams in the league, but I don't expect traffic to increase substantially.

At what point should I expect to see noticeable showdown caused by sheer number of photos? Also, will the arrival of G2 and its mySQL database relieve or hinder this problem?

John Hughes

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2002-08-22 07:11

It all depends on the speed of your machine and the way your albums are set up. The gating factor is that Gallery stores all the data about every photo in a single file per album. And then for any cross-album operations (like the top level page, or when you move a photo to a different album and it needs to know all the album names), it winds up loading all the album files into memory. That stuff will get slower the bigger your Gallery gets until eventually your hardware can't keep up. Viewing an individual album will remain pretty fast because PHP's serialization/deserialization code is very damn fast.

One easy fix for the top-level-slowdown issue is to create your to create your own top level page that has direct links to your various albums. You could do that by simply caching the output from your top level into a HTML page on a daily basis:

% cd gallery
% lwp-request http://your.server/gallery > index.html

then this page:

http://your.server/gallery/index.html

will be very fast. Do the above in cron every 20 minutes and you'll get zippy performance and your top level page will remain up to date.

G2 is much more efficient about loading large chunks of data. We might find that the database overhead makes Gallery slightly slower for very small Galleries (like under a few hundred photos) but a well organized Gallery should scale up to hundreds of thousands of photos, limited by the performance of your database. That's the goal, and my preliminary tests show that it's within reach.

 
jdphilli

Joined: 2002-08-30
Posts: 9
Posted: Fri, 2002-10-11 17:47

I'd love to optimize my gallery like that. I am running on IRIX with Apache and don't have a command like lwp-request on my system. Is there a way I can either get that utility or might there be annother way to pipe .php output to .html?

I moved my Gallery from Linux to IRIX because of the speed, but it's only a little faster with the front page.

Gallery is at: <!-- BBCode Start --><A HREF="http://www.jeffphillips.org/gallery" TARGET="_blank">www.jeffphillips.org/gallery</A><!-- BBCode End --> if you're interested.

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Fri, 2002-10-11 22:50

Try wget; as in wget -O index.html http://www.jeffphillips.org/gallery/index.php Make sure index.html is the before index.php in the DirectoryIndex directive...

You might want to add " > /dev/null 2>&amp;1" to the end of that, so you don't get all these emails from the cron daemon. I don't know if this works on IRIX, though. There's gotta be something similar.

If you don't have wget, you can you 'lynx -source {page} > index.html' I think lynx is pretty common, but I've never used IRIX