Small Talk about Accpet_mutex_delay parameters

Source: Internet
Author: User

Previously found Nginx process in the task allocation is very uneven, that a process once busy will be busy for a long time, while the idle thread has been idle, followed by the code found in epoll_wait default timer is 500ms (without a task), can be reduced by accept_ Mutex_delay This parameter gives the idle process a greater chance to grab the accept lock, thus making the task more evenly distributed, and the impact on efficiency that needs to be tested to know.


Worker process if you want to grab a lock, you must wake up from the epoll_wait to go through the circulation process, and then go to the place to grab the lock to seize the opportunity, and once the worker process grabbed the accept lock, the task is more than the case, Epoll_ Wait will be frequently activated, resulting in a huge increase in the chance of the lock, and the idle process 500ms to try to grab the accept lock, so the larger the request volume, the less likely the idle process to grab the lock.


Lock process:

1. Grab Lock

2. Add listen fd to Epoll event

3, Unlock (if not unlocked, that other process will never have the opportunity to accept again)


Accept_mutex_delay

Meaning: Sets the minimum delay time to obtain a mutex.

Syntax: Accpet_mutex_delay <number of Millisecs>

Default: 500ms

Example: Accpet_mutex_delay 1000ms;




Small Talk about Accpet_mutex_delay parameters

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.