Production Environment:
Soft Limit: 1024
Hard Limit: 4096
Staging Environment:
Soft Limit: 96000
Hard Limit: 96000
TCA 2.3
Kubernetes 1.24.10
The values typically returned by the ulimit -n or ulimit -Hn commands in an SSH session reflect the limits of that specific interactive shell session. These are controlled by PAM configuration files (e.g., /etc/security/limits.conf).
It is observed that Kubernetes Pods and Systemd services do not inherit limits from the interactive SSH shell. These services use limits defined in their respective systemd unit files (LimitNOFILE) or container runtime configurations. Therefore, the limit of "4096" observed in an SSH session may not represent the actual limit enforced on Kubernetes workloads.
fs.file-max)The Linux kernel enforces a global ceiling for file descriptors across the entire operating system, defined by the fs.file-max parameter. In supported Photon OS versions, this value is typically calculated based on available RAM or set to a high default value to prevent system-wide bottlenecks.
To verify the system-wide limit, the following command is used:
sysctl fs.file-max
Increasing the File Descriptor Hard Limit (e.g., from 4096 to 96000) results in the following resource implications:
struct file object.To determine the specific limits applied to a running process or container (bypassing the SSH shell limits), perform the following steps:
Identify the Process ID (PID) of the application:
pidof <process_name>
Inspect the limits for that specific PID:
cat /proc/<PID>/limits
Locate the row labeled Max open files. This value represents the active limit enforced on the process.