Categories
Containers python python performance task queues

Python queue Comparisons: Kafka, AWS SQS and Redis

An interesting question has come up for a real world task. What queue and python queue client should be used? In this post, a few queue options will be tried in the attempt to answer which one should be used. The Problem The real world problem is currently a single api is used to serve […]

Categories
python python performance

Python Simple Asyncio [Part 1]

Is asyncio simple? Some ideas: https://charlesleifer.com/blog/asyncio/ https://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/ https://lucumr.pocoo.org/2016/10/30/i-dont-understand-asyncio/ Came across a well written and simple post about Async programming in Python. A good place to learn about python is always the documentation – here is the documentation for asyncio There is also this Python and Async simplified post. Many of the examples of asyncio can […]

Categories
python

Python Implicit Namespace Packages

A very confusing topic is python imports and paths. One area that makes it more confusing was the introductions of implicit namespace packages. https://peps.python.org/pep-0420/#differences-between-namespace-packages-and-regular-packages These are packages that are found even with an __init__.py. A folder can be created on the python path and that folder automatically becomes a python package. Not sure why or […]

Categories
Hardware performance python python performance virtualisation

CPU and FastAPI Performance

When migrating a FastAPI and WordPress website to a different VPS (virtual private server) provider it was noted that response time and requests per second were impacted negatively. Response times were 2 times slower. It was then noted that the cpu performance could be playing a big factor in this difference in performance. In this […]

Categories
python ubuntu

How to build python 3 from source on Ubuntu 22.04?

Install pre-requisites sudo apt install build-essential libssl-dev libffi-dev software-properties-common libbz2-dev libncurses-dev libncursesw5-dev libgdbm-dev liblzma-dev libsqlite3-dev tk-dev libgdbm-compat-dev libreadline-dev Download the python version you want from https://www.python.org/downloads/source/ cd /opt sudo wget https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tar.xz Extract the downloaded source sudo tar -xvf Python-3.9.16.tar.xz Read the info cd Python-3.9.16/ cat README.rst Compile and Install python ./configure make When running make […]