Heavy load on webserver from embed

bullyboy1

Joined: 2005-05-19
Posts: 11
Posted: Thu, 2005-05-19 16:47

Hi,

We have been testing Gallery2 and have run into some CPU issues on our webservers. We are running Apache2 and PHP 4.3.11, running standalone version of Beta 2. Its on a Dual Pentium 4 2.8G Gentoo machine.

We are attempting to use the GalleryEmbed function to place the images into our Postnuke pages.

We are calling the image like this:

require_once('gallery/embed.php');
$ret = GalleryEmbed::init(array('embedPath' => '/', 'relativeG2Path' => 'gallery/', 'activeUserId' => '', 'fullInit' => true ) );
if ($ret->isError()) {
   print $ret->getAsHtml();
}
list ($ret, $g2data) = GalleryEmbed::getImageBlock(array ('blocks' => 'specificItem', 'itemId' => $info[imagelink], 'show' => 'none', 'activeUserId' => '', 'maxSize' => '150'));
if ($ret->isError()) {
   print $ret->getAsHtml();
}
/* end transactions */
$ret = GalleryEmbed::done();
if ($ret->isError()) {
   print $ret->getAsHtml();
}
print $g2data;

We are getting the desired image displayed but once we place it on the page our server load shoots through the roof. If 3 images are on the same page the server basically starts choking.

It looks like GD may be producing the thumbnail on the fly for the imageblock? It's the only thing we can think that would be causing this kind of load. The thumbnail size in the album is set to 150 so the call is to the exact same size.

Any help would be appreciated.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-05-19 17:01

bullyboy1,
1. get beta 3, most probably something in beta 2 was broken such that image downloads of public viewable images wouldn't take the resource-friendly path in G2.

2. thumbs/resizes are loaded from the g2data/cache/derivatives/. The first time a thumb/resize is needed, it is generated on-the-fly and stored in the disk cache.. All future requests will use the cached thumb/resize.

3. first test G2 standalone. chances are good it has nothing to do with embedding.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-05-19 17:02

you can visit Site Admin / Maintenance and run the build all thumbnails/resizes task and then retry your app..

 
bullyboy1

Joined: 2005-05-19
Posts: 11
Posted: Thu, 2005-05-19 17:06

Thanks guys for the quick response. I'm in the process of installing beta 3 now. Guess I'll find out.

 
bullyboy1

Joined: 2005-05-19
Posts: 11
Posted: Sat, 2005-05-21 23:27
valiant wrote:
bullyboy1,
1. get beta 3, most probably something in beta 2 was broken such that image downloads of public viewable images wouldn't take the resource-friendly path in G2.

2. thumbs/resizes are loaded from the g2data/cache/derivatives/. The first time a thumb/resize is needed, it is generated on-the-fly and stored in the disk cache.. All future requests will use the cached thumb/resize.

3. first test G2 standalone. chances are good it has nothing to do with embedding.

Yeah it seems to have been fixed. B3 doesn't have the same problem.