Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: TCP Server hangs with multiple client connections

by flexvault (Monsignor)
on Aug 02, 2012 at 19:28 UTC ( #985094=note: print w/replies, xml ) Need Help??


in reply to TCP Server hangs with multiple client connections

rmahin,

    ...we write our info messages to the screen, and debug messages to a file. We have LOTS of debug messages. The output of some commands that we run can be well over 50,000 lines of text...

Why are you writing any messages to the screen? That's the slowest part of your script. I've had scripts end and the output keep printing on the screen for minutes after the script has completed. With the volume you're talking about your 'hang' may come from buffer overflow in the system libraries.

I would change the script to redirecting 'info' to the bit bucket, or the very least to a separate buffered file. Buffering in production is very important, and having 80 processes running, the output on the screen isn't worth much anyway.

Another area of concern is using open and pipe the output. I now use a 'flock' with this technique because of 'hang' situations. That may ruin your concurrency. Why not use 'qx/.../;', since I believe Perl will fork and give you the results back.

This is a large problem, and many, many things could go wrong, but hopefully PM can help you think of alternatives.

Good Luck!

"Well done is better than well said." - Benjamin Franklin

  • Comment on Re: TCP Server hangs with multiple client connections

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985094]
help
Chatterbox?
[choroba]: bare SQL seems to work differently. Failing a prepared statement doesn't abort the transaction. So it's a behaviour of the DBD driver
[choroba]: and smells like a bug
[choroba]: oh wait
[choroba]: it doesn't abort, but it blocks any other operations than aborting
[choroba]: so it kind of makes sense

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-09-19 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (222 votes). Check out past polls.

    Notices?