> Hi,
>
> we ran into an issue a few weeks ago and I don't know if it's an expected
> behavior or not.
>
> Short version: uwsgi still accepts connections even when the backlog is
> full. Is it normal? If it is, is there a way to refuse connection once
> it's
> full?
>
> Long version: we have several instances on Heroku serving our python app
> with uwsgi. Their load-balancer has the following routing algorithm:
>
>
>    1. Accept a new request for the app
>    2. Look up the list of web dynos (instance name on Heroku) for the app
>    3. Randomly select a dyno from that list
>    4. Attempt to open a connection to that dyno's IP and port
>    5. If the connection was successful, proxy the request to the dyno, and
>    proxy the response back to the client
>    6. If it takes more than 30 seconds, the request is killed.
>
>
> If a wsgi worker get stale, the backlog quickly fills up and then it
> shouldn't accept the connection to let the router know that it should
> route
> the requests to another dyno. The problem is that it doesn't and all the
> traffic going to a stale dyno/worker will get killed eventually.
>
> I've managed to reproduce the behavior locally.
>
> Thanks
>
>

It is hard to say, but if the check is only an open/close connection
without sending data, the deferred accept
(http://www.techrepublic.com/article/take-advantage-of-tcp-ip-options-to-optimize-data-transmission/)
could fake the proxy:

--no-defer-accept

will disable it

On the other side if you are using --http instead of --http-socket (it is
a common error) the http proxy is able to accept tons more connections
than workers, so again this could cause the problem.


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

Reply via email to