Hi,
I have to use multi-threading fast-cgi model in my application but I found that
even the performance of the sample multi-thread fast-cgi application is not
stable enough when it runs with apache 2.0.52 on windows 2000. I'm really
having doubts about FCGI now :o(
1. Server setup parameters
1.1 The apache setup:
#Apache threads setup:
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>
#FCGI handler setup in Apache
<IfModule mod_fastcgi.c>
Alias /fcgi-bin/ "d:/Apache/fcgi-bin/"
<Location /fcgi-bin">
SetHandler fastcgi-script
Options +ExecCGI
</Location>
FastCgiServer "d:/Apache/fcgi-bin/threads.exe" -processes 1 -listen-queue-
depth 500
</IfModule>
1.2 FCGI application:
20 threads are created to accept requests when app starts.
1.3 ab utility command for testing:
ab -n 2000 -c 20 http://127.0.0.1/fcgi-bin/threads.exe
2. Symptom of the problem in stress testing with ab command:
2.1 Performance not stable
After a few runs of the ab command (see 1.3), the fcgi server stops
responding, sometime temporarily, ranging from a few seconds to more than 30
seconds, sometime permanently. I mean "permanently" because it might be dead
for more than 1 minutes, which I consider it "permanent". Actually I think any
block for even 0.1 second is not acceptable considering that what we are
testing is just a super simple sample application doing nothing at all!
2.2 Performance not as good as expected
Even after I cut the fcgi application to as simple as just
returning "Hello, world!", the best performance I got is 3.4 ms per request.
This definitely does not seem to be as good as it should be - I don't think the
process of returning "Hello, world!" can take up to 3.4ms in a server with a
Pentium 4 1.5GHZ CPU and 1GB RAM. There got to be limitation(s) in the
architecture somewhere, be it in the Apache 2.0.52 for win32 or in the fast-cgi
module. Or is it really a problem with the testing utility "ab"?
2.3 The multiple threading model is problematic too
I can only make the multi-threading fast-cgi code to work as is in the
sample application: i.e., create mutiple threads when the fast-cgi application
starts, use mutex to coordinate the "FCGI accept" activity in all threads and
then process the request in that thread and then go back to do "FCGI accept".
Once I deviate from this model by putting "FCGI accept" in main() and then
dispatching the processing of the accepted requests to other threads, the fcgi
app just does not return anything to the client-side at all! It will be greatly
appreciated if somebody can share with me in how to make this model of multi-
threading work for FCGI!!!
Thank you very much.
Stewart
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.