Open tarasglek opened 11 years ago
Hi @tarasglek, thank you, that's very interesting! I haven't really done any benchmarks using a post body. I don't see any fixes in the patch though, just debug output?
@wg, Accidentally omitted
diff --git a/src/ae.c b/src/ae.c
index 90be4e2..4b8e017 100644
--- a/src/ae.c
+++ b/src/ae.c
@@ -422,7 +422,7 @@ void aeMain(aeEventLoop *eventLoop) {
while (!eventLoop->stop) {
if (eventLoop->beforesleep != NULL)
eventLoop->beforesleep(eventLoop);
- aeProcessEvents(eventLoop, AE_ALL_EVENTS);
+ aeProcessEvents(eventLoop, AE_ALL_EVENTS | AE_DONT_WAIT);
}
}
Thanks! I played with this change a bit on EC2 but didn't see the same results. In most scenarios using AE_DONT_WAIT actually reduced performance. What does your test environment look like as far as hardware, OS, network, etc?
I was using an idle gigE connection between 2 ivybridge machines. If I remember correctly apachebench gets about 3600req/s(fills the gigE pipe) in this setup.
large payloads highlight bugs in ae scheduler.
Before my patch:
After the minor change to scheduler flags:
The following patch reveals that the bugs occur when we can't write out a full buffer to a socket..It also 'fixes' the throughput for the 10K post payload by using AE_DONT_WAIT.
However the bug is still there when using 60K post payloads. Note the server is just nginx with default debian configuration.