Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to check the number of concurrent connections in Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to check the number of concurrent connections in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The number of concurrent connections refers to the ability of the server to handle its business information flow, and it is the number of point-to-point connections that the server can handle at the same time. The size of this parameter directly affects the maximum number of connections that the server can support.

1. Check the number of concurrent requests of TCP and their TCP connection status: netstat-n | awk'/ ^ tcp/ {+ + S [$NF]} END {for (an in S) print a, S [a]} 'netstat-n | grep ^ tcp | awk' {print $NF}'| sort-nr | uniq-c

Or

Netstat-n | awk'/ ^ tcp/ {+ + state [$NF]} END {for (key in state) print key, "t", state [key]}'

Generally, the returned results are as follows:

LAST_ACK 5 (number of requests waiting to be processed) SYN_RECV 30ESTABLISHED 1597 (normal data transfer status) FIN_WAIT1 51FIN_WAIT2 504TIME_WAIT 1057 (number of requests waiting for timeout to end after processing)

Parameter description:

CLOSED: no connection is active or in progress LISTEN: server is waiting for incoming call SYN_RECV: a connection request has arrived, waiting for confirmation SYN_SENT: application has started Open a connection ESTABLISHED: normal data transfer status FIN_WAIT1: application says it has completed FIN_WAIT2: the other side has agreed to release ITMED_WAIT: wait for all packets to die CLOSING: both sides have tried to close TIME_WAIT at the same time; the other side has initialized a release LAST_ACK: wait for all packets to die 2, check the number of Nginx running processes ps-ef | grep nginx | wc-L3, view the number of APACHE running processes ps-ef | grep httpd | wc-L4, Check the number of Web server process connections: netstat-antp | grep 80 | grep ESTABLISHED-c5, view the number of MySQL process connections: ps-axef | grep mysqld-c

The above is all the contents of the article "how to check the number of concurrent connections in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report