infra as code & CI — Terraform, Ansible, Packer, Jenkins
cloud — AWS, GCP, Azure, OCI, plus a few certifications along the way
os — Arch Linux <3, Red Hat
yeah, that’s my cat
Latest posts
Halving MySQL's Memory Footprint: glibc Arenas and the Thread Cache
A while ago I wrote about migrating the legacy PHP app behind a hobby project of mine, a community driven subtitles website. Three years later it runs on PHP 8 and still talks to the same MySQL 8.0.32 container. The VPS is still a small one, and MySQL is the most expensive tenant on it. Recently I noticed that the database container was sitting at around 1.17 GiB of RSS during peak hours, with a hard mem_limit of 1.5 GiB. That is not a comfortable margin, so I spent a couple of evenings figuring out where the memory was going. Today the same container peaks somewhere between 550 and 650 MiB under the same traffic, and it stays there. The fix was two lines of configuration, and neither of them has anything to do with queries.
· 9 min read
Implementing hybrid searching in ElasticSearch
I’ve been playing a lot lately with embeddings and semantic search implementations and strategies so I’ll present a bit my learnings - tailored around search systems already using ElasticSearch as the engine behind it.
Some terms Let’s start with some introductions. What’s ElasticSearch? You can view it as a manager of Lucene instances. (open-source search engine) Each index is running under the hood a Lucene instance and through this setup you can query your data. It’s what Kubernetes is for container orchestration (of course, keeping proportions for a very simplified overview).
· 6 min read
LLMs - First Major Murder
StackOverflow has published recently its latest stats about usage - and apparently, starting with the public access on ChatGPT, the service’s usage has decreased with ~50%. Everybody has rushed in saying that probably the Internet will start forgetting what SO did over this whole time, but I doubt this is the case. Actually, these stats will probably pump back as ChatGPT is not able to answer the latest tech trends and it shouldn’t - it needs new training data, traning data which is now becoming harder to fetch than it was before (see the reddit drama). (source with some nice graphs)
· 2 min read
Migrating a Legacy PHP App
Recently, I’ve been working on an old hobby project as I needed to rehost it somewhere else. This website serves something like 10k unique users / day and it’s completely community driven - our users interact on the website through comments, forum posts, a chat widget (self-stored) and the content they’re providing (movie subtitles). I’ll just guide you through the entire process.
Initial landscape The initial architecture was pretty simple:
· 13 min read
Fixing 400 Bad Request - Cookie too large error for Nginx Ingress
In some scenarios when integrating with an Identity Provider (IdP) - Keycloak, Auth0, or any similar solution - a 400 error may occur in Nginx due to the size of the request and/or cookie (headers). To solve this issue, some additional configuration for your Nginx ingress is required.
Nginx Ingress is one of the resources used in Kubernetes to receive external requests and direct them to the appropriate service in the Kubernetes cluster. It merely acts as an nginx deployment in your cluster - so, x pods running nginx with a config file that can inherit values. It’s available in 2 flavors: one is free (community edition), the other one is the enterprise version.