i2pd icon indicating copy to clipboard operation
i2pd copied to clipboard

Log flooded with `Too many open files`

Open yangfl opened this issue 4 years ago • 6 comments

I ran a 24/7 i2pd server along with other services. Recently I found the / is out of space and it turns out that /var/log/i2pd/i2pd.log is flooded with

17:50:11@33/error - NTCP2: Accept error Too many open files
17:50:11@33/error - NTCP2: Accept error Too many open files
17:50:11@33/error - NTCP2: Accept error Too many open files
17:50:11@33/error - NTCP2: Accept error Too many open files
17:50:11@33/error - NTCP2: Accept error Too many open files
17:50:11@33/error - NTCP2: Accept error Too many open files
17:50:11@33/error - NTCP2: Accept error Too many open files
17:50:11@33/error - NTCP2: Accept error Too many open files
17:50:11@33/error - NTCP2: Accept error Too many open files

and that takes ~9G to store such thing. Maybe there should be a mechanism to prevent log flooding.

yangfl avatar Aug 14 '20 11:08 yangfl

show prlimit --pid <pid_of_i2pd>

maybe reconfigure logrotate?

LLE8 avatar Aug 14 '20 20:08 LLE8

maybe reconfigure logrotate?

It's different, about logging.

r4sas avatar Aug 14 '20 21:08 r4sas

even if ulimit -n 131072 set, error 17:17:05@442/error - NTCP2: Runtime exception: open: Too many open files [system:24] still appear

vshuraeff avatar May 19 '22 14:05 vshuraeff

Are you starting with systemd?

r4sas avatar May 19 '22 16:05 r4sas

This occurs for me on OpenBSD too, so not necessarily systemd related:

$ uname -a
OpenBSD xxx 7.1 GENERIC.MP#465 amd64
$ pkg_info |grep i2pd
i2pd-2.41.0         client for the I2P anonymous network

It does not seem to make a difference the openfiles limit either:

$ cat /etc/login.conf.d/i2pd.conf
i2pd:\
        :openfiles=4096:

felix avatar Jun 22 '22 11:06 felix

This occurs for me on OpenBSD too, so not necessarily systemd related:

$ uname -a
OpenBSD xxx 7.1 GENERIC.MP#465 amd64
$ pkg_info |grep i2pd
i2pd-2.41.0         client for the I2P anonymous network

It does not seem to make a difference the openfiles limit either:

$ cat /etc/login.conf.d/i2pd.conf
i2pd:\
        :openfiles=4096:

Please contact package maintainer in your system to increase that limit in package and prevent such behavior for other users.

r4sas avatar Jun 22 '22 17:06 r4sas

I had the same problem with flooding logs with "Accept error Too many open files". i2pd version 2.44.0 in Devuan 4 Chimaera (based on Debian 11 Bullseye).

Fix: edit /etc/default/i2pd, default value is:

# If you have problems with hunging i2pd, you can try enable this
ulimit -n 4096

Increase the value. Then restart the service: sudo service i2pd restart.

vazhnov avatar Dec 08 '22 20:12 vazhnov

https://github.com/PurpleI2P/i2pd/commit/737603e81b9b33b1b25fb4a501930dcfffb50016 + https://github.com/PurpleI2P/i2pd/commit/857df5c7341353e8b18af812829797c4da3ccb84

r4sas avatar Dec 10 '22 19:12 r4sas