01. 1.
一直莫名其妙的遇到类似这样错误:connect() to unix:/tmp/php-fcgi.sock failed (11: Resource temporarily unavailable) while connecting to upstream,N久之后才发现了Igor Sysoev的留言。
原文链接:http://marc.info/?l=nginx&m=125423942216521&w=2
> I found that :
>
> #define NGX_LISTEN_BACKLOG 511
>
> and use it as the backlog of listen()
>
> ls.backlog = NGX_LISTEN_BACKLOG;
> if (listen(s, ls.backlog) == -1) {
>
> Does it mean that only 511 connection could be accept at the same time ?
No, it means that up to 511 connections can be queued in kernel listen
queue. 511 is just a safe limit for the most OSes. For FreeBSD it’s -1,
i.e., value of sysctl kern.ipc.somaxconn.
> May I modify it to 1024 or higher( I am sure use it less than SOMAXCONN )
listen 80 default backlog=1024;
–
Igor Sysoev
阅读全文 »
hao32