Replies: 1 comment 3 replies
-
Hi, thanks for the writeup. The only thing I believe should be synchronous is accepting a TCP connection and cloning the If you're able to reproduce it consistently, someone can surely take a look. I can't really think of any specifics to simply explain it away easily. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
We have a web server written using axum that was initially implemented in the hopes of improving on the performance of a related service. While measuring the axum server's performance (by making repeated concurrent requests to the server and timing the request send + response read times), we have found that the median and average request+response times increase as the number of workers used by the client for concurrent requests increases, and this happens even when this number is below the number of CPUs on the server (and thus the slowdown is not due to there being more requests than tokio workers).
I have a work-in-progress MVCE of an axum server and a request-timing client at https://github.com/jwodder/axum-hammer. Most of the endpoints in the server involve services (registered with
Router::nest_service()
) that parse the request path to determine what page to reply with, as this is the basic format of our production server. Running the client against the server shows the abovementioned increase in response times on both macOS and Debian Linux, but when I attempted to strip away superfluous endpoints to get a truly minimal example, the behavior disappeared on Linux but not macOS. I am therefore holding off on providing actual timing data at this point.At the moment, I'd like to know whether this is expected and/or easily-explainable behavior of axum. The only request bottleneck on the server side I can think of would be the fact that only a single task (I assume) can listen for & respond to incoming connections, but I wouldn't expect the slowdown from that to be more than a blip. If the slowdown we're seeing is anomalous, I can provide more information in the hopes of getting to the bottom of this.
axum version
0.7.5
Beta Was this translation helpful? Give feedback.
All reactions