Linux ulimit command details how to use Linux ulimit command

Source: Internet
Author: User
Tags posix cpu usage

Ulimit is a shell-built directive that can be used to control the resources of shell execution programs.

Grammar

ulimit [-ahs][-c <core file Caps >][-d < data section size >][-f < file size >][-m < memory size]

[-N < number of files] [-p < buffer size] [-s < stacking size] [t <cpu time] [-U < Program number] [-v < virtual memory size]

Parameters:

    • -a displays the current resource constraint settings.
    • -c <core File upper limit > set the maximum value of core file, the unit is block.
    • -D < data section size > The maximum value of the data section of the program, in kilobytes.
    • -F < file size > The largest file the shell can establish, in blocks.
    • -H set the hard limit of the resource, which is the limit set by the administrator.
    • -m < memory size > Specifies the maximum amount of memory that can be used, in kilobytes.
    • -N < number of files > Specify the maximum number of files that can be opened at the same time.
    • -p < buffer size > Specifies the size of the pipe buffer, in units of 512 bytes.
    • -s < stacking size > Specifies the upper bound of the stack in kilobytes.
    • -S sets the flexibility limit for resources.
    • -T <CPU time > Specify the maximum CPU usage time in seconds.
    • -U < number of programs > The maximum number of programs that users can open.
    • -v < virtual memory size > Specify the maximum amount of virtual memory that can be used, in kilobytes.

Instance

To display system resource settings

[Root@w3cschool.cc ~]# Ulimit-a

Core file size (blocks,-c) 0

Data seg Size (Kbytes,-D) Unlimited

File size (blocks,-f) Unlimited

Pending Signals (I.) 1024

Max locked Memory (Kbytes, L) 32

Max memory Size (Kbytes, M) Unlimited

Open files (-N) 1024

Pipe Size (bytes, p) 8

POSIX message queues (bytes,-Q) 819200

Stack size (Kbytes,-s) 10240

CPU time (seconds,-t) unlimited

MAX User Processes (-u) 4096

Virtual Memory (Kbytes,-V) Unlimited

File locks (-X) Unlimited

[Root@w3cschool.cc ~]#

Set the maximum number of single user programs

[root@w3cschool.cc ~]# ulimit-u 500//Set a single user program limit

[Root@w3cschool.cc ~]# Ulimit-a

Core file size (blocks,-c) 0

Data seg Size (Kbytes,-D) Unlimited

File size (blocks,-f) Unlimited

Pending Signals (I.) 1024

Max locked Memory (Kbytes, L) 32

Max memory Size (Kbytes, M) Unlimited

Open files (-N) 1024

Pipe Size (bytes, p) 8

POSIX message queues (bytes,-Q) 819200

Stack size (Kbytes,-s) 10240

CPU time (seconds,-t) unlimited

MAX User Processes (-u) 500

Virtual Memory (Kbytes,-V) Unlimited

File locks (-X) Unlimited

[Root@w3cschool.cc ~]#

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.