G2 performance?

mdb

Joined: 2005-01-04
Posts: 2
Posted: Mon, 2005-01-17 11:18

Hi all,

Currently I'm working on integrating G2 in a site that gets about 500 visits per day and has albums with approx. 2400 photos in total. The integration of G2 with (in my case) Xaraya is great. Thanks for all your work!

My question is about the performance of G2. I know I'm running an alpha release that is not at all targeted towards performance (in the first place), but it might be a point to consider for the future. The problem I experience is that G2 generates a very high load on my webserver. I have 16 thumbnails on a page and one in the sidebar. This means that per page 1 + 16 + 1 PHP pages have to be generated. According to bharat a PHP page is served in ~10ms (without an accelerator) vs. ~2ms for serving an image. The load on my server is almost equal to the number of concurrent requests. And my webserver is a P3 with 1GB RAM...

So for me it's a performace problem having all the images served through PHP. Are there any options in the framework that e.g. can allow users to choose between the level of security and speed? I would be happy enough if I can choose an album-level of security, where all thumbnails and images are served directly.

The above is just a point I would like to add to discussion, I'm curious for your comments. Also I'm very interested in anyone that can suggest a temporary hack to implement album-level security, while serving images directly :-)

 
volksport
volksport's picture

Joined: 2002-10-06
Posts: 239
Posted: Mon, 2005-01-17 20:05

It wouldn't be as easy as a on/off switch.

If your images are stored above the webroot for security, you would need php to serve them. If you stored your images under the webroot, they wouldnt be secure even with the image firewall, unless you had htaccess setup to deny requests, but I think php could still serve them. Then I guess you could remove that for direct downloads.

I would imagine the way to do this is to change how item links are served. There should be a function/functions that decide this, then instead of returning a downloadItem link, you return the direct path on the server. I guess that would be a more immediate work around.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-01-17 21:07

If you put your g2data in a webserver accessible location (which bypasses real image security as volksport mentioned) you could modify the {g->image} custom smarty tag to generate direct image urls instead of core:DownloadItem urls.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-01-17 21:19

A G2 module could replace these g->image urls with direct URI's and add a .htaccess to the g2data directory instead, to prevent basic image hotlinks from other domains.

if you're interested, create a RFE. or if you need it quickly, hack it yourself in your G2 installation...