Re: Fastcgi C++ error on Apache and windows

Igor <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hello Saikat,

Tuesday, August 19, 2008, 1:00:53 AM, you wrote:

Check our your test environment's worker.c setup.

<IfModule worker.c>

</IfModule>

The issue you described is related to either FastCGI load balancer or your Apache2 thread manager.

I would go to worker.c first. By default the worker.c (on windows that is the only supported model) is set up to work

on a very powerless machine therefore the ServerLimit as well as MaxClients and MaxRequestsPerChild is configured to consume

less memory and CPU (about 3-5% of available modern servers). I wouldn't go into details describing how that affects your Fast CGI servers,

just remember - when you start performance test (max server load test) your Apache configuration should allow it to consume almost all server

resources. By default you're utilizing only 5% of your server, all the threads are consumed and you got incomplete header error while your

server load is only 5%. Change parameters in worker.c according to the resources available. Likely that config will be checked by a teenager first by sending

the server a numerous requests and seeing how it affects the server's ability to respond. Actually any server could be DOSed, but that is the whole another story.

Note that this code only displays the Incomplete headers error during load testing, whats worse is that when the environment for load testing is slightly different (meaning using less virtual machines per host) we dont see this error anymore.

That might happen because the less hosts you have the more threads are available. It's all in the worker.c. I recommend you to study how Apache2 is

utilizing available resources before running performance tests. Of course Apache has a built in load restrictions otherwise you would end up with a DOSed host that

you cannot access even via console.

>

Hello Folks:

I have written a fascgi client using c++ and the fcgiapp module. I am using Apache 2.0.63 as my webserver and Windows Server 2003 Web Edition as my operating system. Our load testing environment consists of Linux Hosts running Windows Server 2003 Virtual Machines with this fastcgi c++ client. Unfortunately I had to use windows due to the fact that one of the libraries was only available on windows. Anyways during the last set of load tests I see the following error intermittently in the Apache logs:

Incomplete headers (0 bytes) received from server followed by my servername (i.e. the fastcgi client).

I have searched the web and did not see any solutions to this problem except for implementing my own signal handler which I don't really wish to do:

I am attaching parts of the code here for reference:

int main(int argc, char*const argv[] )

{

try

{

//create an input output and an error stream

//listen on a socket with an appropriate backlog

//exit if the socket is unable to be opened

//if the request currently needs to be initialized exit

std::string port=":9000";

std::string listenQueueBacklog=400;

FCGX_Stream *in, *out, *err;

FCGX_ParamArray envp;

if (FCGX_Init())

exit(1);

int listen_socket = FCGX_OpenSocket(port.c_str(), atoi(listenQueBacklog.c_str()));

if (listen_socket < 0) exit(1);

FCGX_Request request;

if (FCGX_InitRequest(&request, listen_socket, 0)) exit(1);

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

{

//print out the content type and retrieve the query string

//which is everything after the question mark in the URL

FCGX_FPrintF(out,"Content-type: text/html\r\nStatus: 200 OK\r\n\r\n");

//main part of the code goes here

..........

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

}//end try block

catch (std::exception& ex)

{

}

return 0;

}

Note that this code only displays the Incomplete headers error during load testing, whats worse is that when the environment for load testing is slightly different (meaning using less virtual machines per host) we dont see this error anymore.

I would really appreciate some help with this issue.

Thanks Again

----------

Get thousands of games on your PC, your mobile phone, and the web with Windows®. Game with Windows

--

www.rol.ru

Best regards,

Igor mailto:[email protected]

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
http://mailman.pins.net/mailman/listinfo.cgi/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.