Skip to content

http_load_test: a {n} in the path changes on every request - #261

Merged
uNetworkingAB merged 1 commit into
uNetworking:masterfrom
nigrosimone:load-test-varied-urls
Oct 8, 2026
Merged

uNetworkingAB merged 1 commit into
uNetworking:masterfrom
nigrosimone:load-test-varied-urls

Conversation

@nigrosimone

Copy link
Copy Markdown
Contributor

A {n} in the path becomes a number that changes on every request, so a server cannot answer from the bytes of the request before. The varied URLs case from uNetworking/uWebSockets.js#1352:

http_load_test 50 localhost 3000 /user/{n} 4

The number has a fixed width (8 digits) and is written in place before each send, so the request keeps its size. Without {n} nothing changes.

Checked against a uWS.js app counting urls: 696108 requests, 696108 distinct urls, and /user/0 gives one. Same req/s with and without {n} (the server on one core is the limit).

@nigrosimone
nigrosimone marked this pull request as ready for review October 8, 2026 11:44
@uNetworkingAB
uNetworkingAB merged commit e88d7f0 into uNetworking:master Oct 8, 2026
@uNetworkingAB

Copy link
Copy Markdown
Contributor

Waaaait. It shouldn't be pipelined. I never benchmark pipelined. It just a variation for keep-alive.

@nigrosimone

Copy link
Copy Markdown
Contributor Author

It is not pipelined: pipeline is still 1 unless you pass the pipeline factor (the 5th argument, from 9e1ccc7). With 1 the loop in vary_request runs once, so one request with a new number per write, sent after the previous response. The loop is only there so a pipelined batch gets different numbers too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants