Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi, I can confirm your observations (SuSE 11.1, perl v5.10.0). Seems that your writer.pl is just too fast and consumes a lot of system resources. When writer.pl dies, netstat -n lists some 26k of TIME_WAIT connections for port 7070. If the client allows the sever some time to recover (I used a select(undef,undef,undef,0.0001); after the $i++ in writer.pl), then there's no problem. Runs, and runs, and runs,....while netstat reports something around 13k TIME_WAIT connections, so a kind of equilibrium has been reached.

Change the die() statement in writer.pl to die "Could not connect - $!\n" unless $socket and run writer.pl without the select(...) delay using:

LANG=C perl writer.pl ; netstat -n | egrep 7070 | wc -l
After a while, writer.pl dies and you'll see something like:
Could not connect - Cannot assign requested address 28248
...meaning, that there were temporarily too few resources left and netstat reported something around 28k connections (nearly all of them in TIME_WAIT state indicating a proper disconnection plus guard time).
Update: After a while, resources become available again and you can re-start writer.pl successfully.

HTH


In reply to Re: IO::Socket disconnects in loop by Perlbotics
in thread IO::Socket disconnects in loop by carlin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-19 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found