
The Backend Engineering Show with Hussein Nasser
Welcome to the Backend Engineering Show podcast with your host Hussein Nasser. If you like software engineering you’ve come to the right place. I discuss all sorts of software engineering technologies and news with specific focus on the backend. All opinions are my own.
Most of my content in the podcast is an audio version of videos I post on my youtube channel here http://www.youtube.com/c/HusseinNasser-software-engineering
Buy me a coffee
https://www.buymeacoffee.com/hnasr
🧑🏫 Courses I Teach
https://husseinnasser.com/courses
Latest episodes

4 snips
Sep 7, 2024 • 25min
Frontend and Backends Timeouts
Dive into the intriguing world of timeouts in programming! Discover how they manage waiting periods, free up resources, and even fend off potential DOS attacks. Learn about different types of timeouts like connection and response, and their broader applications beyond just request processing. Engaging discussions highlight best practices for optimizing client-server interactions and ensuring efficient request handling. Prepare for unexpected insights that could change how you think about frontend and backend communications!

Sep 2, 2024 • 28min
Postgres is combining IO in version 17
Learn more about database and OS internals, check out my courses
Fundamentals of database engineering https://databases.win
Fundamentals of operating systems https://oscourse.win
This new PostgreSQL 17 feature is game changer.
You see, postgres like most databases work with fixed size pages. Pretty much everything is in this format, indexes, table data, etc. Those pages are 8K in size, each page will have the rows, or index tuples and a fixed header. The pages are just bytes in files and they are read and cached in the buffer pool.
To read page 0, for example, you would call read on offset 0 for 8192 bytes, To read page 1 that is another read system call from offset 8193 for 8192, page 7 is offset 57,345 for 8192 and so on.
If table is 100 pages stored a file, to do a full table scan, we would be making 100 system calls, each system call had an overhead (I talk about all of that in my OS course).
The enhancement in Postgres 17 is to combine I/Os you can specify how much IO to combine, so technically while possible you can scan that entire table in one system call doesn’t mean its always a good idea of course and Ill talk about that.
This also seems to included a vectorized I/O, with preadv system call which takes an array of offsets and lengths for random reads.
The challenge will become how to not read too much, say I’m doing a seq scan to find something, I read page 0 and found it and quit I don’t need to read any more pages. With this feature I might read 10 pages in one I/O and pull all its content, put in shared buffers only to find my result in the first page (essentially wasting disk bandwidth, memory etc)
It is going to be interesting to balance this out.

Aug 30, 2024 • 37min
Windows vs Linux Kernel
Fundamentals of Operating Systems Course
https://os.husseinnasser.com
Why Windows Kernel connects slower than Linux
I explore the behavior of TCP/IP stack in Windows kernel when it receives a RST from the backend server especially when the host is available but the port we are trying to connect to is not. This behavior is exacerbated by having both IPv6 and IPv4 and if the happy eye ball protocol is in place where IPv6 is favorable.
0:00 Intro
0:30 Fundamentals TCP/IP
3:00 Unreachable Port Behavior
6:00 Client Kernel Behavior (Linux vs Windows)
11:40 Slow TCP Connect on Windows
15:00 localhost, IPv6 and IPv4
20:00 Happy Eyeballs
28:00 Registry keys to change the behavior
31:00 Port Unreachable vs Host Unreachable
https://daniel.haxx.se/blog/2024/08/14/slow-tcp-connect-on-windows/

Aug 25, 2024 • 20min
Running out of TCP ephemeral source ports
In this episode of the backend engineering show I describe an interesting bug I ran into where the web server ran out of ephemeral ports causing the system to halt.
0:00 Intro
0:30 System architecture
2:20 The behavior of the bug
4:00 Backend Troubleshooting
7:00 The cause
15:30 Ephemeral ports on loopback

May 20, 2024 • 17min
io uring gets even faster
Linux I/O expert Jens Axboe discusses IO_uring updates for Linux 6.10, focusing on zerocopy. Topics include how normal copying works, zero copy benefits in data transfer, and challenges of SSL/TLS encryption. Explore advancements in kernel technology for efficient data handling.

May 7, 2024 • 29min
They made Python faster with this compiler option
Fundamentals of Operating Systems Course
https://oscourse.win
Looks like fedora is compiling cpython with the -o3 flag, which does aggressive function inlining among other optimizations.
This seems to improve python benchmarks performance by at most 1.16x at a cost of an extra 3MB in binary size (text segment). Although it does seem to slow down some benchmarks as well though not significantly.
O1 - local register allocation, subexpression elimination
O2 - Function inlining only small functions
O3 - Agressive inlining, SMID
0:00 Intro
1:00 Fedora Linux gets Fast Python
5:40 What is Compiling?
9:00 Compiling with No Optimization
12:10 Compiling with -O1
15:30 Compiling with -O2
20:00 Compiling with -O3
23:20 Showing Numbers
Backend Troubleshooting Course
https://performance.husseinnasser.com

Apr 29, 2024 • 34min
How Apache Kafka got faster by switching ext4 to XFS
Allegro improved Kafka latency by 80% switching from ext4 to XFS. They traced Kafka protocol and kernel system calls, optimized ext4 before switching. Show explores file system complexities, journaling impact, and challenges of workload increase.

Mar 5, 2024 • 14min
Google Patches Linux kernel with 40% TCP performance
Get my backend course https://backend.win
Google submitted a patch to Linux Kernel 6.8 to improve TCP performance by 40%, this is done via rearranging the tcp structures for better cpu cache lines, I explore this here.
0:00 Intro
0:30 Google improves Linux Kernel TCP by 40%
1:40 How CPU Cache Line Works
6:45 Reviewing the Google Patch
https://www.phoronix.com/news/Linux-6.8-Networking
https://lore.kernel.org/netdev/20231129072756.3684495-1-lixiaoyan@google.com/
Discovering Backend Bottlenecks: Unlocking Peak Performance
https://performance.husseinnasser.com

Feb 29, 2024 • 16min
Database Torn pages
Exploring torn pages in databases, including Oracle and MySQL solutions. Comparison of file system block and database pages. Postgres full page writes.

7 snips
Feb 28, 2024 • 31min
Cloudflare Open sources Pingora (NGINX replacement)
Cloudflare's release of Pingora, a networking framework, is a game-changer in the industry. Discussion revolves around its security features, multi-threading capabilities, and the balance between customization and configuration. The move towards Rust for network services marks a significant shift for Cloudflare.
Remember Everything You Learn from Podcasts
Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.