diff --git a/bin/varnishd/VSC_main.vsc b/bin/varnishd/VSC_main.vsc index a2e2d01437..dbcbcdf659 100644 --- a/bin/varnishd/VSC_main.vsc +++ b/bin/varnishd/VSC_main.vsc @@ -33,9 +33,46 @@ .. varnish_vsc:: sess_fail :oneliner: Session accept failures - Count of failures to accept TCP connection. Either the client - changed its mind, or the kernel ran out of some resource like file - descriptors. + Count of failures to accept TCP connection. + + This counter is the sum of the sess_fail_* counters, which + give more detailled information. + +.. varnish_vsc:: sess_fail_econnaborted + :oneliner: Session accept failures: connection aborted + + Detailled reason for sess_fail: Connection aborted by the + client, usually harmless. + +.. varnish_vsc:: sess_fail_eintr + :oneliner: Session accept failures: interrupted system call + + Detailled reason for sess_fail: The accept() call was + interrupted, usually harmless + +.. varnish_vsc:: sess_fail_emfile + :oneliner: Session accept failures: too many open files + + Detailled reason for sess_fail: No file descriptor was + available. Consider raising RLIMIT_NOFILE (see ulimit -n). + +.. varnish_vsc:: sess_fail_ebadf + :oneliner: Session accept failures: bad file descriptor + + Detailled reason for sess_fail: The listen socket file + descriptor was invalid. Should never happen. + +.. varnish_vsc:: sess_fail_enomem + :oneliner: Session accept failures: not enough memory + + Detailled reason for sess_fail: Most likely insufficient + socket buffer memory. Should never happen + +.. varnish_vsc:: sess_fail_other + :oneliner: Session accept failures: other + + Detailled reason for sess_fail: neither of the above, see + Debug log (varnishlog -g raw -I Debug:^Accept). .. varnish_vsc:: client_req_400 :oneliner: Client requests received, subject to 400 errors diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c index 6973d01d8b..455697fe1f 100644 --- a/bin/varnishd/cache/cache_acceptor.c +++ b/bin/varnishd/cache/cache_acceptor.c @@ -489,23 +489,32 @@ vca_accept_task(struct worker *wrk, void *arg) if (i < 0) { switch (errno) { case ECONNABORTED: + wrk->stats->sess_fail_econnaborted++; + break; + case EINTR: + wrk->stats->sess_fail_eintr++; break; case EMFILE: - VSL(SLT_Debug, ls->sock, "Too many open files"); + wrk->stats->sess_fail_emfile++; vca_pace_bad(); break; case EBADF: - VSL(SLT_Debug, ls->sock, "Accept failed: %s", - strerror(errno)); + wrk->stats->sess_fail_ebadf++; + vca_pace_bad(); + break; + case ENOBUFS: + case ENOMEM: + wrk->stats->sess_fail_enomem++; vca_pace_bad(); break; default: - VSL(SLT_Debug, ls->sock, "Accept failed: %s", - strerror(errno)); + wrk->stats->sess_fail_other++; vca_pace_bad(); break; } wrk->stats->sess_fail++; + VSL(SLT_Debug, ls->sock, "Accept failed: %s", + strerror(errno)); (void)Pool_TrySumstat(wrk); continue; } diff --git a/doc/changes.rst b/doc/changes.rst index c1e996fa06..97ce46696f 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -37,6 +37,20 @@ varnishadm * The output format of the ``backend.list`` CLI command has been changed. +varnishstat +----------- + +* The counters + + * ``sess_fail_econnaborted`` + * ``sess_fail_eintr`` + * ``sess_fail_emfile`` + * ``sess_fail_ebadf`` + * ``sess_fail_enomem`` + * ``sess_fail_other`` + + now break down the detailled reason for session accept failures, the + sum of which continues to be counted in ``sess_fail``. VCL and bundled VMODs ---------------------