How to correctly set the ulimit value of Linux, linuxulimit value_PHP tutorial

WBOY
Release: 2016-07-12 09:01:55
Original
673 people have browsed it

How to correctly set the Linux ulimit value, linuxulimit value

There is a max_conn parameter when learning swoole,

max_conn

Description: The maximum number of TCP connections allowed to be maintained by the server
Note: After setting this parameter, when the number of existing connections on the server reaches this value, new connections will be rejected. In addition, the value of this parameter cannot exceed the value of the operating system ulimit -n, and this value should not be set too large, because swoole_server will apply for a large piece of memory at one time for storage Information about each connection. This value will also affect the maximum number of concurrency of the server . In fact, Linux has a file handle limit, and the default value of Linux is not very high, usually 1024. The production server can easily reach this number.

The steps to correctly set the ulimit -n value of Linux are as follows:

1. First use the command ulimit -n to check the current value

 2. vim /etc/security/limits.conf

It is recommended to set the following two items to 65535

 * soft nofile 65535

 * hard nofile 65535

(The * asterisk in front represents the global situation, for all users; nofile represents the number of file handles; The value of soft nofile cannot exceed the value of hard nofile )

 3. Restart the Linux system

Command: shutdown -r now means restart immediately

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1087777.htmlTechArticleHow to correctly set the ulimit value of Linux. When learning swoole, there is a max_conn parameter for the linuxulimit value, max_conn Description: Server Description of the maximum number of TCP connections allowed to be maintained: Set this parameter...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template