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

ApacheBenchmark test can not set -k (keep alive) option. not working! #311

Open
wubin1989 opened this issue Jan 29, 2016 · 2 comments
Open

Comments

@wubin1989
Copy link

I made a benchmark by ab, set -k option which could enable keep alive, but it wasn't work.
keep alive connection number was always 0.
Why? How can I enable keep alive in code?

@Ryman
Copy link
Member

Ryman commented Feb 1, 2016

Hmm, this seems to be due to ab using Http1.0 and hyper acting slight weird. To fix, you can add the header Connection, e.g.

response.set(hyper::header::Connection::keep_alive());

@wubin1989
Copy link
Author

Thank you @Ryman
Do you mean hyper default connection is keeping alive?
Only in the case of doing benchmark using ab, I should add response.set(hyper::header::Connection::keep_alive());
otherwise I don't need this code (e.g. in real production environment).
Am I right?

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