Document Type | Troubleshooting
Category | Admnistration
Applicable Product Versions | 5SP1FS01, 5SP1FS02, 5SP1FS03, 5SP1FS04, 5SP1FS06, 6FS01, 6FS02, 6FS03, 6FS04, 6FS05, 6FS06, 6FS07, 6FS07PS, 7FS01, 7FS02, 7FS02PS
Document Number | TADTS052
Issue
During Tibero startup and operation, an open error occurred with the following message.
open error.: Too many open files
This message occurs when the number of file descriptors that a process can open exceeds the system configuration value.
Cause
In the installation guide for Tibero versions 6 and below, the default nofile setting for the account is as follows:
- Soft limit: 1024
- Hard limit: 2048
If this setting is maintained and over time the number of data files gradually increases, it may exceed the configured nofile value, causing errors.
For example, if the soft limit is set to 1024, adding about 100 data files can reproduce the error.
Test Method
Below is an example where open error.: Too many open files occurs.
BEGIN FOR i IN 1..100 LOOP EXECUTE IMMEDIATE 'ALTER TABLESPACE usr ADD DATAFILE SIZE 1M'; END LOOP; END; *********************************************************************** * Warning: * Current maximum number of open files = 1024 * Required maximum number of open files for Tibero process = 1026 Recommend adjusting maximum number of open files. *********************************************************************** *********************************************************************** * Warning: * Current maximum number of open files = 1024 * Required maximum number of open files for Tibero process = 1036 Recommend adjusting maximum number of open files. ***********************************************************************
Solutions
If an error caused by nofile limits occurs during Tibero operation, it can be addressed as follows.
1. Permanent Measure
Modify the /etc/security/limits.conf file and then restart the database.
2. Temporary Measure
You can dynamically modify it using the prlimit command. However, this method resets upon process restart, so it is a temporary solution.
If restarting is difficult, you can dynamically adjust the file descriptor limit of the running process using the prlimit command.
1. Check current settings
prlimit -p <PID>
2. Example output
[tibero@mtdb01 ~]$ prlimit -p 96653 RESOURCE DESCRIPTION SOFT HARD UNITS NOFILE max number of open files 1024 4096
3. Extend soft limit to hard limit level1
prlimit --pid 96653 --nofile=4096:4096
4. Verify changes
[tibero@mtdb01 ~]$ prlimit --pid 96653 RESOURCE DESCRIPTION SOFT HARD UNITS NOFILE max number of open files 4096 4096
5. Error example (Insufficient permissions)
[tibero@mtdb01 ~]$ prlimit --pid 96672 --nofile=65530:65530 prlimit: failed to set the NOFILE resource limit: Operation not permitted
If the command fails as above, it must be executed with root privileges.
NoteSince the Tibero process references the account's nofile setting value at startup, even if you change the ulimit value later, it will not apply to processes already running.
6. Monitoring Method
[root@mtdb01 ~]$ pid=$(ps -ef | grep '[t]bsvr' | awk 'NR==1 {print $2}'); limit=$(prlimit -p $pid | awk '/NOFILE/ {print $(NF-1)}'); used=$(ps -ef | grep 'tbsvr' | grep -v grep | awk '{print $2}' | xargs -I {} sh -c 'ls -1 /proc/{}/fd 2>/dev/null | wc -l' | awk '{sum+=$1} END{print sum}'); available=$((limit - used)); threshold=$((limit * 5 / 100)); usage_percent=$((used * 100 / limit)); echo -e "\n\nFD Limit: $limit, Used: $used, Available: $available, Threshold(5%): $threshold, Usage: ${usage_percent}%"; [ $available -lt $threshold ] && echo " Available FD is less than 5% of total." || echo " Available FD is sufficient."
You can use the following command to check if the FD value is insufficient.
If AVAILABLE is close to 0, and
Usage is close to 100, it means FD value adjustment is necessary.
Meaning | Description | |
|---|---|---|
FD LIMIT | Maximum number of file descriptors (FD) allowed | The maximum number of files, sockets, pipes, etc. that the process (tbsvr) can open. In Linux, can be checked with ulimit -n or prlimit commands. Files beyond this cannot be opened. |
Used | Number of file descriptors currently used by tbsvr-related processes | The total number of FDs actually opened by tbsvr-related processes. That is, the current number of open files/sockets. |
Available | Number of FDs still available to open | Calculated as FD Limit - Used. Number of FDs that the system can still open. |
Threshold | Warning threshold (5% of total) | Represents 5% of the total FD limit. If the remaining FD (Available) is less than this value when running the command, a "less than 5% warning" message is displayed. |
Usage | Current usage percentage (%) | Calculated as (Used รท Limit) ร 100. Shows at a glance how much of the FD limit is currently used. |