Hi
I am currently using Gallery and Gallery item heavily in my site, which are great tools and allow for great flexibility in image management through the site.
However, Gallery and Galleryitem use phpThumb, which spawns a connector.php instance, which runs in a separate Linux
process for each image generated (even if the image is cached).
The problem with this is that in my current hosting package I have a maximum of 16 parrallel processes available, on a shared server.
At peak times or during simultaneous hits of pages with lots of images, this causes a server 500 error.
So when running the following url, i see processes on the server, as follows (this is a snapshot of processes during the loading of the following url, so not necessarily 16 processes at this point)
ps -ef
3409642 15389 6166 11 12:32 ? 00:00:00 /usr/lib/cgi-bin/php5 /.../home/php/v2/v3/modx/assets/components/gallery/connector.php
3409642 15400 6164 17 12:32 ? 00:00:00 /usr/lib/cgi-bin/php5 /.../htdocs/home/php/v2/v3/modx/index.php
3409642 15414 15389 0 12:32 ? 00:00:00 sh -c which convert 2>&1
3409642 15419 19349 0 12:32 ? 00:00:00 /usr/lib/cgi-bin/php5 /...htdocs/home/php/v2/v3/modx/assets/components/gallery/connector.php
3409642 15448 13259 0 12:32 pts/0 00:00:00 ps -ef
3409642 15450 30235 0 12:32 ? 00:00:00 /usr/lib/cgi-bin/php5 /.../home/php/v2/v3/modx/assets/components/gallery/connector.php
3409642 15451 15419 0 12:32 ? 00:00:00 sh -c convert --version 2>&1
I am wondering if there is a way around this. Is there any way of executing phpThumb without spawning a new linux (via php shell_exec) process each time an image is retreived?
I would be really grateful for any discussions / advice around this.
Upgrading my hosting package is feasible, but I am thinking there must be another way.
I don’t want to change / rewrite the way that Gallery or Gallery item works either, as these tools have
taken a massive load off my development time, and I want to be able to upgrade Gallery seamlessly (without having to include any hacks!!)
This is related to my last post, where images were intermittently not displaying...
http://modxcms.com/forums/index.php/topic,63184.0.html