-
Notifications
You must be signed in to change notification settings - Fork 89
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
Continuation for problems under high load #431
Comments
@atavistock - curious if you were seeing either of the following as well?
|
Not that I've seen. It seems to be mostly |
Theres also a flood of
before the other errors but that looks like its coming from Erlang logger code |
Those definitely aren't coming from Bandit; likely they are logger as you suspect. In terms of
Subsequent requests from the client should look similar without any extraneous characters in between (other than perhaps a
(Note that this parsing isn't done by Bandit directly, but delegated to |
So I've tried getting a minimal repro case and it only seems to happen in the full environment. I've also just verified that these errors do not happen with Cowboy. Heres steps to see whats happening
|
Some random thoughts I've switched out the configs to use Cowboy and this error does not happen. So likely any shared erlang code is not the problem. This is only happening with the plaintext test case. A very similar case returning json seems to work fine. They in the same controller and have the entire pipeline striped down. These are both one line functions: Working
Fails
Digging a little deeper the Phoenix controller code is nearly identical for these two functions
The only differences I can see is the content type and the json version is iodata (a list) |
Okay, so still collecting data hoping that something catches. I've forked Bandit to be able to see internal state. Requests are coming through as
If I look at the
Once that starts I no longer see regular requests in the buffer. |
Okay. This all might come down to a part of the HTTP/1.1 spec that was "official" but barely used. So Basically 5 http requests are getting packed together into a single request body. In the first few thousand of these Bandit is discarding the last 4 and only processing the first one, up until this You can see the first case (dropping all but the first) by just using this
You should see all 5 responses in the same response body, but only the first comes back. I don't have an easy way to trigger the chunk behavior. |
All that said, this could very easily be |
So I wrote a little script to verify that
|
@mtrudel As I've dug deeper I've found this is not a load related issue at all. This specific issue has a lot of things going on. I'm thinking I might close this and make a different issue for targetted to what we now know. Thoughts? |
Sorry just catching up on this now. Pipelining is rife with corner cases and (as you say) only spottily supported. I have no plan or intention to support it; if wrk is using it then I'm happy to call that unsupported. That being said, tighter repro cases are always good! If you feel like you can get repros for other things that we SHOULD be supporting but aren't, I'd love to see the reports! Smaller / more focused / reproducible strongly preferred. Thanks again for all your work on this! |
@atavistock looking closer at your repro case here that's actually something that Bandit should support. Let me dig in a bit and see what I'm missing. |
Yep I see the issue, it's on Bandit's side. I've characterized it and should have a fix up soon |
@atavistock are you able to check if the work in #437 resolves this? |
Woohoo! That definitely fixes it. It does expose another different issue of about 1 in 1_000 request doing a timeout (yay, only like 0.1%). This solves the real problem! Thanks so much for getting this one. |
Great to hear! I assume that 0.1% case is the one you just filed on a separate ticket? |
Yup. I need to close out this issue.On Dec 4, 2024, at 7:06 PM, Mat Trudel ***@***.***> wrote:
Great to hear! I assume that 0.1% case is the one you just filed on a separate ticket?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thanks so much for chasing this down with me and getting it resolved. |
Fixed in 1.6.1, just released |
Followup from #412
ab
is definitely now passing, but unfortunately the benchmarks are not. ;(They're actually using
wrk
to do the benchmarking. I was able to reproduce the issue easily withab
but its still breaking under load. After seeing it pass withab
and not pass in the benchmarks I reproduced the problem withwrk
.To reproduce:
pipeline.lua
with:wrk -H 'Host: localhost' -H 'Accept: text/plain,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' -H 'Connection: keep-alive' --latency -d 15 -c 1024 --timeout 8 -t 10 http://localhost:4000/plaintext -s ./pipeline.lua -- 16
edited Nov 27, 2024
There is a flood of
[error] ** (Bandit.HTTPError) Request line HTTP error: "\n"
before the server stops responding.For one, I'm not really sure what that error means. It got an empty line as a request?
Two, is it possible that when these occur its not closing the connection?
The text was updated successfully, but these errors were encountered: