OpenVZ Forum


Home » General » Support » openVZ7: how to set fs.file-max ?
openVZ7: how to set fs.file-max ? [message #52724] Mon, 30 January 2017 17:43 Go to next message
unlim is currently offline  unlim
Messages: 22
Registered: May 2011
Location: Ukraine
Junior Member
I'm trying to set fs.file-max inside CentOS7 CT:

# cat /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
fs.file-max = 16777216


# sysctl -p
sysctl: setting key "fs.file-max": No such file or directory


So, how to set fs.file-max ?
Re: openVZ7: how to set fs.file-max ? [message #52731 is a reply to message #52724] Wed, 08 February 2017 04:33 Go to previous messageGo to next message
ernestinemxiong is currently offline  ernestinemxiong
Messages: 1
Registered: February 2017
Junior Member
Today my DBA reported that the server she was working on was spitting out "too many open files" errors and no new processes could be started. This is a common problem with DB servers with heavy transactions. In my environment there are 6 DB instances running on the server. No quite the optimized setup I would say. The fix was to increase the total file descriptors kernel parameter count in the /etc/sysctl.conf file. I doubled my limit from 8192 to 16384. The walk through, Find out what the current open file descriptor limit is. View how many open file descriptors are currently being used. View how many files are open. The number returned might defer as 1 file descriptor can have multiple open files attached to it. If you want essay related topic you can go for custom essay writing service will get better result.
Re: openVZ7: how to set fs.file-max ? [message #52734 is a reply to message #52731] Wed, 08 February 2017 09:32 Go to previous messageGo to next message
unlim is currently offline  unlim
Messages: 22
Registered: May 2011
Location: Ukraine
Junior Member
ernestinemxiong wrote on Wed, 08 February 2017 06:33
The fix was to increase the total file descriptors kernel parameter count in the /etc/sysctl.conf file. I doubled my limit from 8192 to 16384.


What's the name of parameter you increase ?
Re: openVZ7: how to set fs.file-max ? [message #52735 is a reply to message #52724] Wed, 08 February 2017 10:24 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
unlim,

this sysctl "fs.file-max" is not virtualized (it is global for the whole Node) so you cannot change it from inside a Container,
you can change it on the Hardware Node only.

The error "sysctl: setting key "fs.file-max": No such file or directory" is a bit strange to me,
i'd expect "sysctl: permission denied on key 'fs.file-max'",
but this is another story.


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: openVZ7: how to set fs.file-max ? [message #53055 is a reply to message #52724] Wed, 13 December 2017 06:07 Go to previous message
jamesmoliver is currently offline  jamesmoliver
Messages: 1
Registered: December 2017
Location: United Kingdom
Junior Member
Your operating system set limits on how many files can be opened by any running application on your host. You can extend the basic values usually 1024 easily by modifying 2 configuration files:

# vi /etc/sysctl.conf

fs.file-max = 32000

# vi /etc/security/limits.conf

youruser soft nofile 10000
youruser hard nofile 30000

[Updated on: Thu, 14 December 2017 17:22] by Moderator

Report message to a moderator

Previous Topic: Is OPREN VZ at the End and is not developed?
Next Topic: Is there any ChangeLog for vzkernel for Virtuozzo Linux 7?
Goto Forum:
  


Current Time: Sat Jul 13 22:30:49 GMT 2024

Total time taken to generate the page: 0.02290 seconds