Compiling…

fragments (short) and articles (long) on various tech-related topics

20240817 Redis Cluster Cron

Why am I writing this? Recently GitLab had a incident where the VM running a Redis Cluster node was somewhat borked after a kernel livepatch. I took a trip down to the cluster.c file in Redis 7.0.15. The smoking gun was metrics showing a drop in pings received and pongs sent by all other nodes (roughly proportional to the ratio of affected nodes to total nodes). This suggests that the affected node’s outgoing clusterbus messages were affected....

August 16, 2024 · 4 min

20231216 Redis Deep Dives

I’ve spent 2023 working on Redis and how the monolith use Redis at GitLab. Some issues I’ve worked on are simplifying the provisioning process, updating the monolith to be compatible with Redis Cluster and live migrations of data from standalone Redis to a Redis Cluster for various workloads. Looking at the natural progression of things, I’ll probably be involved in scaling the Redis Clusters and automating/democratising the process next year....

December 16, 2023 · 6 min

20230227 Revisiting Goto

Most developers have their preferred workflow. Mine is terminal-based which means I spend ~100% of my non-browser time on the terminal. Moving between folders was something I optimised in 2020 with my own “flavour” of a file-directory-changer. I implemented https://github.com/slai11/goto instead of using off-the-shelf alternatives like jump or zoxide for 2 reasons: (1) those did not fit my usage pattern and (2) I wanted to build/hack together something in Rust....

February 27, 2023 · 2 min

Healthchecks with pgrep

An interesting pattern I noticed while exploring the deployment process at GitLab was the use of pgrep to perform healthchecks in the Dockerfile or even in Kubernetes (technically you could). First define a healthcheck file: #!/bin/bash set -e /usr/bin/pgrep -f <process-to-check> If there is something, the exit code is 0, else it returns exit code 1. That is a pretty nifty trick. Second, add this line into your Dockerfile: HEALTHCHECK --interval=30s --timeout=30s --retries=5 CMD /healthcheck In a kubernetes setting, simply configure your livenessProbe/readinessProbe and you should be good to go....

September 1, 2022 · 1 min

Leaving Vim

The betrayal GitLab monorepo is way too large to use with my existing neovim setup. Even with udpated solargraph config to index 20000 files, using fzf+ripgrep. The way ruby is written also involves patching and overriding gem functions/methods. After much frustration in trying to navigate the monstrous monorepo, I gave up and tried Rubymine. John Carmack’s interview on YouTube helped me feel less guilty about ditching vim. tldr; use the best tools for the job, dont be too constrained by the editor war/cultism....

August 20, 2022 · 2 min

Leaving Viki

On my last day at Viki, I bought a cup of ice latte from the very cafe where my director spoke to me and tried to find out which team I would have fit best in. He proposed the SRE team since I had expressed a deep interest in performance and scaling infrastructure components. However, I politely declined as I preferred to build up “proper” foundation as an SWE by building components of a distributed system....

August 5, 2022 · 1 min

My Old Migrated Post

New Beginnings Given my rollercoaster journey to end up where I am, as a software engineer, I am super excited to begin my NUS masters in computer science this week. Said roller coaster journey involved slogging 4 years through a degree(industrial/systems engineering, operations research in other countries) that was not particularly useful for landing a job in the tech sector, falling in love with software engineering (thank you CS2103) but not having the courage to switch majors, jumping through several data science internships, landing a job as a data scientist at GovTech Singapore and ultimately transiting to a software engineer (my job title still says “data scientists” but 90% of my work is SWE related)....

August 12, 2019 · 3 min