Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

So I have a Perl script on a server. (Linux...). The script takes about 3+ minutes to fully complete, (this is normal for my script). Although the server keeps disconnecting, and my browser says that the server is not responding (it timed out I guess). How can I keep the connection alive for over 3+ minutes? (The client is just waiting for a response from the server. Nothing else on the client side is happening)...
Is this even possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
223 views
Welcome To Ask or Share your Answers For Others

1 Answer

If the server is closing the connection, you need to increase the server (Apache?) script timeout, which will be a parameter to mod_cgi or mod_cgid (depending on which one you're using). If you cannot change the Apache configuration then you might experiment with sending an innocuous HTTP header (i.e. Connection: keepalive, which is the default anyway) immediately before starting your processing. This will probably be sufficient to cause Apache not to give up waiting.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...