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

Re^2: function to count pending packets in TCP socket

by Anonymous Monk
on Feb 09, 2018 at 13:13 UTC ( #1208822=note: print w/replies, xml ) Need Help??


in reply to Re: function to count pending packets in TCP socket
in thread function to count pending packets in TCP socket

The ss utility comes from iproute2 package. Sources are freely available for you to read and inspect. The utility is specific to Linux networking.

Send-Q is obtained either via netlink(7), or parsing /proc/net/tcp (hexadecimal field named tx_queue). You could do the same in perl program: use getpeername and match the right line. Inefficient and cumbersome, but it might suit your purposes.

Lastly, I would reconsider the approach of building HA/failover capabilities directly into application. Perhaps your questions are better answered on a networking related forum. HAProxy dot org for instance has a mailing list and archive. HtH.

  • Comment on Re^2: function to count pending packets in TCP socket

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208822]
help
Chatterbox?
and a kettle whistles...

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














    Results (268 votes). Check out past polls.

    Notices?