too many open files

This problem is encountered every time.

There are too few files in the system.

ulimit -n 2048

Permanent configuration:

vim /etc/security/limits.conf 

Bottom configuration:

# End of file
*           soft   nofile      100000
*           hard   nofile      100000
*           soft    memlock unlimited
*           hard    memlock unlimited
*           hard    nproc  100000
*           soft    nproc  100000

The first configuration user, * represents all users, both soft and hard are configured, and if the number is the same, the second is assigned “-“

by the way

If you want to view a file opened by a process, you can use the command.

#18754It's a process number
lsof -p 18754

Counting:

lsof -p 18754 | wc -l

 

Leave a Reply

Your email address will not be published. Required fields are marked *