From 6b714030ddc7edb066f2a5e49d00a2f97b9fdf25 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 10 Mar 2015 21:23:21 +0900 Subject: [PATCH] nghttpx: Disable acceptor temporarily when process runs out of fd --- src/shrpx_accept_handler.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/shrpx_accept_handler.cc b/src/shrpx_accept_handler.cc index 3be87200..d69a05cc 100644 --- a/src/shrpx_accept_handler.cc +++ b/src/shrpx_accept_handler.cc @@ -81,6 +81,12 @@ void AcceptHandler::accept_connection() { case EOPNOTSUPP: case ENETUNREACH: continue; + case EMFILE: + case ENFILE: + LOG(WARN) << "acceptor: running out file descriptor; disable acceptor " + "temporarily"; + conn_hnr_->disable_acceptor_temporary(30.); + break; } break;