tags:

views:

204

answers:

1

Hi folks,

The docs at www.fastcgi.com aren't clear on this (to me), so I hope someone can give me a definitive answer.

I have written a FastCGI application in C++ to do some heavy duty number crunching. When the application first loads (when apache starts), it performs some caching of MySQL data into a vector, which takes about a minute (hence using FastCGI instead of CGI ;-)). Then it waits for a request to kick off the number crunching.

Normally, a user makes the request, the FastCGI app runs no problem, and returns the correct data. However, I am not sure what is happening when there are several requests initiated at about the same time. Does FastCGI queue those requests, and wait for the previous run to finish before responding to the next request? Or does FastCGI handle the requests in parallel? Can this be configured, and do you configure it in your application or in the apache configs? What's the default?

My application only implements

while(FCGX_Accept( &in, &out, &err, &envp)>=0){}

and performs the number crunching inside the while loop.

Appreciate any help, cheers bros.

+3  A: 

Looking at my web server, I only have one of each FastCGI process running at any one time, no matter how many Apache instances are running. So I have to assume it's queuing them up.

Paul Tomblin