This post is my build log for the Microsite itself, which is hosted on an ~8 USD microcontroller. I’ll cover the basics of web servers, and show how I implemented one with extreme resource constraints.
Web servers are computers which, when you ask them nicely, send you some information. At the high end, web servers might be entire fleets of rack-mounted computers, located in different countries and costing millions upon millions of dollars. At the low end, a web server might be a single Raspberry Pi in somebody’s apartment.
(Image showing the ESP32-S3 next to a banana or soda can or something for scale)
The blog you’re currently reading is hosted on an ESP32-S3-DevKitC-1-N32R8V, with far less memory and computing power than any desktop-grade computer. Even a Raspberry Pi 5, a common lower-end computer, is much more powerful than this particular development board.
Specification | ESP32-S3-DevKitC-1-N32R8V | Raspberry Pi 5 |
---|---|---|
Cost (at time of writing) | $13 (DigiKey) | $50-130 depending on RAM (SparkFun) |
Processor | 2 cores at 240 MHz | 4 cores at 2.4 GHz |
RAM | 512 KB SRAM, 8 MB PSRAM | 2 to 16 GB |
Flash Storage | 32 MB | MicroSD card slot |
Wi-Fi | 2.4 GHz | 2.4 GHz and 5 GHz |
Despite the resource constraints, the microcontroller does an adequate job of delivering this website to your computer, phone, or smart fridge1. A web server with these specs won’t be serving millions of visitors, but I’d imagine that the vast majority of websites will never see the kind of traffic which would require a more powerful computer.
What’s in a web server?
A web server is a computer connected to the internet, usually available through a domain. When your web browser loads a modern webpage, it sends an HTTPS request to the web server hosting that page. The server then processes this request and sends back the necessary files, such as HTML, CSS, and images2, which your browser uses to display the webpage on your screen.
(TODO: Block diagram of common web architecture)
Microsite’s benchmarks, gathered using wrk in my stress-test.sh script:
Metric Description Value Throughput The number of requests the site can process per second. n requests/s Average Load Time The average time it takes for the website to fully load. n seconds Dropped Requests The percentage or number of requests that fail to be processed. n% Response Time The time taken by the server to respond to a request. n ms Uptime The percentage of time the website is accessible to users. n% Error Rate The percentage of requests that result in errors. n% Latency The delay before the transfer of data begins following a request. n ms Return to content: ↩︎
JavaScript is often unnecessary. Please make simple websites. ↩︎