

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
10 messages in ru.sysoev.nginxRe: nginx-0.7.54| From | Sent On | Attachments |
|---|---|---|
| Igor Sysoev | May 1, 2009 12:02 pm | |
| Jérôme Loyet | May 1, 2009 9:22 pm | |
| Chris Wan | May 2, 2009 7:57 am | |
| Igor Sysoev | May 2, 2009 8:52 am | |
| Chris Wan | May 2, 2009 9:50 am | |
| Igor Sysoev | May 2, 2009 10:18 am | |
| Igor Sysoev | May 2, 2009 10:32 am | |
| Weibin Yao | May 3, 2009 11:32 pm | |
| Igor Sysoev | May 4, 2009 12:19 am | |
| 郭振立 | May 4, 2009 7:31 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: nginx-0.7.54 | Actions... |
|---|---|---|
| From: | Igor Sysoev (is...@rambler-co.ru) | |
| Date: | May 2, 2009 10:32:53 am | |
| List: | ru.sysoev.nginx | |
On Sat, May 02, 2009 at 09:18:51PM +0400, Igor Sysoev wrote:
On Sat, May 02, 2009 at 06:50:25PM +0200, Chris Wan wrote:
Igor Sysoev wrote:
On Sat, May 02, 2009 at 04:57:36PM +0200, Chris Wan wrote:
I run 0.7.54 nginx/windows, but I found the nginx don't work at all when I set "worker_processes 4".
command "telnet 127.0.0.1 80" is ok, but IE can't open "http://127.0.0.1", it wait untill time expired. and no error in error.log.
Try
events { accept_mutex off; }
In my tests only one process receives select() notifcaitons about new connections.
thx, It work.
I want to know more information about this directives.
nginx wiki: accept_mutex Syntax: accept_mutex [ on | off ] Default: on nginx uses accept mutex to serialize accept() syscalls.
I notice you used to say: Workers try to hold accept_mutex which allows only one worker to get new connections notification and to call accept(). You can switch accept_mutex off, then all scheduling will be done by OS scheduler via accept() call. "
but apache said: /* On some architectures it's safe to do unserialized accept()s in the single * Listen case. But it's never safe to do it in the case where there's * multiple Listen statements. Define SINGLE_LISTEN_UNSERIALIZED_ACCEPT * when it's safe in the single Listen case. */
If Listen is single Apache workers just call blocking accept(). If Listen are several worker can not just call blocking accept() on one listening socket. It calls select() for all listening sockets instead, and then calls accept() for returned socket.
nginx workers always use select/kqueue/epoll/etc. before accept().
OS may wake all processes waiting on accept() and select(), this is called http://en.wikipedia.org/wiki/Thundering_herd_problem This is a problem if you have a lot of workers as in Apache (hundreds and more), but this insensible if you have just several workers as nginx usually has. Therefore turning accept_mutex off is as scheduling incoming connection by OS via select/kqueue/epoll/etc (but not accept().
Also, unless I am mistaken Apache2/Windows uses IOCP at least on NT.
-- Igor Sysoev http://sysoev.ru/en/







