Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
anyone know of any tricks to find out the age of a TCP connection to a threaded process?
I've an MQ6 server, and can piece together a bunch of things
1) the pid of the process to which the connection is connected (netstat -pant)
2) the age of the process to which the connection is connected (stat /proc/<pid>)
3) the pid of the spawned thread to which the connection is connected (ps -efL)
However I can't get the age of the connection itself, or the thread, which I could take as the age of the connection. Any way to get this info out of the system? Ultimately I have a problem where I think we suffer an odd disconnection periodically because a connecting MQ server is connected too long, but can't find any evidence to prove it. AFAIK, MQ5 spawns a process per connection with an inetd service, but MQ6 uses 64 threads per amqrmppa process, so i'm at thread level, not process level.
Last edited by acid_kewpie; 11-21-2009 at 10:19 AM.
That seems unlikely, but if it really does not, the only idea I'd have is build your own logger by having clients connect on a different port - a process you write listens on that, logs whatever you want to know, and then passes on to the real port.
Xinetd can provide that sort of logging for its connections - if you could have it handle mq6, that could work (but you indicate that's not possible).
Would /proc/parentprocess/task/threadpid/stat help? Specifically starttime (The time in jiffies the process started after system boot) ? That assumes that the thread only manages the connection, though.
it logs the connections, but not the pids or ports and such just IP level data as well as the internal MQ stuff, so I've not been able to join up the dots. I thought I'd looked around lower levels of /proc and was suprised to not get anywhere, but I'd still like to think I was missing something there, it really should be there for one thing, I don't think I looked under task/, hopefully that's the place to go. Assuming that is right, then great, but I'd still ideally rather have something on the tcp/ip side of things to check, seems odd that I can see idle timeouts and other oscure data but no absolute age.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.