> On Jul 8, 2017, at 06:14, Rita Morgan <
rmorg...@gmail.com> wrote:
>
> is it possible to see total number of threads or queue size of the wsgi server? Trying to determine the average response time from a server poiint of view
If you provide a `Pool` instance[1] (bounded or unbounded) to the `spawn` argument of the server[2] you can see how many requests are being serviced by asking for the Pool's `len`.
By default, the server doesn't place any bound on the number of outstanding requests, so the only "queue" is the socket backlog. (I suppose you could consider some internal details of the event loop---the way in which greenlets are "scheduled" to run---as a sort of a queue, because they happen one at a time. You can get a rough idea about that by the implementation detail get_hub().loop._callbacks.)
If you use a bounded Pool, then requests could "queue" waiting to be run. There's not a public API to determine how many such requests are waiting, but you could probably figure it out from implementation details (specifically, Pool._semaphore._links).
Jason
[1]
http://www.gevent.org/gevent.pool.html#gevent.pool.Pool
[2]
http://www.gevent.org/gevent.baseserver.html