Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests in Keep-Alive connections are not ACKed correctly #488

Open
kolbma opened this issue Jan 12, 2022 · 2 comments
Open

Requests in Keep-Alive connections are not ACKed correctly #488

kolbma opened this issue Jan 12, 2022 · 2 comments

Comments

@kolbma
Copy link

kolbma commented Jan 12, 2022

My wrk is from Linux distribution and RPM has version 4.0.2 wrk --version just ouputs the help.

Please have a look at my comment here...
rwf2/Rocket#2062 (comment)

To summarize: When the server has enabled keep-alive http1.1 after some requests in the connection wrk ACKs the received data with over 40ms delay.

In this image the 1st marked ACK (which is for the 3rd request in connection) is without delay, any later is with delay.
wrk got called with wrk -c 2 -t 2 <url>

wrk_c2_t2_4097

@qsantos
Copy link

qsantos commented Jan 13, 2024

I have encountered the same bug. This can be reproduced by running this in one terminal:

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install django
$ cat <<EOF >settings.py
from django.http import HttpResponse
from django.urls import re_path

def view(request):
    r = HttpResponse('')
    r.headers["Content-Length"] = '0'
    return r

ROOT_URLCONF = 'settings'
ALLOWED_HOSTS = ['127.0.0.1']
urlpatterns = [re_path('', view)]
EOF
$ DJANGO_SETTINGS_MODULE=settings python3 -m django runserver

And this in another:

$ wrk -c1 -t1 http://127.0.0.1:8000/

The result shows a latency of 44 ms. However, with:

$ wrk -c1 -t1 -H 'Connection: close' http://127.0.0.1:8000/ 

We get 0.5 ms of latency.

So, basically, use -H 'Connection: close' or something other than wrk if you want reliable benchmarks.

@qsantos
Copy link

qsantos commented Jan 13, 2024

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

No branches or pull requests

2 participants