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

http-server example seems to hang under ApacheBench #5

Open
rryan opened this issue May 1, 2017 · 1 comment
Open

http-server example seems to hang under ApacheBench #5

rryan opened this issue May 1, 2017 · 1 comment

Comments

@rryan
Copy link

rryan commented May 1, 2017

First off, thanks for mioco!

Steps to reproduce from b8cc872 (macOS 10.12.4, macbook pro with 4 cores):

$ cargo build --example http-server
$ target/debug/examples/http-server&
$ ab http://127.0.0.1:5555/

This is ApacheBench, Version 2.3 <$Revision: 1757674 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)...apr_pollset_poll: The timeout specified has expired (70007)
Total of 1 requests completed

Sending single requests via telnet or Chrome works fine. I think it has to do with not closing the connection here: https://github.com/dpc/mioco/blob/master/examples/http-server.rs#L68

If I add a return Ok(()) there, ab works intermittently. It hangs every few requests.

@dpc
Copy link
Owner

dpc commented May 1, 2017

I'm guessing: the pipelining is not being handled correctly at all here, and that bench might be using it.

The exact end of the previous request needs to be correctly handled there so that any bytes of new request are being moved to a new request buffer.

Otherwise, the following request will be invalid, and forever looping without goal and meaning.

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