Some commands are often used during Linux learning. Are you familiar with these commands? For beginners, this article describes Linux regulatory commands in detail and plays a role in learning Linux regulatory commands.
Lsof: displays the list of currently opened files, including WEkO. xBQ, and I. This command can be used by programmers to check the number of files opened by the program.
Sysctl: displays or sets system kernel parameters.
Sysctl-a displays all Kernel Parameters
Sysctl-w parameter name = parameter value
For example, sysctl-w fs. file-max = 10240 sets the maximum number of files allowed to be opened simultaneously by the system to be 10240.
The Kernel Parameter fs. file-nr contains three parameter values: 'vk} N * u} + country F tqU} 9 \
Me't ['net X Education sSj net' tbS
The first parameter indicates the peak number of files opened at the same time in the system,
Uq K4O teach F, C tube L4 @
The second parameter indicates the number of files that have been released after idle allocation,
The third parameter indicates the maximum number of files that can be opened. The value is equal to fs. file-max.
Number of files currently opened = first parameter value-second parameter value
For example:
Fs. file-nr = 977 223 10240
Number of files currently opened = 977-233 = 744
Be careful when setting kernel parameters. Improper settings may cause system exceptions or even crash.
Ulimit: display or set) resource limits that users can use
Ulimit-a displays the resource limits that users can use
Ulimit unlimited does not limit the resources that users can use, but this setting sets the maximum number of files that can be opened max open files)
And the maximum number of processes that can run simultaneously. max user processes) is invalid.
Ulimit-n <number of files that can be opened at the same time> set the maximum number of files that can be opened at the same time max open files)
Example: ulimit-n 8192
If this parameter is set too small, the too program open files error may occur for websites with a large number of concurrent visits.
Ulimit-u <maximum number of concurrent processes that can be run> set the maximum number of processes that can be run simultaneously by the user max user processes)
For example, ulimit-u 1024
The above is an introduction to some Linux regulatory commands.
- Linux virtualization technology Xen virtualization beginner's Guide
- Handling Linux kernel security details
- Basic Shell programming syntax in Linux
- How to program and run a Shell program in Linux
- Linux Shell programming bash Internal commands