commit fc110947c53c2a5cbf83dbde4ec611f67f150c3b Author: elia Date: Mon Nov 11 23:59:12 2024 +0100 Add README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8a2cb73 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +**Reqser** +========================== + +This is a simple web server built with the Hyper framework. I wrote this as a demonstration of fast request handling in rust. + +**Features** +------------ + +* Request counting with atomic counters +* Metric reporting through two API endpoints: `/data/requests` and `/data/cpu` + +**Techstack** +----------------- + +* **Lock-free request counting**: Using atomic counters to increment the request count. Lower CPU usage +* **Sharded request counting**: Dividing the request count among multiple shards. +* **Time series data storage**: Using a `VecDeque` to store time series data. +* **Tokio async framework**: Using Tokio to handle asynchronous requests and tasks. +* **Hyper framework**: Using Hyper to build the web server and handle HTTP requests. + +**Build and Run** +---------------- + +To build and run the server, use the following commands: + +```bash +cargo build +cargo run +``` + +This will start the server and make it available at `http://0.0.0.0:80`. The metrics endpoints can be accessed at: + +* `http://0.0.0.0:80/data/requests` +* `http://0.0.0.0:80/data/cpu` + +**Note** +---------------- +This "project" has no purpose. I made it to demonstrate that most webapps are ass inefficient. lmao \ No newline at end of file