LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
LinkBack Search this Thread
Old 11-21-2009, 10:13 AM   #1
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,794

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
Age of a TCP connection?


Howdy,

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.
 
Old 11-21-2009, 01:08 PM   #2
pcunix
Member
 
Registered: Dec 2004
Location: MA
Distribution: Various
Posts: 149

Rep: Reputation: 23
So MQ6 doesn't log connections?


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.
 
Old 11-21-2009, 01:19 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,794

Original Poster
Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
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.

Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tcp connection is alive or not krishna123 Programming 5 11-06-2009 04:17 AM
Replay tcp connection Tex-Twil Linux - Networking 2 06-24-2009 07:12 AM
log for TCP/IP (TCP) connection? fireball003 Linux - Server 4 12-04-2008 01:58 PM
Can't get Age of Empires II: Age of Kings started (I've could it before !!!) vegetassj2 Linux - Games 44 08-28-2005 04:59 PM
Unable to get TCP/IP connection kgunnar Linux - Newbie 9 05-01-2002 04:24 AM


All times are GMT -5. The time now is 05:21 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration