SSL_read error on multiple simultaneous upstream SSL downloads

Piotr Sikora piotr at cloudflare.com
Wed Oct 23 21:26:41 UTC 2013


Hey Maxim,

> While I tend to think that the problem is indeed related to
> SSL_MODE_RELEASE_BUFFERS I don't see any reasons why the server
> side shouldn't be affected.  Could you please point out why you
> think so?

Well, I don't see this from the code, so it's just a hunch, but:
- I wasn't able to reproduce it on the server side with big uploads,
- I wasn't able to reproduce it on the client side with buffering on,
- I was able to consistently reproduce it on the client side with buffering off,
- I did a fast scan on some of our production logs and I see those
errors only for content that would be transferred with proxy buffering
off,
- I think that we would see much more complains if this was happening
on the server side or on the client side with default settings
(buffering on).

I know this isn't very scientific, but those are the facts.

Note: I didn't play around with WebSockets... They are effectively
unbuffered, so they might be triggering this issue on the server side.

> In any case I don't think we should commit any workarounds before
> the problem is at least understood.

Agreed. I should be more clear that my patch was more of a temporary
work-around that a proper solution.

> Trivial mitigation for the
> errors observed so far would be to switch proxy_buffering back to
> on, as by default, and/or use larger buffers.

Surprisingly, at least on OSX, larger buffers are part of the problem.
Small buffers (4k/8k) work fine, but the moment I increase the buffer
size (16k+) the error is triggered right away.

Best regards,
Piotr Sikora



More information about the nginx-devel mailing list