elli-lib / elli

Simple, robust and performant Erlang web server
https://github.com/elli-lib/elli/blob/develop/doc/README.md
MIT License
324 stars 38 forks source link

wip: using {active, 100} instead of recv #88

Open tsloughter opened 4 years ago

tsloughter commented 4 years ago

A few quick benchmarks just on my laptop with wrk showed a consistent improvement over use of recv.

I'd like to try some more values of n including {active, once} both just to see if there are any clear differences and to tune the default. (Oh right, need to make n overridable as well before this is ready for possible merge.)

yurrriq commented 3 years ago

This needs a rebase of course, but would be nice to sneak into 4.0. Conceptually I'm down, so long as it's configurable in the end.

tsloughter commented 3 years ago

Cool. I'd like to get some performance testing done. This is a major change since elli wasn't even use {active, once} before.

This might be more useful in like http2 (plan to try it in chatterbox) or streaming http1 requests. When a body size is available it might be better to keep it as just calling recv with that size. Or maybe it isn't since it would be able to start receiving the next requests headers and body instead of blocking... I don't know, need performance tests :(

yurrriq commented 3 years ago

let's not rush it