Docs / Linux Basics / How to Configure Resource Limits with ulimit

How to Configure Resource Limits with ulimit

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 26 views · 2 min read

How to Configure Resource Limits with ulimit

Resource limits prevent any single process from consuming all available resources on your Breeze. The ulimit command and /etc/security/limits.conf file let you control memory, file descriptors, CPU time, and more.

Viewing Current Limits

# Show all soft limits
ulimit -a

# Show all hard limits
ulimit -Ha

# Show specific limits
ulimit -n    # open files
ulimit -u    # max processes
ulimit -v    # virtual memory (KB)

Setting Temporary Limits

# Increase open file limit for current shell
ulimit -n 65536

# Set max processes
ulimit -u 4096

Persistent Configuration

Edit /etc/security/limits.conf to set permanent limits:

# /etc/security/limits.conf
www-data    soft    nofile    65536
www-data    hard    nofile    65536
deploy      soft    nproc     4096
deploy      hard    nproc     8192
*           soft    core      0

Systemd Service Limits

For services managed by systemd, set limits in the unit file:

# /etc/systemd/system/myapp.service
[Service]
LimitNOFILE=65536
LimitNPROC=4096
LimitCORE=0
sudo systemctl daemon-reload
sudo systemctl restart myapp

Common Limits to Tune

  • nofile — open file descriptors (critical for web servers and databases)
  • nproc — maximum number of processes per user
  • core — core dump file size (set to 0 to disable)
  • memlock — locked memory for applications like databases

Properly configured limits keep your Breeze stable under load and prevent runaway processes from causing outages.

Was this article helpful?