You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Responses never terminate (ab dies with timeout error) (OS X) #16
Using latest jester and Apache bench and for some reason it thinks the requests timeout. Perhaps we're not closing a socket properly or something? It's 100% reproducible here and only with httpbeast. asynchttpserver does not have the same issue.
nim c -d:release -r tests/example
...
INFO Jester is making jokes at http://0.0.0.0:5000
Starting 1 threads
ab -r -n 1000 -c 1000 http://0.0.0.0:5000/
This is ApacheBench, Version 2.3 <$Revision: 1826891 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 0.0.0.0 (be patient)
apr_pollset_poll: The timeout specified has expired (70007)
Seems to work fine in browser and with curl. AB is receiving the responses (if I used -v2), but obviously something else is off.
Adding the two commented lines fixed it for me... but of course (if this is the proper place to add them) they would need to be dependent on the Close/Keep-Alive/ and HTTP version. You can see how it's done in asynchttpserver if you want a reference.
ab is using HTTP/1.0 (though it doesn't seem to mind the 1.1 being returned) which by default expects keep-alive to be off and the connection to be terminated by the server - which we aren't doing.
@yyyc514 You can use wrk instead of ab.
Although ab is a single thread and old tool, but wrk runs in multithreading.
If you want to use wrk with single thread, simply specify -t 1 with the command line option. wrk -t 1 http://localhost:8080
Techempower, a famous benchmark, also uses wrk to measure it.
Activity
[-]Responses never terminate (OS X)[/-][+]Responses never terminate (ab dies with timeout error) (OS X)[/+]joshgoebel commentedon Oct 15, 2018
Pretty sure this is because we don't yet support close=0 or keep-alive=0.
dom96 commentedon Oct 15, 2018
Hrm, interesting. Not sure what the problem could be, I'd need to look into how apache bench creates requests.
joshgoebel commentedon Oct 15, 2018
Adding the two commented lines fixed it for me... but of course (if this is the proper place to add them) they would need to be dependent on the Close/Keep-Alive/ and HTTP version. You can see how it's done in
asynchttpserverif you want a reference.abis using HTTP/1.0 (though it doesn't seem to mind the 1.1 being returned) which by default expects keep-alive to be off and the connection to be terminated by the server - which we aren't doing.2vg commentedon Oct 25, 2018
@yyyc514 You can use wrk instead of ab.
Although ab is a single thread and old tool, but wrk runs in multithreading.
If you want to use wrk with single thread, simply specify
-t 1with the command line option.wrk -t 1 http://localhost:8080Techempower, a famous benchmark, also uses wrk to measure it.
joshgoebel commentedon Oct 26, 2018
Yeah I've been using
wrk, but still think httpbeast isn't doing the correct connection handling here.kolesar-andras commentedon Nov 18, 2022
Same problem here.
treeform commentedon Nov 26, 2022
I also ran into this.
treeform commentedon Nov 26, 2022
I tried this work around by adding
req.client.close()to end of requests, but I get this error after some requests: