{"id":18918049,"url":"https://github.com/piccolo-orm/asgi_server_performance","last_synced_at":"2025-10-25T05:04:38.712Z","repository":{"id":97267788,"uuid":"343072455","full_name":"piccolo-orm/asgi_server_performance","owner":"piccolo-orm","description":"Load testing the different ASGI servers to see which is fastest","archived":false,"fork":false,"pushed_at":"2022-04-14T05:53:27.000Z","size":689,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T19:44:42.990Z","etag":null,"topics":["asgi","locust"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piccolo-orm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-02-28T10:04:12.000Z","updated_at":"2024-07-14T00:01:09.000Z","dependencies_parsed_at":"2023-03-23T01:01:04.736Z","dependency_job_id":null,"html_url":"https://github.com/piccolo-orm/asgi_server_performance","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piccolo-orm%2Fasgi_server_performance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piccolo-orm%2Fasgi_server_performance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piccolo-orm%2Fasgi_server_performance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piccolo-orm%2Fasgi_server_performance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piccolo-orm","download_url":"https://codeload.github.com/piccolo-orm/asgi_server_performance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249043006,"owners_count":21203398,"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":["asgi","locust"],"created_at":"2024-11-08T10:29:26.515Z","updated_at":"2025-10-25T05:04:33.676Z","avatar_url":"https://github.com/piccolo-orm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASGI Server Performance\n\nComparing the performance of various ASGI servers.\n\n## Setup\n\nInstall the requirements:\n\n```bash\npip install -r requirements.txt\n```\n\nStart one of the ASGI servers, using the named shell script. For example:\n\n```bash\n# Increase the max number of files which can be open:\nulimit -Sn 10000\n\n# Start the server:\n./daphne.sh\n```\n\nStart Locust, and three workers, each in a separate terminal tab.\n\n```bash\n# tab 1\nlocust --master\n\n# tab 2\nlocust --worker\n\n# tab 3\nlocust --worker\n\n# tab 4\nlocust --worker\n```\n\nOpen `http://0.0.0.0:8089/` in a browser to see the Locust GUI. Start a new test.\n\n\u003cimg src=\"./images/locust_config.png\" width=\"300\" alt=\"Locust Config\"\u003e\n\n### Number of Locust workers\n\nThe test was run using a 2.7 GHz Core i7 (9th Gen) processor with 6 cores, and 16 GB RAM. Your mileage may vary - make sure there are enough workers that none of them hit 100% CPU usage, as it will give misleading results.\n\nYou can see the CPU usage of each worker in the workers tab of the Locust GUI.\n\n![CPU usage](./images/cpu_usage.png)\n\n### Server configuration\n\nTo get fair results, logging was disabled for each server.\n\n-----\n## Results\n\nUvicorn has the largest throughtput, and Hypercorn and Daphne were basically equal.\n\n### Uvicorn\n\n![Uvicorn results](./images/uvicorn.png)\n\n### Hypercorn\n\n![Hypercorn results](./images/hypercorn.png)\n\n### Daphne\n\n![Daphne results](./images/daphne.png)\n\n-----\n\n## Conclusions\n\nIf performance is your main aim, then Uvicorn is a good starting point. However, all of the servers performed well, so all are good choices.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiccolo-orm%2Fasgi_server_performance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiccolo-orm%2Fasgi_server_performance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiccolo-orm%2Fasgi_server_performance/lists"}