self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

uWSGI reports full listen queue

Open emmatyping opened this issue 3 years ago • 20 comments

Version

22.7.0.dev0

Steps to Reproduce

  1. Run ./install.sh
  2. docker compose up -d
  3. docker compose logs web

Expected Result

No uWSGI errors.

Actual Result

The web container logs contain

uWSGI listen queue of socket "127.0.0.1:46721" (fd: 3) full

It seems that uWSGI is reporting that the socket connection queue is full. This is weird for 2 reasons:

  • This is a brand new instance of sentry self-hosted
  • The limit is 100 connections(!)

Edit: there is some more info on the listen queue in the uWSGI docs https://uwsgi-docs.readthedocs.io/en/latest/articles/TheArtOfGracefulReloading.html#the-listen-queue

emmatyping avatar Jul 08 '22 20:07 emmatyping

We receive 300 requests per second on average on our sentry instance and do not have a problem, probably because we're using a nginx installed on host to reverse proxy to sentry instance, so we're not hitting sentry with 300 requests directly.

I guess it's reasonable for any uWSGI instance to use a reverse proxy in front of it instead of delivering requests to it directly.

Do you think it suffices if we document this?

aminvakil avatar Jul 09 '22 06:07 aminvakil

Yeah, I think documenting this is probably sufficient.

emmatyping avatar Jul 11 '22 18:07 emmatyping

@aminvakil sorry for the ignorance, could you elaborate a bit more about how the nginx reverse-proxy helps in this case? Does it somehow enqueue the 300 connections and distribute them to the uWSGI instance without hitting the 100 connections limit on the uWSGI side?

ValentinFrancois avatar Oct 06 '22 09:10 ValentinFrancois

@ValentinFrancois Sorry for late response.

Based your configuration nginx can keep a limited set of open connections to backend you've configured, and uses those connections to pass the traffic.

Therefore there is no need to open a new connection to backend for each new user connection.

aminvakil avatar Oct 14 '22 14:10 aminvakil

@aminvakil you're mentioning this mechanism, right? I think I understand better now image

ValentinFrancois avatar Oct 16 '22 12:10 ValentinFrancois

@ValentinFrancois Exactly!

aminvakil avatar Oct 16 '22 20:10 aminvakil

Encountering this error on M1 mac host (I think this is caused by https://github.com/unbit/uwsgi/issues/2406) Anyone managed to find a workaround?

Nekuromento avatar Jun 20 '23 11:06 Nekuromento

I had this issue and what fixed it was enabling Rosetta emulation for docker for mac. I'm using a m2 macbook pro.

I'm not sure if this fixes it in all situations as my underlying issue was related to file system changes not propogating to the container but you could give it a try.

@Nekuromento

image

KevinMind avatar Dec 04 '23 13:12 KevinMind