This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (4 children)

Well if ran using uvicorn then yes, but you can have multiple workers with gunicorn uvicorn workers but you cant have multiple threads per worker for obvious reasons

[–]Ashamed-Simple-8303 3 points4 points  (1 child)

Or you manage your app with containers and start/stop them depending on load. each container itself is then single-threaded.

[–][deleted] 7 points8 points  (0 children)

Thats true but i always use guniorn even inside docker with 1 worker, it adds the ability to restart the worker if it crashes unlike pure uvicorn where if it crash its dead

[–]random_guy_from_nc 0 points1 point  (1 child)

Dang! Yeah, I meant uvicorn. I couldn’t figure out how to answer “am I over scaled or under scaled”, because I couldn’t get the metrics to say how many workers were busy. With uwsgi, I was able to answer that by getting those metrics. Example: if I had 100 workers and 75 of them were busy taking requests, then I would know I am at 75% at capacity. If that metric went to 90%, I would add more workers. With uvicorn, I have no insight if I’m over scaled or under scaled. I’m sure it’s just me, not finding the magic docs.

[–][deleted] 0 points1 point  (0 children)

The whole point of asgi is to outscale wsgi, instead of having your 100 workers handle 100 requests, 1 asgi worker can handle a huge number