fs.file.max parameter settings and calculation
search cancel

fs.file.max parameter settings and calculation

book

Article ID: 377824

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

By default, the value of parameter fs.file-max is 96000 which is set in the TKG template.

Environment

TCA version : 2.3
TKG version : 2.1.1

Cause

The parameter value fs.file.max is configured on all TKG nodes based on the Photon OVA template used and is set as per default design.

 

Resolution

The default value of the parameter fs.file.max is set to 96,000, based on the default configuration of Photon OVA templates, which have a default RAM allocation of 16 GB.

The calculation is as follows:

  • For every 4 MB of RAM, the limit is multiplied by 256.
  • A machine with 16 GB of RAM would have a limit of 4096 (16*1024/4) multiplied by 256, resulting in 1048576.
  • This limit is based on the assumption that no system should be using that many files to avoid running out of resources.

It is recommended to keep this setting as is, unless there is a specific requirement to increase it. If there is specific need to increase the limit, it can be achieved by adding fs.file-max setting in both /etc/sysctl.d/99-telco.conf and /etc/sysctl.conf via CSAR file injection. 

  • Add following lines to the /etc/systctl.d/99-telco.conf file and inject the file via CSAR file injection:
    fs.file-max=1048576
  • Modify the fs.file-max setting /etc/sysctl.conf file and inject the modified file via CSAR file injection.
    • For K8s version 1.24.10, the default sysctl.conf values example are as mentioned below:
      fs.file-max=96000 --> change this line to 1048576
      net.ipv4.tcp_syncookies=1
      kernel.randomize_va_space=2
      net.ipv4.conf.all.accept_source_route=0
      net.ipv4.conf.default.accept_source_route=0
      net.ipv4.conf.eth0.accept_source_route=0
      net.ipv6.conf.all.accept_source_route=0
      net.ipv6.conf.default.accept_source_route=0
      net.ipv6.conf.eth0.accept_source_route=0
      net.ipv4.icmp_echo_ignore_broadcasts=1
      net.ipv4.conf.all.accept_redirects=0
      net.ipv4.conf.default.accept_redirects=0
      net.ipv4.conf.eth0.accept_redirects=0
      net.ipv4.conf.all.secure_redirects=0
      net.ipv4.conf.default.secure_redirects=0
      net.ipv4.conf.eth0.secure_redirects=0
      net.ipv4.conf.all.send_redirects=0
      net.ipv4.conf.default.send_redirects=0
      net.ipv4.conf.eth0.send_redirects=0
      net.ipv4.conf.all.log_martians=1
      net.ipv4.conf.default.log_martians=1
      net.ipv4.conf.eth0.log_martians=1
      net.ipv4.conf.all.rp_filter=1
      net.ipv4.conf.default.rp_filter=1
      net.ipv4.conf.eth0.rp_filter=1
      net.ipv4.conf.all.mc_forwarding=0
      net.ipv4.conf.default.mc_forwarding=0
      net.ipv4.conf.eth0.mc_forwarding=0
      net.ipv6.conf.all.mc_forwarding=0
      net.ipv6.conf.default.mc_forwarding=0
      net.ipv6.conf.eth0.mc_forwarding=0
      net.ipv4.tcp_timestamps=1