Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux open handle limit adjustment     - Java development environment to build under Ubuntu (Linux)

- Python programmers most often committed ten errors (Programming)

- Oracle restrict certain IP, the malicious user actions on important table (Database)

- Change CentOS 7 NIC name eno16777736 to eth0 (Linux)

- Git version rollback (Linux)

- MD5 and simple to use (Linux)

- cursor_sharing induced error ORA-00600 (Database)

- Xmanager Remote Desktop connection CentOS (Linux)

- Binary tree to the next node (Programming)

- Linux Defensive / mitigate DDOS attacks (Linux)

- Linux System Getting Started Learning: DeVeDe installed on Linux to create a video DVD (Linux)

- Ubuntu install OpenMPI (Linux)

- W and uptime command (Linux)

- Create and modify Oracle temporary table space (Database)

- Java memory model subclasses (Programming)

- Mounting kit under Fedora Linux (Linux)

- Java open source monitoring platform Zorka basic use (Linux)

- CentOS 7.1 install NTFS-3G (Linux)

- Linux / UNIX: Use the dd command to create a 1GB size binary (Linux)

- MySQL to recover the data through binlog (Database)

 
         
  Linux open handle limit adjustment
     
  Add Date : 2018-11-21      
         
         
         
  In this article only on RHEL6.4 test.

Linux handle limit is divided into a system-wide limit and 2 user-level restrictions:

/ Proc / sys / fs / nr_open> / proc / sys / fs / file-max> = ulimit -Hn> = ulimit -Sn

1 system-wide limit

1.1 / proc / sys / fs / nr_open

The total number of system file system supports file handle limit, the default value 1048576 (1M). The upper limit value is limited by system memory. This is the maximum of all restrictions.

1.2 / proc / sys / fs / file-max

The total number of file system supports file systems handle maximum must be less than nr_open view commands (the following three command equivalent):

[Root @ vm-cdh4 ~] # sysctl -a | grep -i file-max --color
fs.file-max = 188436
[Root @ vm-cdh4 ~] # cat / proc / sys / fs / file-max
188436
[Root @ vm-cdh4 ~] # sysctl -e fs.file-max
fs.file-max = 188436

View the current number of open file descriptors used by the system command:

[Root @ vm-cdh4 ~] # cat / proc / sys / fs / file-nr
8320188436

Wherein the file-max = 188436

1.3 Change file-max

Temporary change, disappear after reboot:

[Root @ vm-cdh4 ~] # sysctl -w fs.file-max = 102400

Permanent changes in /etc/sysctl.conf added (for 2.2 and 2.4 kernel):

fs.file-max = 102400
#### Only for 2.2 kernel:
#### Fs.inode-max = 102400

When the change /etc/sysctl.conf, run the following command to make the changes effective immediately:

[Root @ vm-cdh4 ~] # sysctl -p

2 user-level restrictions

2.1 hard limit ulimit -Hn

.. A single process handles hard maximum number of <= file-max View command:

[Root @ vm-cdh4 ~] # ulimit -Hn
4096

Temporary changes disappear after reboot:

[Root @ vm-cdh4 ~] # ulimit -Hn 8192
[Root @ vm-cdh4 ~] # ulimit -Hn
8192

2.2 soft cap ulimit -Sn

Soft cap the number of handles a single process, <= ulimit -Hn view commands:

[Root @ vm-cdh4 ~] # ulimit -Sn
1024
[Root @ vm-cdh4 ~] # ulimit -n
1024

Temporary changes disappear after reboot:

[Root @ vm-cdh4 ~] # ulimit -Sn 8000
[Root @ vm-cdh4 ~] # ulimit -n
8000

2.3 modify the maximum number of handles a single process

While temporarily modify the soft and hard limit (<= file-max) disappears after reboot:

[Root @ vm-cdh4 ~] # ulimit-SHn 10240

Permanently modify the soft and hard limit (RHEL6.4), provided /etc/security/limits.conf in (* represents all users):

# ......
# @ Student - maxlogins 4

* Hard nofile 10240
* Soft nofile 10240

# End of file
     
         
         
         
  More:      
 
- Let VMware ESXi virtual switch support VLAN (Linux)
- Go Languages Reviews (Programming)
- Linux, modify the hostname (Linux)
- The difference Docker save and export commands (Linux)
- Linux environment to build next Cocos2dx-3.3.1 (Linux)
- The oh-my-zsh into true my zsh (Linux)
- Fedora 23 How to install LAMP server (Server)
- CentOS 6 kernel upgrade to Kernel 3.x (Linux)
- Nodejs mysql pool Example (Programming)
- Linux system started to learn: the Linux syslog (Linux)
- Windows 7 hard disk to install Ubuntu 15.04 (Linux)
- Oracle 11g How dataguard master repository to Oracle single instance data recovery (Database)
- Ubuntu update bug fixes Daquan (Linux)
- Source compiler install Nginx (Server)
- Four Methods of Self - Learning Linux (Linux)
- Linux systems use logwatch log file monitoring (Linux)
- Oracle Database asynchronous IO cause slow query response (Database)
- C # function (Programming)
- Linux dynamic libraries and Guide (Programming)
- Ubuntu 14.04 jdk Installation and Configuration (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.