> 2011/2/1 Roberto De Ioris <[email protected]>:
>>>
>>> Is it possible to monitor the size of the backlog queue (number of
>>> incoming requests waiting for a worker to handle the request)?
>>
>> This is already done in the master process if you use TCP sockets on
>> Linux
>> (no way for UNIX socket). It alert you when the backlog is getting full,
>> but i can easily export this value to the uwsgi api.
>
> I switched back to TCP sockets and get this in uwsgi output in production:
>
> Mon Feb 14 15:18:27 2011 - *** uWSGI listen queue of socket 4 full !!!
> (129/128) ***
> Mon Feb 14 15:18:28 2011 - *** uWSGI listen queue of socket 4 full !!!
> (129/128) ***
> Mon Feb 14 15:18:29 2011 - *** uWSGI listen queue of socket 4 full !!!
> (129/128) ***
> Mon Feb 14 15:18:30 2011 - *** uWSGI listen queue of socket 4 full !!!
> (129/128) ***
> Mon Feb 14 15:18:31 2011 - *** uWSGI listen queue of socket 4 full !!!
> (129/128) ***
> Mon Feb 14 15:18:32 2011 - *** uWSGI listen queue of socket 4 full !!!
> (129/128) ***
> Mon Feb 14 15:18:33 2011 - *** uWSGI listen queue of socket 4 full !!!
> (129/128) ***
> Mon Feb 14 15:18:34 2011 - *** uWSGI listen queue of socket 4 full !!!
> (128/128) ***
> SIGPIPE: writing to a closed pipe/socket/fd (probably the client
> disconnected) on request /status !!!
> write(): Broken pipe [plugins/python/wsgi_subhandler.c line 186]
>
> I'd like to monitor the listen queue, in order to diagnose if we are
> constantly "near the limit", or if it is an "accident".  Can you
> export the variable please?


If i remember correctly you run with full logging disabled (so reporting
it in the logs would be useless). Maybe the master can print the 'percent'
variation ? Something like

*** listen queue is now 10 % full
*** listen queue is now 20 % full
*** listen queue is now 10 % full
*** listen queue is now 30 % full

or you want to manage it in the code accessing something like
env['uwsgi.listen_queue'] ?

>
> BTW what's the status of the syslog support?  Can I use --log-syslog
> reliably, and get the above messages at warn or err level?  This would
> be really nice!
>
>

Oh my god, i have totally forgot it :P

Honestly i have to recheck those part of the code, but it is very simple.

It pratically creates a socketpair between workers and master. Every time
a workers write to fd 2 the data are sent to the master that send them to
the syslog.


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to