Gunicorn Timeout Is Not What You Think It Is

How you can get there So, you’re running your python web application using gunicorn in production, and you’re a good folk, you know that having requests without a timeout can be a bad idea. Imagine a long query loading your DB with the client already leaving your beautiful SAAS waiting for the results, whole UI becoming sluggish, yada-yada-yada. You Google stuff, likely entirely miss the documentation, and go on with some settings like --timeout 30 and call it a day. Or maybe you’ve been running a production Gunicorn set-up with a different type of worker in place, you’ve changed it, and were assuming that it’ll just keep working the way you assume it to work. ...

September 28, 2025 · 6 min · 1099 words · Andrei Sviridov

Langchain Dissapointed Me

I have a pet project I started around two years ago to get my head and hands around the AI tooling. It is a chatbot in a Telegram group chat, providing several chat-specific features. It’s nothing serious, just a way not to become rusty and try out some crazy things I did not have the opportunity to try at work. The project went through several rewrites and refactorings (as it always happens with long-lasting pet projects), changed several technologies, adopted clean architecture, an inversion-of-control framework, and all of those lovely things happened when there was no product pressure and close-to-non-existing customer needs. ...

September 28, 2025 · 5 min · 932 words · Andrei Sviridov

Anatomy of Graceful Shutdown: Part 4

Part 4: Celery Graceful Shutdown Process Part 1: Signals and Linux Part 2: Containers and signals Part 3: Graceful shutdown of K8S pods Part 4: Celery Graceful Shutdown [you’re here] Part 5: Prometheus Graceful Shutdown Part 6: Other frameworks and libraries [WIP] Change of the approach We’ve had enough generic theory in previous 3 articles, covering the kernel, application, container runtimes and high-level abstractions like K8S, so what’s next? I suggest to change the flow of the articles to overview of popular backend systems and how they handle graceful shutdowns, so that we have a perspective of the topic in the wild. ...

June 30, 2025 · 10 min · 2015 words · Andrei Sviridov

Making a Sudoku Solver: Having no Idea What I m doing.

I’m easily addicted. Addictions change, but my current ones are Call of Duty: Modern Warfare 3 multiplayer and Sudoku. Considering the latter, I have a soft spot for the mind-numbness and peace it gives me. It’s just you, numbers, and pretty evident strategies to win. At some point, I decided that I needed to quit this ugly habit that breaks the lives of millions of people and causes family splits. I had a spare weekend and not a lot of things to do, so I decided the best thing was to make a sudoku solver. I would get a screenshot or a photo of a sudoku puzzle, parse it, solve it, render a solution, get a dopamine boost in the world of excruciating nothingness, and go on with my life. ...

March 21, 2024 · 9 min · 1842 words · Andrei Sviridov

Python Multiprocessing Quirks on MacOS.

Prelude Currently, I’m working on the product, built around a large Django monolithic application and a bunch of microservices around it. The codebase is quite huge and has a lot of (tens of thousands) tests, that are normally run in a parallel mode in the CI environment. The CPython and Django versions are a little bit stale (3.8 and 3.2 respectively). For local development purposes, it’s well enough to run a subset of tests in a non-parallel mode or to wait for the whole suite to pass during the CI run, but for one specific use case I had to run a parallel test suite locally. It was a surprise for me to see the Segmentation Fault as the test failure reason for a bunch of tests. ...

January 14, 2024 · 8 min · 1639 words · Andrei Sviridov