« Back to Networking: Frequently Asked Questions

How to see the number of open connections on Linux

The ss command is probably the best tool to query statistics for network connections, including the total number of open connections.

Show active connections

With --summary the active state can be shown, including established TCP connections.

# ss --summary
Total: 225
TCP:   26 (estab 10, closed 10, orphaned 0, timewait 10)

Transport Total     IP        IPv6
RAW	 1         0         1        
UDP	 3         2         1        
TCP	 16        14        2        
INET	 20        16        4        
FRAG	 0         0         0     

This output is slim, but provides a first good insight on how busy the system is when it comes to network connectivity. Great for troubleshooting servers like a web server.

Want to see active ongoing connections and monitor them? Consider using the iftop command.

Relevant commands in this article

Like to learn more about the commands that were used in this article? Have a look, for some there is also a cheat sheet available.

Other questions related to Networking

Feedback

Is the described answer not working or incorrect, got another tip or question? Share your thoughts!