influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

0.8.8: Too many open files

Open kerush opened this issue 11 years ago • 2 comments

Hi guys,

I'm getting this 'too many open files' error when loading data into influx [2015/04/14 15:35:58 BST] EROR Cannot run command &coordinator.CreateShardsCommand{Shards:[]_cluster.NewShardData{(_cluster.NewShardData)(0xc211190b60)}, SpaceName:""}. open /archive/influxdb/data/db/shard_db_v2/58987/type: too many open files [2015/04/14 15:35:58 BST] EROR RAFT: CreateShards: %!(EXTRA *os.PathError=open /archive/influxdb/data/db/shard_db_v2/58987/type: too many open files)

$ sudo ls /proc/ps auxw | grep influxdb | grep -v grep | grep -v sudo | awk '{print $2}'/fd | wc -l 1023

Why does influx has so many files open?

How can I control this number?

Thanks.

kerush avatar Apr 14 '15 15:04 kerush

Note that the service has been up since March 20th, with the loading load pretty much constant since then, but the "Too many open files" started to occur on Apr 2nd:

# grep -lm1 "Starting "  * | xargs ls -l
grep: data: Is a directory
-rwxr-xr-x 1 core core 644932 Mar 19 23:52 log.txt.001
-rwxr-xr-x 1 core core 887490 Mar 20 23:59 log.txt.002

# grep -lm1 "Too many"  * | xargs ls -l
grep: data: Is a directory
-rw-r----- 1 root root  5093235 Apr  2 23:59 log.txt.015
-rw-r----- 1 root root  6084798 Apr  3 23:59 log.txt.016
-rw-r----- 1 root root  2594798 Apr  5 23:59 log.txt.018
-rw-r----- 1 root root  6298548 Apr  6 23:59 log.txt.019
-rw-r----- 1 root root  6498298 Apr  7 23:59 log.txt.020
-rw-r----- 1 root root 15784048 Apr  8 23:59 log.txt.021
-rw-r----- 1 root root 27458708 Apr  9 23:59 log.txt.022

This seems to indicate that influx is not releasing resources properly, otherwise I would see the problem occur at startup I believe.

kerush avatar Apr 14 '15 15:04 kerush

There is a known requirement with 0.8.8 that max filehandles should be 65535. The default init.d script should reset the max filehandle to that if it is not already.

1024 max filehandles is not enough. The underlying datastore shards are each a file.

beckettsean avatar Apr 14 '15 23:04 beckettsean