Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "gunicorn"
-
Ugh this specific python module won't work on heroku with gunicorn and I've already wasted 4 hours porting to heroku1
-
So at work, I was trying to convince a senior programmer to adopt Golang for a new project that would need to handle large amount of throughput as oppose to Django with gunicorn and other optimizations (which is what we usually do).
The response was "we'd have a hard maintaining it, as no one really knows Go and it will be hard to hire people with Go knowledge".
So my question: "in your opinion, is that a good reason?" I have some go experience from other jobs, it seems like a superior solution for this problem.6 -
Freaking gunicorn.
Took me over 12 hrs to figure out why issues were happening on staging server and fix them. -
You'd think I'd fucking learn by now to check for typos before going off on a tangent of over complicated reasons why something may not be working... Learning python/django for the first time, and have been trying to figure out how to run gunicorn... turns out I was typing myproject.wgsi rather than myproject.wsgi...
Though I suppose not knowing about how python modules work added to my confusion... still... ugh... -
Python muses me sometimes.
Gunicorn has a preload mode. It enables forking...
So Gunicorn starts, when Gunicorn loaded it forks the workers (Uvicorn / FastAPI in my case).
https://github.com/tiangolo/...
So if we add a function that creates the app... this function will be executed before forking, thus the memory at the state of creating the app will be duplicated.
You can thus spawn 40 workers, they would all have the same ML models.
Or in my case a client who does some things that should only be run by a single thread (with locking).
So the client has a cache, as long as I load the cache during the create_app phase, the cache will be shared between all instances and not created per instance.
It's ... Such a small detail. So simple.
Yet completely fucks my brain.
It's logical, yes. I understand what it does, yes.
But it still makes my brain fart.