From 92074c16a8dda83d79c4e9a534757b0e116f7157 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sat, 19 Mar 2022 00:33:46 +0100 Subject: tcp_splice: Close sockets right away on high number of open files We can't take for granted that the hard limit for open files is big enough as to allow to delay closing sockets to a timer. Store the value of RTLIMIT_NOFILE we set at start, and use it to understand if we're approaching the limit with pending, spliced TCP connections. If that's the case, close sockets right away as soon as they're not needed, instead of deferring this task to a timer. Signed-off-by: Stefano Brivio --- tcp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index 2df966d..8e8806d 100644 --- a/tcp.c +++ b/tcp.c @@ -1560,6 +1560,7 @@ void tcp_defer_handler(struct ctx *c) { tcp_l2_flags_buf_flush(c); tcp_l2_data_buf_flush(c); + tcp_splice_defer_handler(c); } /** -- cgit v1.2.3