tags:

views:

58

answers:

4

Hi,

So, it seems that when a client makes more than 1 connection to the web server ( Windows + Apache 2.0.x + PHP 5.1.6 ) it dies. e.g.

I put 1 phpthumb call - e.g.

<img src="/library/classes/3rdparty/phpthumb/phpThumb.php?src=/media/images/gallery/cart1.jpg&w=100&h=100" />

That works. But if I put like 3 on the page, it just loads forever ( according to firebug ) .. and it never shows!

Any help will be appreciated!

A: 

Browsers do limit the number of concurrent connections to a web server, simply queueing them up ready to be requested once a "slot" becomes free. The actual number of concurrent connections varies from browser to browser and even version to version, and can sometimes be changed by the browser's user. Web servers may also limit the number of concurrent connections.

If each queued request takes a long time to run, then you could run into difficulties with this, making the whole thing seem very slow.

If you're using sessions in your PHP script, then it can be even slower, because only one instance of a script can acces sthe session file at a time... and if it doesn't release it's lock until it's finished running, then effectively your connection limit is being restricted to 1 at a time. One potential solution to this is not to use session_start() unless you need to; another is to release the session lock as soon as you've finished accessing the session file using session_write_close()

Mark Baker
Thanks for the reply! but, there must be something I can do, server wise, to fix this? Because it worked on our previous server, but that crashed completely in terms of hardware, hence the new one. Possible security issues won't be a problem, because it's a local development server. Any ideas? ( in the case that I do need sessions and doing session_write_close() everywhere is out of my control )
Werner
A: 

Try to use session_destroy() in your /library/classes/3rdparty/phpthumb/phpThumb.php

Jacek Wysocki
A: 

What version of PHP did you install, VC6 and thread-safe or not? I would look into that and switch to the correct one depending on how you use it (check http://windows.php.net/download/ - Which version do I choose?)...

wimvds
A: 

I used VC6 thread safe. Which should I be using?

Also, session_destroy didn't change anything..

Werner