Category: internals

Linux Memory Management: Slabs

Memory slabs are used by Linux kernel to manage memory for kernel objects. The objects are e.g dentry, inodes, and buffer heads Why to Know About Slabs If you don’t understand about missing usage info of cached memory objects. The system is low on memory and top & free are not enough. Design of Slab…

Go Runtime Scheduler Design Internals

Concurrency is one of the most exciting features of Go language. A single threaded program runs serially, but if you have tasks that can run concurrently, you create threads for such tasks. Threads execute independently and progress concurrently. Go supports creation of thousands of threads in an application!! How is it possible? It’s Go’s runtime.…

NAT Protocol Simplified Explanation

The purpose of NAT protocol is to reduce usage of public IPs A host needs a public IP to connect to Internet If the host is part of a LAN with a gateway router, a host can use private IP to make requests to public Internet. The public Internet would see that all the requests…

Design Problems of PostGres- Part I

This post is a quick summary of Why Uber moved from PostGres to MySQL. PostGres Rows and CTID PostGres provides transactions. Transactions need multiple versions of data. So PG is Multi Versioned DB. PG considers each row immutable. Any change to a row creates a new row version. A row is represented as an offset…

Careful with both hands while using the fork!

fork() is one of the most useful features of C/Linux/UNIX. But it’s like a double edged sword, so be careful with fork 🙂 Of late, I got stuck in a weird problem with one of the client application(A) that interacts with another application(B). Application A was hanging when used application B; otherwise alone A runs…