Statistics on linux servers

Source: Internet
Author: User
Tags system echo
Statistics on linux servers: 1) number of port 80 connections: www.2cto. comnetstat-nat | grep-I & quot; 80 & quot; | wc-l12) count httpd protocol connections ps-ef | grephttpd | wc-l13), statistics already...
Statistics on linux servers: 1) number of port 80 connections: www.2cto.com netstat-nat | grep-I "80" | wc-l12) count the number of httpd protocol connections ps-ef | grep httpd | wc-l13) and the number of connected connections. The status is "established 'netstat-na | grep ESTABLISHED | wc-l limit 1. view the number of files opened by a process in the current system: lsof (list open files) is a tool used to list files opened by the current system. lsof-p pid | wc-l 2. view the configuration: the maximum number of files that a single process can open is 8192 ulimit-n 3. when ulimit-n is executed If the system Echo is similar to "Operation notpermitted", it indicates that the above restriction modification failed because the value specified in the system exceeds the soft or hard limit on the number of files opened by the user in Linux. Therefore, you need to modify the Linux system's soft and hard limits on the number of opened files. Cat/etc/security/limits. conf0000g soft nofile 10240 Alibaba g hard nofile 10240
The limit G specifies the number of files opened by the user to be modified. the '*' sign can be used to modify the limit of all users. soft or hard specifies whether to modify the soft limit or hard limit; 10240 specifies the new limit value to be modified, that is, the maximum number of opened files (note that the soft limit value must be smaller than or equal to the hard limit ). 4. use the following command to limit the maximum number of opened files in Linux: cat/proc/sys/fs/file-max
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.