đź‘‹

Welcome to my blog!

Path-based uwsgi harakiri in Python

uwsgi has a concept of hard timeouts, which they call “harakiri”. This is a useful tool to ensure that your web workers don’t hang too long on a single request. The setting configures how many seconds a worker can spend on a request, and if the worker takes longer, it will be forcefully killed from outside the Python process. This means that if your Python code is hanging on e.g. a slow database query or network request, it will be killed and a new worker will be spawned in its place....

May 10, 2024