Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Apache CGI script timing out

Posted on 2008-10-17
4
Medium Priority
?
389 Views
Last Modified: 2013-12-25
I'm an experienced software developer but this issue has me totally stumped.  I have two Linux servers, one sitting in Virginia, one in Bangalore, India.  Both are running "Red Hat Enterprise Linux ES release 4 (Nahant Update 4)" and apache 2.0.52.  The problem is, on the machine in Bangalore a perl CGI script always times out after 300 seconds.  Both systems have identical httpd.conf files (except ServerName) , both have the same tcp/ip settings (when I run /sbin/sysctl -a | grep net.inet.tcp I get the same results).  I tried running httpd on the Bangalore system with -f /etc/httpd/conf/httpd.conf to make sure it was picking up the "Timeout 5400" line in httpd.conf.  I even put in both Timeout and TimeOut in the file just in case case matters.

The only difference between the two systems that I can tell is that one system is running a 32 bit compiled httpd and one a 64 bit binary.  I've attached a simple CGI script.  On the Virginia system, about 5 minute go by and then it reports "Slept 301 seconds".  When I run the same CGI script on the Bangalore system, my browser waits forever.  If I change it to sleep 299 seconds, it works.  So somewhere something is timing out at 300 seconds, the question is what?  My browser just sits there forever waiting for a response, and there is nothing unusual logged in the error_log or access_log to help me debug where the response is being dropped.

#!/usr/bin/perl
 
my $sleep_sec = 5 * 60 + 1;
sleep ($sleep_sec);
 
print "Content-type: text/plain\n\n";
print "Slept $sleep_sec seconds\n";
exit 0;

Open in new window

0
Comment
Question by:Clouseau2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 22745721
Are you going through a proxy server to get to either server?

Have you tried seeing what results you get with a different browser?

Have you tried running tcpdump on the server in India to see if it is network related?

Does it make any difference if you add a

$|=1;

to the script?
0
 

Author Comment

by:Clouseau2
ID: 22746126

There is no proxy server, this is through a corporate WAN, I'm on a VPN -- but the problem is also happing from people on the WAN.

I haven't tried a different browser but others are having the same problem and they use IE.

I've attached output from the tcpdump

Adding $| = 1 makes no difference.  The CGI script I wrote it just a simple test script that demonstrates the problem - ALL CGI scripts are having this problem on the system.

tcp.txt
0
 
LVL 12

Expert Comment

by:hfraser
ID: 22746563
I'd suggest doube-checking the proxy server, even on a WAN. It's not unreasonable to deploy one in a global wan to reduce traffic/latency on trans-ocean hops.

Secondly see if the Bangalore site (or anywhere in between) is running an IPS that's checking for http tunnels. A 5 minute response time is quite long for normal http traffic, and might be triggering an IPS signature that breaks the connection.
0
 

Accepted Solution

by:
Clouseau2 earned 0 total points
ID: 22782629

Well I had them try out the delay.cgi script on the local LAN and it did NOT timeout -- so the problem must be in the network between Bangalore (actually Chennai got them mixed up lol) -- I'll give hfraser to solution since that did give me the idea to check that!

I still don't know what the real problem is, but now it's out of my hands and in the hands of the networking people ... the apache server is working perfectly.
0

Featured Post

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question