Correct setting of Linux ulimit value, ulimit value _ PHP Tutorial

Source: Internet
Author: User
Set the Linux ulimit value correctly. Correctly set the Linux ulimit value. when the linuxulimit value learns swoole, there is a max_conn parameter. max_conn description: description of the maximum number of TCP connections allowed by the server: set this parameter to set the Linux ulimit value correctly. The value of linuxulimit

When learning swoole, there is a max_conn parameter,

Max_conn

Description: maximum number of TCP connections allowed by the server.
Note: After this parameter is set, when the number of connections on the server reaches this value, the new connection will be rejected. In addition, the value of this parameter cannot exceed the operating systemUlimit-nAnd this value cannot be too large, because swoole_server willOne-time memory applicationStores information about each connection. This value also affects the maximum number of concurrent servers. In fact, Linux has a file handle limit, and the default value of Linux is not very high. generally, it is 1024. The production server can easily reach this number.

To correctly set the Linux ulimit-n value, follow these steps:

1. first run the command ulimit-n to view the current value.

2. vim/etc/security/limits. conf

We recommend that you set the following two items to 65535.

* Soft nofile 65535

* Hard nofile 65535

(The asterisk (*) in the preceding figure indicates the global attribute. for all users, nofile indicates the number of file handles. the soft nofile value cannot exceed the hard nofile value)

3. restart the Linux system

Command: shutdown-r now indicates immediate restart

When swoole is learned by worker, there is a max_conn parameter. max_conn description: the maximum number of TCP connections allowed by the server. description: set this parameter...

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.