View the maximum file descriptor that a process can open

Source: Internet
Author: User
Tags centos server
The default file descriptor of the Centos server is 1024 (linux). The Command ulimit-n is run. For high-load and high-connection servers, 1024 is far from enough. As for the modification method, I will not repeat it here. a large number of articles will be introduced on the Internet. This article describes how to view the maximum file descriptor that a process can open. I don't know whether SA has had such confusion. the system's file descriptor, whether it has been soft adjusted or the configuration file has been hard adjusted, is it true for the application?

The default file descriptor of the Centos server is 1024 (linux). The Command ulimit-n is run.

For high-load and high-connection servers, 1024 is far from enough. As for the modification method, I will not repeat it here. a large number of articles will be introduced on the Internet.

This article describes how to view the maximum file descriptor that a process can open.

I don't know whether SA has had such confusion. the system's file descriptor, whether it's soft-adjusted or the configuration file has been hard-adjusted, can be used by applications, is it actually effective?

There is still a way to know, the method is

Cat/proc/PID/limists | grep "Max open files"

For example.

Running on the file server

18452? Ss 0: 00 nginx: master process/usr/local/nginx/sbin/nginx
28952? S 0: 01 nginx: worker process
28954? S 0: 01 nginx: worker process

You can see the process id before nginx, and then replace the PID with the actual process id to see the result.

# Cat/proc/28952/limits | grep "Max open files"

Max open files 65536 65536 files

It is learned that the nginx 28952 process can open up to 65536 files.

By using the above method, you can know whether the modification to the file descriptor takes effect. Is it easy.


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.