1

I'm trying to understand something. It's networking 101, I'm sure.

Say I have my application server (java, tomcat for the sake of the example, but it doesn't matter if it's really tomcat or not) running on a linux machine. I have 10000 users connected to that application server. Say it's websockets, so the connections are being maintained.

Does each user get a socket at the operating system level for my java application server to respond directly to them? Can I see all of these sockets using netstat?

If not, is there some way I can see them?

MeowCode
  • 1,053
  • 2
  • 12
  • 29
  • 10,000 users won't be hitting all at the exact same moment. you'd only see connections for users who are actually in the middle of an http request. – Marc B Jun 06 '13 at 20:50
  • So what if it's websockets and maintaining an actual connection that way? Does this apply? http://stackoverflow.com/questions/11129212/tcp-two-different-sockets-sharing-a-port – MeowCode Jun 06 '13 at 20:51

2 Answers2

2

netstat will show you all active connections.

IF there are many, better use netstat -an (-n tells it to not try to use DNS to resolve ip adresses, much faster)

lsof (see this daniel miessler neat presentation) also have lots of neat informations and is a great help in debugging (connection, but also which file(s) are opened by which pid)

Olivier Dulac
  • 3,695
  • 16
  • 31
1

As Websockets are working through a permanent TCP connection, then the answer is yes, you will see all the established connections in netstat.

nullptr
  • 11,008
  • 1
  • 23
  • 18