HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
calpaterson
python-web-perf
Python2020–2020
calpaterson / python-web-perf

python-web-perf

Code for testing performance of popular python webservers

3Distinct people
3Mentions
0Explicit recommenders
111GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Code for testing performance of popular python webservers

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week3 dated mentions

Observed mentions: 2020-06-12 10:59:44 UTC to 2020-08-15 22:19:44 UTC. Weeks start Monday, UTC.

0122020-06-08 00:00:00 UTC to 2020-06-15 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsJun 82020-06-15 00:00:00 UTC to 2020-06-22 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-06-22 00:00:00 UTC to 2020-06-29 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-06-29 00:00:00 UTC to 2020-07-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-07-06 00:00:00 UTC to 2020-07-13 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJul 62020-07-13 00:00:00 UTC to 2020-07-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-07-20 00:00:00 UTC to 2020-07-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-07-27 00:00:00 UTC to 2020-08-03 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-08-03 00:00:00 UTC to 2020-08-10 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-08-10 00:00:00 UTC to 2020-08-17 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsAug 10

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jun 82020-06-08 00:00:00 UTC2020-06-15 00:00:00 UTC101
Jun 152020-06-15 00:00:00 UTC2020-06-22 00:00:00 UTC000
Jun 222020-06-22 00:00:00 UTC2020-06-29 00:00:00 UTC000
Jun 292020-06-29 00:00:00 UTC2020-07-06 00:00:00 UTC000
Jul 62020-07-06 00:00:00 UTC2020-07-13 00:00:00 UTC000
Jul 132020-07-13 00:00:00 UTC2020-07-20 00:00:00 UTC000
Jul 202020-07-20 00:00:00 UTC2020-07-27 00:00:00 UTC000
Jul 272020-07-27 00:00:00 UTC2020-08-03 00:00:00 UTC000
Aug 32020-08-03 00:00:00 UTC2020-08-10 00:00:00 UTC000
Aug 102020-08-10 00:00:00 UTC2020-08-17 00:00:00 UTC202

What Hacker News says

3 sources
> Wrong. Workers amounts are the same. I see that aiohttp has 5, uwsgi has 16, and gunicorn has 12, 14, and 16 depending on a web-framework, is this your definition of the same? The author says: > The rule I used for deciding on what the optimal number of worker processes was is simple: for each framework I started at a single worker and increased the worker count successively until performance got worse. That's not how benchmark is supposed to be conducted, one doesn't fit workers number to the result that one finds "optimal", one should use the same amount of workers and find bottlenecks and either eliminate them or explain why they cannot be eliminated without affecting benchmark invariants. > this wouldn't affect the variance between sync and async results very much because both frameworks were run on the same machine. it will affect
Read the rest
the variance. Firstly, because the db will spawn processes on the same machine, pgbouncer will spawn processes on the same machine, they all will compete for the same CPU and the order of preemptive context switches affects individual benchmark runs differently. On top of that, there are periodic and expensive WAL checkpoints, and fsync that competes with a benchmark for the kernel system call interruptions and context switches, and the multi-process workers setup may be affected dramatically. If you don't believe that external processes affect the numbers to the extent they become incomparable, try to serf the Internet with your web-browser randomly while running a benchmark. > Real world connection pools have an upper bound limit. I don't see why setting an upper bound limit to be closer to reality is not a good test. Because benchmarks are not real-world workloads, they are designed to show unbound performance of the implementation detail that is selected for a test, where external resources are non-exhaustable for the purpose of avoiding side-effects external to the functionality that is being tested. > Also you're completely wrong about the connection pool blocking when it is exhausted. See source code: > If all connections are exhausted then the system still yields to compute and incoming requests. I didn't say that it wouldn't yield, I said that the coroutine will be blocked at the point where it tries to acquire a non-existing connection from the pool, which affects the benchmark. Now, instead of one blocking context switch at a network socket call that queries Postgres, the coroutine will yield AND WAIT twice - at the exhausted connection pool, and at the network socket call after the connection is acquired. This is exactly the reason why resources should be unbound, and why DB should be on a separate machine (unbound spawning of connection processes upon request), and why the number of OS workers should be the same in all benchmarks, because the sync version will also block twice, and the consequence of blocking there will be much more dramatic and different than in the case of async, WHICH IS THE POINT of a proper benchmark - https://github.com/calpaterson/python-web-perf/blob/master/s...
In Django Async: What's new and what's next?
>The benchmark used different number of processes for sync and async workloads. Wrong. Workers amounts are the same. See the chart with benchmark results. http://calpaterson.com/async-python-is-not-faster.html >The benchmark was run on the same machine where Postgres was operating. This wouldn't affect the variance between sync and async results very much because both frameworks were run on the same machine. >the connection pool was not setup to prevent blocking when a coroutine tries to acquire a connection from the pool when the pool is exhausted. Real world connection pools have an upper bound limit. I don't see why setting an upper bound limit to be closer to reality is not a good test. Also you're completely wrong about the connection pool blocking when it is exhausted. See source code: https://github.com/calpaterson/python-web-perf/
Read the rest
blob/master/a... If all connections are exhausted then the system still yields to compute and incoming requests. >(for benchmark purposes it should not have upper bound limit and to be pre-populated with already established connections). Disagree. The real world sets an upper bound. There's nothing wrong with simulating this in a test.
In Django Async: What's new and what's next?
His async code creates a pool with only 10 max connections[1] (the default). Whereas his sync pool[2], with a flask app that has 16 workers, has significantly more database connections. I expect upping this number would have a positive effect on asyncio numbers because the only thing[3] this[4] is[5] measuring[6] is how many database connections you have, and is about as far from a realistic workload as you can get. Change your app to make 3 parallel requests to httpbin, collect the responses and insert them into the database. That's an actually realistic asyncio workload rather than a single DB query on a very contested pool. I'd be very interested to see how sync frameworks fare with that. 1. https://github.com/calpaterson/python-web-perf/blob/master/a... 2. https://github.com/calpaterson/python-web-perf/blob/master/s... 3. https://gith
Read the rest
In Async Python is not faster

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.