Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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


    ...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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985094]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2018-02-18 20:29 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (257 votes). Check out past polls.