RE: Multi-thread Fast-CGI performance problem & more

"Jason Pump" <jpump-HbNbuK1M3AseIZ0/[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Try raising number of simultaneous connection from the client (ab) machine:

http://www.speedguide.net/read_articles.php?id=157

Windows 2000 Web Patch

According to the HTTP specs, only limited number of simultaneous connections
are allowed, while loading pages. To increase that number, you can add the
following entries to the Registry (they are not present by default):

HKEY_USERS.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet
Settings
"MaxConnectionsPerServer"=dword:00000020
"MaxConnectionsPer1_0Server"=dword:00000020

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings
"MaxConnectionsPerServer"=dword:00000020
"MaxConnectionsPer1_0Server"=dword:00000020

Note: Keep in mind that although those values work fine in most cases, they
exceed the HTTP specs and therefore might cause problems with some websites.
If you experience problems, just remove the entries. While these entries
might improve web page loading considerably, they tend to strain webservers
more and have no effect on throughput.

Alternatively, you can download a patch (sguide_webtweak_2k) that will add
these entries for you automatically from the Downloads section of our site.



> -----Original Message-----
> From: fastcgi-developers-bounces+jpump=looksmart.net-xGejAJT2w6yOE5Ap4OspEtHuzzzSOjJt@public.gmane.org
> [mailto:fastcgi-developers-bounces+jpump=looksmart.net-xGejAJT2w6yOE5Ap4OspEv8+0UxHXcjY@public.gmane.org
> et]On Behalf Of [email protected]
> Sent: Wednesday, March 30, 2005 9:08 PM
> To: fastcgi-developers-xGejAJT2w6yOE5Ap4OspEtHuzzzSOjJt@public.gmane.org
> Subject: [FASTCGI] Multi-thread Fast-CGI performance problem & more
>
>
> 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/

___________________________________
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.