|Rt Ibmer||Apr 28, 2008 8:44 am|
|Cliff Wells||Apr 28, 2008 10:20 am|
|mike||Apr 28, 2008 11:53 am|
|Rt Ibmer||Apr 28, 2008 2:02 pm|
|Cliff Wells||Apr 28, 2008 2:18 pm|
|Manlio Perillo||Apr 28, 2008 2:37 pm|
|Rt Ibmer||Apr 28, 2008 6:10 pm|
|Rt Ibmer||Apr 28, 2008 6:19 pm|
|Manlio Perillo||Apr 29, 2008 1:18 am|
|Manlio Perillo||Apr 29, 2008 1:25 am|
|Rt Ibmer||Apr 29, 2008 8:11 am|
|François Battail||Apr 29, 2008 10:46 am|
|Rt Ibmer||Apr 29, 2008 1:41 pm|
|Manlio Perillo||Apr 29, 2008 1:57 pm|
|François Battail||Apr 29, 2008 2:27 pm|
|Aleksandar Lazic||Apr 29, 2008 2:36 pm|
|François Battail||Apr 29, 2008 11:20 pm|
|Mansoor Peerbhoy||Apr 30, 2008 1:46 am|
|Manlio Perillo||Apr 30, 2008 2:36 am|
|François Battail||Apr 30, 2008 3:54 am|
|Mansoor Peerbhoy||Apr 30, 2008 5:03 am|
|Grzegorz Nosek||Apr 30, 2008 5:18 am|
|Cliff Wells||Apr 30, 2008 10:40 am|
|Manlio Perillo||Apr 30, 2008 12:16 pm|
|Manlio Perillo||May 1, 2008 2:42 am|
|Grzegorz Nosek||May 1, 2008 11:28 am|
|Manlio Perillo||May 1, 2008 12:02 pm|
|Subject:||Re: Feature request: Run a script when upstream detected down/up|
|From:||Grzegorz Nosek (grze...@public.gmane.org)|
|Date:||Apr 30, 2008 5:18:54 am|
On Wed, Apr 30, 2008 at 05:03:53AM -0700, Mansoor Peerbhoy wrote:
Yes, I see what you're saying.
It is always going to be a problem if the listener cannot consume the data fast
enough. In any case, if you really dig deep, you can see that NGINX is asynch in that it
always reads from a socket only when it is ready to be read
(select/poll/epoll/kevent etc fires). But, as you know, NGINX uses non-blocking sockets. So when it wants to write to a socket (as far as my limited understanding goes),
it doesn't wait for it to be ready-to-write. It just goes and does a write to
the socket. If the kernel deems that the write would have blocked, it will
return EAGAIN (see send(2)) , rather than block the caller, if that's what
you're worried about.
The problem arises when nginx produces log messages faster than the logger can consume them. You can then: 1. drop messages 2. buffer them until the consumer catches up 3. block writes
None of these options is particularly nice, but if I were to implement an external log consumer for nginx, I'd slap a traditional syslog (514/udp) interface and be done with it, lost messages be damned (maybe just use a bigger send buffer for the socket).
Note that if you buffer the log messages inside nginx, the buffer may actually grow infinitely large.
----- Original Message ----- From: "Manlio Perillo" <manlio_perillo-VGgt2q2+T+FeoW...@public.gmane.org>
This is not as easy as it seems. First of all with the current architecture of Nginx, writing to the error log is assumed to be synchronous.
This means that if you want to send log messages to a TCP server the performance will be bad.
You can use an UDP connection, but what happens if Nginx sends data more quickly then the server is able to read? UDP has no flow control.
Best regards, Grzegorz Nosek