Building Your Own Web Server — Part 4: Single-threaded non-blocking server
All articles in this series Building Your Own Web Server: Part 1 — Theory and Foundations Building Your Own Web Server: Part 2 — Plan and Implementation of HTTP and Configuration parser Building Your Own Web Server — Part 3: Blocking Single and Multithreaded Server Building Your Own Web Server — Part 4: Single-threaded non-blocking server Preface Hello friend , if you are reading these lines it means that you achieved the 4th part of our series where we are trying to understand how web servers work under the hood, what challenges it faces, what approaches and concepts are used, and what pros and cons they have. If you are already here, you already learned or refreshed so many things: structure of http protocol, threads in Linux, lexical analyse, sockets, basics of networking and servers. It is already much more than some programmers know. I’m very proud of you! And it is an honour to make this journey with you. So to sum up, we’ve already gone through many things together in the first three articles: what is http, and how it works which features and version it has how we can handle http requests and send responses how we can configure server and setup routing how we can crash the whole server just with one persistent connection by using one blocking thread how we can gobble all memory in our machine up with multithreaded server But it was just preparation, just a basis to be ready for the final and the most sophisticated topic. Do you want to meet the final boss?

All articles in this series
- Building Your Own Web Server: Part 1 — Theory and Foundations
- Building Your Own Web Server: Part 2 — Plan and Implementation of HTTP and Configuration parser
- Building Your Own Web Server — Part 3: Blocking Single and Multithreaded Server
- Building Your Own Web Server — Part 4: Single-threaded non-blocking server
Preface
Hello friend ,
if you are reading these lines it means that you achieved the 4th part of our series where we are trying to understand how web servers work under the hood, what challenges it faces, what approaches and concepts are used, and what pros and cons they have. If you are already here, you already learned or refreshed so many things: structure of http protocol, threads in Linux, lexical analyse, sockets, basics of networking and servers. It is already much more than some programmers know. I’m very proud of you! And it is an honour to make this journey with you. So to sum up, we’ve already gone through many things together in the first three articles:
- what is http, and how it works
- which features and version it has
- how we can handle http requests and send responses
- how we can configure server and setup routing
- how we can crash the whole server just with one persistent connection by using one blocking thread
- how we can gobble all memory in our machine up with multithreaded server
But it was just preparation, just a basis to be ready for the final and the most sophisticated topic.
Do you want to meet the final boss?