Posts tagged 'python'
Tag: python
Adding Backpressure to Python’s ProcessPoolExecutor Signature Post
Recently I’ve hit a practical limitation with Python’s ProcessPoolExecutor:
when feeding it tens of thousands of tasks from hundreds of producer threads,
the executor happily accepted them all. The result? Memory usage ballooned,
latency increased, and eventually the whole system became unstable.
Minimal and secure Python distroless Docker images with Poetry
For a recent project, I needed to create a Docker image for a Python application that is being handled with Poetry. I already done it one year ago using distroless images, that provide minimal Docker images based on Debian without package managers, shells or any other tools commonly found in traditional images, and optimized for security and size. But after the release of Debian 12 and Poetry 2.0, and so much improvements on the ecosystem during this year, this time I wanted to take the opportunity to create a more secure and minimal image, and to know what would be the best practices for doing so.
How to install Python 2.7 on Ubuntu 24.04 (24.10)
Recently I needed to work on the upgrade and migration of a project that was using Mediasoup… version 1.2.8, published 8 years ago and totally outdated up to the point that the documentation for that version was removed from the Mediasoup website:
mediasoup v1 is no longer documented. Sorry. Anyway it’s no longer maintained so please move to the latest version.
How to do proper exceptions handling
An exception happens when something we expected that should happen, didn’t. We can log them, but printing logs everywhere add a lot of noise, so it’s better to throw errors and handle them in upper levels. Also, a thrown error is easy to check and test, but a log message is not, so they are better for unit testing.