Page 1 of 1
Concurrent PHP scripts in IIS - 1 script getting * resources
Posted: Thu Mar 03, 2005 4:58 am
by cesar2005
Hi,
I have a PHP script which is time consuming (1 min.). Under IIS, if I execute the script via HTTP, it gets all resources and you cannot execute any other script until the "heavy" script has finished. The other scripts go to a kind of "queue" and start only when the first one has finished.
However, under Apache on Linux systems, this does not happen. You can connect to different PHP pages while the heavy script is still running and you won't even notice.
Is there something wrong in my configuration of IIS which does not allow concurrent PHP scripts, or is it normal because of it being a Windows system?
Thanks!!!
Posted: Thu Mar 03, 2005 5:01 am
by timvw
my guess is that linux and windows have a different process sheduling mechanism....
Posted: Thu Mar 03, 2005 5:05 am
by cesar2005
Yes, that is definitely true, but is there some way of circumventing this, or must I forgot to have the IIS as a PHP webserver? I cannot believe, ASP runs well in that sense, why not PHP?
Posted: Thu Mar 03, 2005 5:18 am
by timvw
i wouldn't use iis for usage with php.... apache2 is what you need...
Posted: Thu Mar 03, 2005 6:46 am
by cesar2005
Yes, I completely agree, but I may need to run PHP on IIS as a web service, and still not very sure if it can be done, at least with concurrent users and long running scripts.
It seems that Apache handles multiple requests as different processes, while ISS handles multiple requests in a single process, but with multiple threading. Does this mean that there is no solution for my problem, i.e., am I forced to use Apache instead of IIS? Then why the Windows PHP installation at all? It does not make sense to me...
Posted: Thu Mar 03, 2005 7:48 am
by feyd
From what I remember, IIS is not multithreaded.. or the ISAPI modules aren't thread safe (this may be an issue with the php module itself, I don't know).. or something like that. This "heavy" script should be done outside a http environment if possible.
There are also things of processing demand. If a thread/process needs more time it can ask for it, or receive it automatically. This may also be apart of the module code, and not all modules or the server itself.
The actual scheduling system is very similar between Windows and Linux.
Posted: Thu Mar 03, 2005 9:14 am
by cesar2005
Oh, I forgot to tell that I am running PHP as ISAPI. I haven't tested as CGI yet, maybe would be the solution, even if it is told to run slower.
I will test tomorrow. The problem is that I am generating some reports on the fly, and that is time consuming, and wouldn't like to have the other clients waiting for the script to finish. As I said, this script is completely unnoticeable in the performance of other users if I use Apache.