Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Multithreaded python sorta works like async in web situations - the GIL still limits to one thread actually interpreting python code, but a thread can run while another one is blocking waiting for IO.


I've still run into issues where an external service took approx 1 second per call. We had 20 threads on each docker container running Python. We had a lot of web requests.

It regularly took down the multithreaded python instance.

The solution we went with was to put all the different web requests into 2 flask servers and then take the output of all those different web requests and make one big request tot the django instance that had all the business logic.

If memory serves, we only had 2 flask instances handling all the traffic that the old array of django servers.

Async pays dividends.


have you tried with async Django yet?


Is async Django completed? I thought the initial async functionality wasn't 100% of Django being async, only specific parts (Like views?). Maybe I'm remembering wrongly though.


Pretty sure you’re right, there’s still a lot more work to be done there, specifically ORM


I've since moved on to a different company that does not use Python for its main services. Django async came out after I left. I was very excited to see it arrive, though, as I expected it would improve the areas of concern I had and reduce the need for the extra layer.

edit: wording


I still don't know why people are afraid of multiprocess python. Sure it's a bit more complicated, but not that much more. Use those processor cores. I use it all the day for doing things in parallel on testing hardware and deployments. Is it really that much harder for web?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: