4

Any ideas as to why my Apache/2.0.49 server always waits 20 seconds from receiving a request that is executed using a cgi-bin script to starting to run that script?

The server responds immediately to normal HTTP requests that only use static files, but always takes 20 seconds to respond to cgi-bin requests. I've used tcpdump to time the arrival of the request and printed the time at the beginning of the script to determine that the delay is between those two events.

I can't see anything in the configuration that relates to 20 seconds. The server runs Red Hat Linux 3.3.3-7 & I'm pretty sure that it used to respond to cgi-scripts immediately, but am unsure when it started being slow & what might have changed to cause that.

Thanks in advance for any help/suggestions you may be able to provide.

  • The cgi you start, maybe it has some dependancies and it need time to load everything? – YvesR Jun 18 '12 at 06:28
  • Thanks for responding. It's a simple bash script & the first thing it does now is print the time & the delay is between the GET request being received and that first line of the script. – user1462740 Jun 18 '12 at 07:12

1 Answers1

2

We had a similar problem with our Apache server running PHP but only with a specific client, in the end it turned out the issue was that the PHP was trying to fetch a file from a remote server but didn’t have connectivity, after 20 seconds the PHP “gave up” and the flow was completed. You should try to search your code for something similar.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195