nghttpx: Use ev_feed_event to signal write for HTTP backend

It seems that using ev_feed_event to signal write operation is much
faster than starting watcher.  This is probably due to the fact that
we don't need to wait in event loop.  The same thing cannot be done in
HTTP/2 frontend, since this will raise write operation for each stream
HEADER/DATA write, which leads to very small packets, hurting
performance.  Interestingly, HTTP/1 frontend also suffers the same
performance hit.
This commit is contained in:
Tatsuhiro Tsujikawa 2015-10-28 23:26:41 +09:00
parent d9f73c36c3
commit ecb4a208fb
1 changed files with 3 additions and 1 deletions

View File

@ -850,7 +850,9 @@ int HttpDownstreamConnection::on_connect() {
void HttpDownstreamConnection::on_upstream_change(Upstream *upstream) {}
void HttpDownstreamConnection::signal_write() { conn_.wlimit.startw(); }
void HttpDownstreamConnection::signal_write() {
ev_feed_event(conn_.loop, &conn_.wev, EV_WRITE);
}
size_t HttpDownstreamConnection::get_group() const { return group_; }