Ulimit: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
No edit summary
(Fix: remove --- horizontal lines (7 removed))
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''<code>ulimit</code>''' is a built-in [[Linux]] shell command that allows '''viewing or limiting system resource amounts''' that individual users consume. Limiting resource usage is valuable in environments with multiple users and system performance issues.  
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}
 
{{TOC}}
 
== Overview ==
 
Ulimit에 대한 기술 문서입니다.
 
=== Summary ===
 
* 무엇인가? - Ulimit
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시
 
 
== Purpose ==
 
이 문서가 존재하는 이유
 
* Goal: Ulimit에 대한 기술 정보 제공
* Scope: Ulimit의 개념, 사용법, 설정
* Non-goals: 다른 주제로의 확장
 
 
== Key Concepts ==


{| class="wikitable"
! Concept
! Description
! Related
|-
| Ulimit
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}


''limits.conf'' file is a configuration file that defines the system resource allocation settings '''<code>ulimit</code>''' uses. The full path to the configuration file is ''/etc/security/limits.conf''.  Changing the values in the file persist after system reboot.


== Detailed Explanation ==


'''<code>ulimit</code>''' is a built-in [[Linux]] shell command that allows '''viewing or limiting system resource amounts''' that individual users consume. Limiting resource usage is valuable in environments with multiple users and system performance issues.
''/etc/security/limits.conf'' file is a configuration file that defines the system resource allocation settings '''<code>ulimit</code>''' uses.  Changing the values in the file persist after system reboot.
'''To specify the ''type'' with ''ulimit'', we use ''-H'' (hard) and ''-S'' (soft), where''' ''-H'' sets hard limits, while ''-S'' sets soft limits. By default, without either flag, ''-S'' is presumed<ref>https://linuxhint.com/linux_ulimit_command/</ref>
'''To specify the ''type'' with ''ulimit'', we use ''-H'' (hard) and ''-S'' (soft), where''' ''-H'' sets hard limits, while ''-S'' sets soft limits. By default, without either flag, ''-S'' is presumed<ref>https://linuxhint.com/linux_ulimit_command/</ref>
== Soft limit ==
The soft limit is manageable by any user, and its maximum value cannot exceed the hard limit. The hard limit acts as a ceiling for the soft limit.
The soft limit is manageable by any user, and its maximum value cannot exceed the hard limit. The hard limit acts as a ceiling for the soft limit.
<code>ulimit -Sa</code>
<code>ulimit -Sa</code>
== Hard Limit ==
The hard resource limit defines physical resource limit for a user. At the same time, the hard limit is the maximum value for soft limit. '''Only root users are allowed to change the hard limit'''.
The hard resource limit defines physical resource limit for a user. At the same time, the hard limit is the maximum value for soft limit. '''Only root users are allowed to change the hard limit'''.
<code>ulimit -Ha</code>
<code>ulimit -Ha</code>
== Flag ==
The '''<code>ulimit</code>''' command takes the following general syntax
The '''<code>ulimit</code>''' command takes the following general syntax
<code>ulimit [flags][limit]</code>
<code>ulimit [flags][limit]</code>
{| class="wikitable"
{| class="wikitable sortable"
!Flag
!Flag
!Effect to
!Description
!Description
|-
|-
|'''<code>-H</code>'''
|'''<code>-H</code>'''
|
|The '''hard limit''' for the given resource. Only root users can raise the hard limit, and any process can lower it.
|The '''hard limit''' for the given resource. Only root users can raise the hard limit, and any process can lower it.
|-
|-
|'''<code>-S</code>'''
|'''<code>-S</code>'''
|The '''soft limit''' for the given resource. Any process can change the soft limit.
|
|-
 
|'''<code>-a</code>'''
 
|Lists all current resource limits.
== Best Practices ==
|-
 
|'''<code>-b</code>'''
* 최신 버전 사용 권장
|The maximum socket buffer size.
* 공식 문서 참고
|-
* 테스트 환경에서 먼저 검증
|'''<code>-c</code>'''
 
|The core dump size, expressed in the number of 512-byte blocks.
 
|-
== References ==
|'''<code>-d</code>'''
 
|The data area size, in kilobytes.
* [https://wiki.hpcmate.com Ulimit]
|-
|'''<code>-e</code>'''
|The highest process scheduling priority (nice).
|-
|'''<code>-f</code>'''
|The file size limit in blocks when using the '''<code>[limit]</code>''' parameter. Not specifying a '''<code>[limit]</code>''' instructs the command to report the file size limit.
|-
|'''<code>-i</code>'''
|The pending signal number limit.
|-
|'''<code>-k</code>'''
|The queue allocation number limit.
|-
|'''<code>-l</code>'''
|The maximum size allowed for locking in memory.
|-
|'''<code>-m</code>'''
|The physical memory size, in kilobytes.
|-
|'''<code>-n</code>'''
|The maximum number of file descriptors that a process can have.
|-
|'''<code>-p</code>'''
|The pipe buffer size.
|-
|'''<code>-P</code>'''
|The maximum number of pseudoterminals.
|-
|'''<code>-q</code>'''
|The maximum number of bytes in POSIX message queues.
|-
|'''<code>-r</code>'''
|The maximum number of threads a process can have.
|-
|'''<code>-R</code>'''
|The maximum process running time, expressed in microseconds.
|-
|'''<code>-s</code>'''
|The stack size, in kilobytes.
|-
|'''<code>-t</code>'''
|Specifies a process' maximum running time, in seconds.
|-
|'''<code>-T</code>'''
|The thread number limit.
|-
|'''<code>-u</code>'''
|Specifies how many processes a user can create.
|-
|'''<code>-v</code>'''
|The maximum virtual memory available for processes.
|-
|'''<code>-x</code>'''
|The maximum number of file locks.
|}


== Example ==
<syntaxhighlight lang="bash">
#limit the process number to 10
ulimit -u 10


#limits the file size to 50KB
== Related Pages ==
ulimit -f 50


#limits the virtual memory available for a process to 1000KB
* [[Linux]]
ulimit -v 1000
* [[Server]]
* [[Hardware]]
* [[Network]]


#limits the number of open files to five
ulimit -n 5
</syntaxhighlight>


== limit keywords ==
[[Category:Linux]]
== Knowledge Graph ==


* core – limits the core file size (KB)
Related
* data – max data size (KB)
* fsize – maximum filesize (KB)
* memlock – max locked-in-memory address space (KB)
* nofile – max number of open files
* rss – max resident set size (KB)
* stack – max stack size (KB)
* cpu – max CPU time (MIN)
* nproc – max number of processes
* as – address space limit (KB)
* maxlogins – max number of logins for this user
* maxsyslogins – max number of logins on the system
* priority – the priority to run user process with
* locks – max number of file locks the user can hold
* sigpending – max number of pending signals
* msgqueue – max memory used by POSIX message queues (bytes)
* nice – max nice priority allowed to raise to values: [-20, 19]
* rtprio – max realtime priority
* chroot – change root to directory (Debian-specific)


== Reference ==
→ [[Linux]]
<references />
→ [[Linux Kernel Tuning]]
→ [[THP (Transparent Huge Pages)]]
→ [[Sar]]
→ [[Vmstat]]


[[Category: Terminology]]
[[Category:Configuration]]
[[Category: Tuning]]

Latest revision as of 11:31, 17 July 2026

Template:Status

Template:TOC

Overview

Ulimit에 대한 기술 문서입니다.

Summary

  • 무엇인가? - Ulimit
  • 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
  • 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시


Purpose

이 문서가 존재하는 이유

  • Goal: Ulimit에 대한 기술 정보 제공
  • Scope: Ulimit의 개념, 사용법, 설정
  • Non-goals: 다른 주제로의 확장


Key Concepts

Concept Description Related
Ulimit HPC/서버 환경에서 중요한 기술 개념 Linux, Server


Detailed Explanation

ulimit is a built-in Linux shell command that allows viewing or limiting system resource amounts that individual users consume. Limiting resource usage is valuable in environments with multiple users and system performance issues. /etc/security/limits.conf file is a configuration file that defines the system resource allocation settings ulimit uses. Changing the values in the file persist after system reboot. To specify the type with ulimit, we use -H (hard) and -S (soft), where -H sets hard limits, while -S sets soft limits. By default, without either flag, -S is presumed[1] The soft limit is manageable by any user, and its maximum value cannot exceed the hard limit. The hard limit acts as a ceiling for the soft limit. ulimit -Sa The hard resource limit defines physical resource limit for a user. At the same time, the hard limit is the maximum value for soft limit. Only root users are allowed to change the hard limit. ulimit -Ha The ulimit command takes the following general syntax ulimit [flags][limit]

Flag Effect to Description
-H The hard limit for the given resource. Only root users can raise the hard limit, and any process can lower it.
-S


Best Practices

  • 최신 버전 사용 권장
  • 공식 문서 참고
  • 테스트 환경에서 먼저 검증


References


Related Pages

Knowledge Graph

Related

LinuxLinux Kernel TuningTHP (Transparent Huge Pages)SarVmstat