{"id":27494690,"url":"https://github.com/prashanthatp/httpserver","last_synced_at":"2025-04-17T02:09:38.727Z","repository":{"id":269074858,"uuid":"875583871","full_name":"PrashanthaTP/HttpServer","owner":"PrashanthaTP","description":"Http Server Using C++","archived":false,"fork":false,"pushed_at":"2024-12-28T16:31:32.000Z","size":212,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T17:27:13.638Z","etag":null,"topics":["async-io","cpp","cpp-project","epoll","epoll-server","http-server","multithreading","socket-programming","sockets"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrashanthaTP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-20T11:29:35.000Z","updated_at":"2024-12-28T16:31:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2e15dca-9687-4672-8ad8-b15051450a50","html_url":"https://github.com/PrashanthaTP/HttpServer","commit_stats":null,"previous_names":["prashanthatp/httpserver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrashanthaTP%2FHttpServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrashanthaTP%2FHttpServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrashanthaTP%2FHttpServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrashanthaTP%2FHttpServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrashanthaTP","download_url":"https://codeload.github.com/PrashanthaTP/HttpServer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249300611,"owners_count":21247074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-io","cpp","cpp-project","epoll","epoll-server","http-server","multithreading","socket-programming","sockets"],"created_at":"2025-04-17T02:09:38.109Z","updated_at":"2025-04-17T02:09:38.703Z","avatar_url":"https://github.com/PrashanthaTP.png","language":"C++","readme":"\u003c!-- ![Http Server in C++](./docs/images/banner_http_server_2.png) --\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./docs/images/banner_http_server_5.png\" alt=\"http server banner image\"/\u003e\n\u003c/p\u003e\n\n# Http Server\n\n\u003e\n\u003e A multithreaded, epoll-driven, object-oriented HTTP server implemented in C++\n\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Language](https://img.shields.io/badge/language-C%2B%2B-blue.svg)\n\n## Build\n\n```bash\n./build.sh\n```\n\n## Run\n\nTo run Server\n```bash\n./build/HttpServer\n```\n\nTo connect to server\n```\ncurl http://localhost:8080\n```\n\n## Test\n\nCreate python virtual environment and activate\n\n\u003e Python 3.12.8 was used at the time of this repo development\n\n```bash\npython -m venv .\nsource bin/activate\n```\n\nInstall required modules\n\n```bash\npip install -r dev_requirements.txt\n```\n\nRun tests \n\n```bash\ncd tests;./test.sh\n```\n\n\n## Benchmarking\n\n### System Info\n\n```bash\nModel: Acer Predator\nOS: Windows 10\nCPU: Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz\n```\n\nThe server is developed in WSL2.\n\nFrom `uname -a`\n\n```bash\n5.10.102.1-microsoft-standard-WSL2\n```\n\nFrom `cat /etc/os-release`\n```bash\nNAME=\"Alpine Linux\"\nID=alpine\nVERSION_ID=3.20.2\nPRETTY_NAME=\"Alpine Linux v3.20\"\n```\n\nFrom `cat /proc/version`\n```bash\nLinux version 5.10.102.1-microsoft-standard-WSL2 (x86_64-msft-linux-gcc (GCC) 9.3.0, \nGNU ld (GNU Binutils) 2.34.0.20200220) \n```\n\nFrom `ulimit -a`\n```\nreal-time non-blocking time  (microseconds, -R) unlimited\ncore file size              (blocks, -c) 0\ndata seg size               (kbytes, -d) unlimited\nscheduling priority                 (-e) 0\nfile size                   (blocks, -f) unlimited\npending signals                     (-i) 24816\nmax locked memory           (kbytes, -l) 64\nmax memory size             (kbytes, -m) unlimited\nopen files                          (-n) 10000\npipe size                (512 bytes, -p) 8\nPOSIX message queues         (bytes, -q) 819200\nreal-time priority                  (-r) 0\nstack size                  (kbytes, -s) 8192\ncpu time                   (seconds, -t) unlimited\nmax user processes                  (-u) 24816\nvirtual memory              (kbytes, -v) unlimited\nfile locks                          (-x) unlimited\n```\n\n## Results using [`wrk`](https://github.com/wg/wrk)\n\n```bash\n$ ./wrk --version\nwrk 4.2.0 [epoll] Copyright (C) 2012 Will Glozer\n```\n\n### 10 Threads / 500 Connections / 60 Seconds\n```bash\n ./wrk -t10 -c500 -d60s http://127.0.0.1:8080/\n```\n```bash\nRunning 1m test @ http://127.0.0.1:8080/\n  10 threads and 500 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     9.33ms   20.92ms   1.69s    99.04%\n    Req/Sec     5.78k     1.21k   14.79k    78.17%\n  3446453 requests in 1.00m, 246.51MB read\n  Socket errors: connect 0, read 0, write 0, timeout 8\nRequests/sec:  57358.28\nTransfer/sec:      4.10MB\n```\n\n### 10 Threads / 10000 Connections / 60 Seconds\n\n```bash\n./wrk -t10 -c10000 -d60s http://127.0.0.1:8080/\n```\n\n```bash\nRunning 1m test @ http://127.0.0.1:8080/\n  10 threads and 10000 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency    13.44ms    8.62ms 313.24ms   87.62%\n    Req/Sec    11.65k    11.42k   43.38k    80.65%\n  4174202 requests in 1.00m, 298.56MB read\n  Socket errors: connect 13, read 0, write 0, timeout 0\nRequests/sec:  69482.79\nTransfer/sec:      4.97MB\n```\n\n## Results using [`ali`](https://github.com/nakabonne/ali)\n\n```bash\n$ ./ali --version\nversion=0.7.5, commit=c0aa677, buildDate=2021-11-09T14:53:08Z, os=linux, arch=386\n```\n\n```bash\n./ali --duration=60s --rate=1000 http://127.0.0.1:8080/\n```\n\n![ali_rate_1000_duration_1min](./benchmark/screenshots/ali_rate_1000_duration_1min.PNG)\n\n```bash\n./ali --duration=60s --rate=5000 http://127.0.0.1:8080/\n```\n\n![ali_rate_5000_duration_1min](./benchmark/screenshots/ali_rate_5000_duration_1min.PNG)\n\n\n## Acknowledgements\n\n+ [Benchmarking Tool : wrk ]()\n+ [Benchmarking Tool : ali]()\n+ [Http Server Implementation by trungams](https://github.com/trungams/http-server)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprashanthatp%2Fhttpserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprashanthatp%2Fhttpserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprashanthatp%2Fhttpserver/lists"}