SlideShare a Scribd company logo
1 of 31
Linux Resource Linux Resource 
ManagementManagement
Marian HackMan Marinov
Chief System Architect
mm@siteground.com
Who am I?Who am I?
●
Chief System Architect - SiteGroundChief System Architect - SiteGround
●
Linux System Administrator since 1996Linux System Administrator since 1996
●
Teaching LSA and NetSec at FMI SofiaTeaching LSA and NetSec at FMI Sofia
●
Organizing OpenFest and othersOrganizing OpenFest and others
●
ulimitulimit
●
quotaquota
●
CPU affinity per-device and per-processCPU affinity per-device and per-process
●
cGroupscGroups
cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited
scheduling priority (-e) 0scheduling priority (-e) 0
real-time priority (-r) 0real-time priority (-r) 0
file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited
pending signals (-i) 96832pending signals (-i) 96832
open files (-n) 1024open files (-n) 1024
file locks (-x) unlimitedfile locks (-x) unlimited
pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200
max user processes (-u) 200max user processes (-u) 200
max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited
virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited
core file size (blocks, -c) 0core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited
stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192
ulimitsulimits
app1
userXuserX
  user  procsuser  procs
userX    1userX    1
tty:tty:
core file size (blocks, -c) 0core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited
scheduling priority (-e) 0scheduling priority (-e) 0
file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited
pending signals (-i) 96832pending signals (-i) 96832
max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited
open files (-n) 1024open files (-n) 1024
pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0real-time priority (-r) 0
stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited
max user processes (-u) 200max user processes (-u) 200
virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited
file locks (-x) unlimitedfile locks (-x) unlimited
ulimitsulimits
app2
app1
userXuserX
userXuserX
  user  procsuser  procs
userX    2userX    2
tty:tty:
core file size (blocks, -c) 0core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited
scheduling priority (-e) 0scheduling priority (-e) 0
file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited
pending signals (-i) 96832pending signals (-i) 96832
max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited
open files (-n) 1024open files (-n) 1024
pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0real-time priority (-r) 0
stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited
max user processes (-u) 200max user processes (-u) 200
virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited
file locks (-x) unlimitedfile locks (-x) unlimited
ulimitsulimits
app2
app1
app3
userXuserX
userXuserX
userXuserX
  user  procsuser  procs
userX    3userX    3
tty:tty:
core file size (blocks, -c) 0core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited
scheduling priority (-e) 0scheduling priority (-e) 0
file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited
pending signals (-i) 96832pending signals (-i) 96832
max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited
open files (-n) 1024open files (-n) 1024
pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0real-time priority (-r) 0
stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited
max user processes (-u) 200max user processes (-u) 200
virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited
file locks (-x) unlimitedfile locks (-x) unlimited
ulimitsulimits
core file size (blocks, -c) 0core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited
scheduling priority (-e) 0scheduling priority (-e) 0
file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited
pending signals (-i) 96832pending signals (-i) 96832
max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited
open files (-n) 1024open files (-n) 1024
pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0real-time priority (-r) 0
stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited
max user processes (-u) 200max user processes (-u) 200
virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited
file locks (-x) unlimitedfile locks (-x) unlimited
app2
app1
app3
userXuserX
userXuserX
userXuserX
  user  procsuser  procs
userX    4userX    4
app4
userXuserX
ssh:ssh:
tty:tty:
ulimitsulimits
● login (on tty, via PAM)
● KDM, GDM, XDM & etc. (locally via PAM)
● ssh (remotely, via PAM and shell)
● pam_limits
– /etc/security/limits.conf
– /etc/security/limits.d/
● shell (sh, bash, zsh, csh, tcsh)
– /etc/profile.d/limits.[tcz]sh
ulimitsulimits how-tohow-to
$ cat /proc/self/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 200 200 processes
Max open files 1024 4096 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 200 200 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
ulimitsulimits how-tohow-to
$ cat /proc/self/limits
on older kernels:
$ echo -n "Max open files=2000:6000"
> /proc/self/limits
$ prlimit
ulimitsulimits how-tohow-to
Other kernel limits
● fs.file-max - max fd for the machine
● fs.nr_open - max fd per process
● fs.mount-max - max mounted filesystems
● kernel.threads-max
● Dedicate a CPU to HW device
● Dedicate a CPU to a process
● taskset mask cmd
● /proc/interrupts
– /proc/irq/NUM/smp_affinity
– /proc/irq/NUM/smp_affinity_list
– /proc/irq/NUM/affinity_hint
CPU AffinityCPU Affinity
● Dedicate a CPU to HW device
● Dedicate a CPU to a process
core0 core1
core2 core3
eth0 1Gbps
eth4 10Gbps
megaraid 6Gbps
CPU AffinityCPU Affinity
● Dedicate a CPU to HW device
● Dedicate a CPU to a process
core0 core1
core2 core3
eth0 1Gbps
eth1 10Gbps
eth2 10Gbps
megaraid 6Gbps
core0 - eth1 10Gbps
core1 - eth2 10Gbps
core3 - megaraid 6Gbps
core4 - eth0 & processes
CPU AffinityCPU Affinity
taskset example
root@terion:~# taskset -p 2727
pid 2727's current affinity mask: ff
root@terion:~# taskset -pc 3 2727
pid 2727's current affinity list: 0-7
pid 2727's new affinity list: 3
root@terion:~# taskset -p 2727
pid 2727's current affinity mask: 8
root@terion:~# ps axf|grep 2727
2727 ? Ss 2:06 /usr/sbin/acpid
root@terion:~#
irq affinity example
root@terion:~# cat /proc/interrupts
CPU0 CPU1
16: 3567385 0 IO-APIC 16-fasteoi ehci_hcd:usb1
17: 4567 0 IO-APIC 17-fasteoi snd_hda_intel:
23: 50797 0 IO-APIC 23-fasteoi ehci_hcd:usb2
25: 78045696 0 PCI-MSI 512000-edge ahci
36: 12 0 PCI-MSI 409600-edge eth0
37: 169256226 0 PCI-MSI 1572864-edge iwlwifi
38: 3515939 0 PCI-MSI 524288-edge nvidia
irq affinity example
root@terion:~# cd /proc/irq/37
root@terion:/proc/irq/37# cat smp_affinity
ff
root@terion:/proc/irq/37# cat smp_affinity_list
0-7
root@terion:/proc/irq/37# echo 3 > smp_affinity_list
root@terion:/proc/irq/37# cat smp_affinity
08
root@terion:/proc/irq/37# cat smp_affinity_list
3
root@terion:/proc/irq/37#
Other resource limitations can be
enforced using virtualization
technologies like KVM, Xen, etc.
What if you want to set a limit to a
group of processes?
● CPUSET
● CPU
● CPUACCT
● MEMORY
● BLKIO
● DEVICES
● freezer
● net_cls
● net_prio
● perf_event
● hudgetlb
cGroupscGroups
cGroupscGroups
● freezer
● net_cls
● net_prio
● perf_event
● hudgetlb
● CPUSET
● CPU
● CPUACCT
● MEMORY
● BLKIO
● DEVICES
● cGroups have hierarchy
//
/user1/user1
/user2/user2
/user1/user3/user1/user3
cGroupscGroups
root@goblin:/cgroup# ls -1 cpuset*
cpuset.cpus
cpuset.mems
cpuset.cpu_exclusive
cpuset.mem_exclusive
cpuset.effective_cpus
cpuset.effective_mems
...
cGroupscGroups CPUSETCPUSET
root@goblin:/cgroup# ls -1 cpu.*
cpu.cfs_period_us
cpu.cfs_quota_us
cpu.rt_period_us
cpu.rt_runtime_us
cpu.shares
cpu.stat
cGroupscGroups CPUCPU
root@goblin:/cgroup# ls -1 cpuacct.*
cpuacct.stat
cpuacct.usage
cpuacct.usage_percpu
cpuacct.usage_all
cpuacct.usage_percpu_sys
cpuacct.usage_percpu_user
cpuacct.usage_sys
cpuacct.usage_user
CPUACCTCPUACCTcGroupscGroups
memory.memsw.failcnt
memory.memsw.limit_in_bytes
memory.memsw.max_usage_in_bytes
memory.memsw.usage_in_bytes
memory.limit_in_bytes memory.usage_in_bytes
memory.soft_limit_in_bytes
memory.max_usage_in_bytes
memory.move_charge_at_immigrate memory.failcnt
memory.numa_stat memory.stat
memory.oom_control memory.pressure_level
memory.swappiness memory.use_hierarchy
cGroupscGroups MEMORYMEMORY
blkio.throttle.io_service_bytes
blkio.throttle.io_serviced
blkio.throttle.read_bps_device
blkio.throttle.read_iops_device
blkio.throttle.write_bps_device
blkio.throttle.write_iops_device
cGroupscGroups BLKIOBLKIO
blkio.weight
blkio.weight_device
blkio.leaf_weight
blkio.leaf_weight_device
BLKIOBLKIOcGroupscGroups
cGroupscGroups
root@goblin:/cgroup# ls -1 devices.*
devices.allow
devices.deny
devices.list
DEVICESDEVICES
Marian HackMan Marinov
Chief System Architect
mm@siteground.com
QuestionsQuestions

More Related Content

What's hot

Wuala, P2P Online Storage
Wuala, P2P Online StorageWuala, P2P Online Storage
Wuala, P2P Online Storageadunne
 
Hadoop Installation and basic configuration
Hadoop Installation and basic configurationHadoop Installation and basic configuration
Hadoop Installation and basic configurationGerrit van Vuuren
 
General commands for navisphere cli
General commands for navisphere cliGeneral commands for navisphere cli
General commands for navisphere climsaleh1234
 
Integration of neutron, nova and designate how to use it and how to configur...
Integration of neutron, nova and designate  how to use it and how to configur...Integration of neutron, nova and designate  how to use it and how to configur...
Integration of neutron, nova and designate how to use it and how to configur...Miguel Lavalle
 
Проблемы использования TCP в мобильных приложениях. Владимир Кириллов
Проблемы использования TCP в мобильных приложениях.  Владимир КирилловПроблемы использования TCP в мобильных приложениях.  Владимир Кириллов
Проблемы использования TCP в мобильных приложениях. Владимир КирилловAnthony Marchenko
 
Archiving in linux tar
Archiving in linux tarArchiving in linux tar
Archiving in linux tarInfoExcavator
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecturehugo lu
 
Galaxy CloudMan performance on AWS
Galaxy CloudMan performance on AWSGalaxy CloudMan performance on AWS
Galaxy CloudMan performance on AWSEnis Afgan
 
Linux Kernel 개발참여방법과 문화 (Contribution)
Linux Kernel 개발참여방법과 문화 (Contribution)Linux Kernel 개발참여방법과 문화 (Contribution)
Linux Kernel 개발참여방법과 문화 (Contribution)Ubuntu Korea Community
 
Hadoop spark performance comparison
Hadoop spark performance comparisonHadoop spark performance comparison
Hadoop spark performance comparisonarunkumar sadhasivam
 
The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat SheetTola LENG
 
Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016Markus Höfer
 
Fight Against Citadel in Japan  by You Nakatsuru
Fight Against Citadel in Japan  by You NakatsuruFight Against Citadel in Japan  by You Nakatsuru
Fight Against Citadel in Japan  by You NakatsuruCODE BLUE
 
Improving go-git performance
Improving go-git performanceImproving go-git performance
Improving go-git performancesource{d}
 
2014-4Q-OpenStack-Fall-presentation-public-20150310a
2014-4Q-OpenStack-Fall-presentation-public-20150310a2014-4Q-OpenStack-Fall-presentation-public-20150310a
2014-4Q-OpenStack-Fall-presentation-public-20150310aKen Igarashi
 

What's hot (20)

Wuala, P2P Online Storage
Wuala, P2P Online StorageWuala, P2P Online Storage
Wuala, P2P Online Storage
 
Hadoop Installation and basic configuration
Hadoop Installation and basic configurationHadoop Installation and basic configuration
Hadoop Installation and basic configuration
 
General commands for navisphere cli
General commands for navisphere cliGeneral commands for navisphere cli
General commands for navisphere cli
 
Unix 6 en
Unix 6 enUnix 6 en
Unix 6 en
 
Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
Log
LogLog
Log
 
Integration of neutron, nova and designate how to use it and how to configur...
Integration of neutron, nova and designate  how to use it and how to configur...Integration of neutron, nova and designate  how to use it and how to configur...
Integration of neutron, nova and designate how to use it and how to configur...
 
Проблемы использования TCP в мобильных приложениях. Владимир Кириллов
Проблемы использования TCP в мобильных приложениях.  Владимир КирилловПроблемы использования TCP в мобильных приложениях.  Владимир Кириллов
Проблемы использования TCP в мобильных приложениях. Владимир Кириллов
 
Log
LogLog
Log
 
Archiving in linux tar
Archiving in linux tarArchiving in linux tar
Archiving in linux tar
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
 
Galaxy CloudMan performance on AWS
Galaxy CloudMan performance on AWSGalaxy CloudMan performance on AWS
Galaxy CloudMan performance on AWS
 
Network sockets
Network socketsNetwork sockets
Network sockets
 
Linux Kernel 개발참여방법과 문화 (Contribution)
Linux Kernel 개발참여방법과 문화 (Contribution)Linux Kernel 개발참여방법과 문화 (Contribution)
Linux Kernel 개발참여방법과 문화 (Contribution)
 
Hadoop spark performance comparison
Hadoop spark performance comparisonHadoop spark performance comparison
Hadoop spark performance comparison
 
The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat Sheet
 
Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016Bucket your partitions wisely - Cassandra summit 2016
Bucket your partitions wisely - Cassandra summit 2016
 
Fight Against Citadel in Japan  by You Nakatsuru
Fight Against Citadel in Japan  by You NakatsuruFight Against Citadel in Japan  by You Nakatsuru
Fight Against Citadel in Japan  by You Nakatsuru
 
Improving go-git performance
Improving go-git performanceImproving go-git performance
Improving go-git performance
 
2014-4Q-OpenStack-Fall-presentation-public-20150310a
2014-4Q-OpenStack-Fall-presentation-public-20150310a2014-4Q-OpenStack-Fall-presentation-public-20150310a
2014-4Q-OpenStack-Fall-presentation-public-20150310a
 

Similar to Linux resource limits

End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...DataWorks Summit/Hadoop Summit
 
Shak larry-jeder-perf-and-tuning-summit14-part2-final
Shak larry-jeder-perf-and-tuning-summit14-part2-finalShak larry-jeder-perf-and-tuning-summit14-part2-final
Shak larry-jeder-perf-and-tuning-summit14-part2-finalTommy Lee
 
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)Ontico
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterAndrey Kudryavtsev
 
Varnish http accelerator
Varnish http acceleratorVarnish http accelerator
Varnish http acceleratorno no
 
Monitoring with Prometheus
Monitoring with PrometheusMonitoring with Prometheus
Monitoring with PrometheusShiao-An Yuan
 
import rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Pythonimport rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Pythongroveronline
 
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)PROIDEA
 
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposhaPgDay.Seoul
 
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」Shinya Takamaeda-Y
 
Accelerating HPC Applications on NVIDIA GPUs with OpenACC
Accelerating HPC Applications on NVIDIA GPUs with OpenACCAccelerating HPC Applications on NVIDIA GPUs with OpenACC
Accelerating HPC Applications on NVIDIA GPUs with OpenACCinside-BigData.com
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingMarian Marinov
 
Advertising Fraud Detection at Scale at T-Mobile
Advertising Fraud Detection at Scale at T-MobileAdvertising Fraud Detection at Scale at T-Mobile
Advertising Fraud Detection at Scale at T-MobileDatabricks
 
PerfUG 3 - perfs système
PerfUG 3 - perfs systèmePerfUG 3 - perfs système
PerfUG 3 - perfs systèmeLudovic Piot
 
Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Mikhail Belopuhov: OpenBSD: Where is crypto headed?Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Mikhail Belopuhov: OpenBSD: Where is crypto headed?Yandex
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Praguetomasbart
 

Similar to Linux resource limits (20)

ulimit
ulimit ulimit
ulimit
 
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
 
Shak larry-jeder-perf-and-tuning-summit14-part2-final
Shak larry-jeder-perf-and-tuning-summit14-part2-finalShak larry-jeder-perf-and-tuning-summit14-part2-final
Shak larry-jeder-perf-and-tuning-summit14-part2-final
 
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
Java и Linux — особенности эксплуатации / Алексей Рагозин (Дойче Банк)
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
 
Varnish http accelerator
Varnish http acceleratorVarnish http accelerator
Varnish http accelerator
 
Monitoring with Prometheus
Monitoring with PrometheusMonitoring with Prometheus
Monitoring with Prometheus
 
Serial-War
Serial-WarSerial-War
Serial-War
 
import rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Pythonimport rdma: zero-copy networking with RDMA and Python
import rdma: zero-copy networking with RDMA and Python
 
LSA2 - 02 Namespaces
LSA2 - 02  NamespacesLSA2 - 02  Namespaces
LSA2 - 02 Namespaces
 
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
CONFidence 2017: Hacking embedded with OpenWrt (Vladimir Mitiouchev)
 
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
 
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」
 
Accelerating HPC Applications on NVIDIA GPUs with OpenACC
Accelerating HPC Applications on NVIDIA GPUs with OpenACCAccelerating HPC Applications on NVIDIA GPUs with OpenACC
Accelerating HPC Applications on NVIDIA GPUs with OpenACC
 
Low-level Accesses
Low-level AccessesLow-level Accesses
Low-level Accesses
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
 
Advertising Fraud Detection at Scale at T-Mobile
Advertising Fraud Detection at Scale at T-MobileAdvertising Fraud Detection at Scale at T-Mobile
Advertising Fraud Detection at Scale at T-Mobile
 
PerfUG 3 - perfs système
PerfUG 3 - perfs systèmePerfUG 3 - perfs système
PerfUG 3 - perfs système
 
Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Mikhail Belopuhov: OpenBSD: Where is crypto headed?Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Mikhail Belopuhov: OpenBSD: Where is crypto headed?
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 

More from Marian Marinov

Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingMarian Marinov
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsMarian Marinov
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Marian Marinov
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDBMarian Marinov
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMarian Marinov
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfMarian Marinov
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home eraMarian Marinov
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefsMarian Marinov
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd Marian Marinov
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storageMarian Marinov
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Marian Marinov
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL serverMarian Marinov
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKMarian Marinov
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networksMarian Marinov
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automationMarian Marinov
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingMarian Marinov
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of serversMarian Marinov
 
Let's Encrypt failures
Let's Encrypt failuresLet's Encrypt failures
Let's Encrypt failuresMarian Marinov
 

More from Marian Marinov (20)

Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanisms
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDB
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdf
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home era
 
Managing sysadmins
Managing sysadminsManaging sysadmins
Managing sysadmins
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL server
 
Sysadmin vs. dev ops
Sysadmin vs. dev opsSysadmin vs. dev ops
Sysadmin vs. dev ops
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networks
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automation
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel tracking
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of servers
 
Let's Encrypt failures
Let's Encrypt failuresLet's Encrypt failures
Let's Encrypt failures
 

Recently uploaded

IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 

Linux resource limits

  • 2. Who am I?Who am I? ● Chief System Architect - SiteGroundChief System Architect - SiteGround ● Linux System Administrator since 1996Linux System Administrator since 1996 ● Teaching LSA and NetSec at FMI SofiaTeaching LSA and NetSec at FMI Sofia ● Organizing OpenFest and othersOrganizing OpenFest and others
  • 3. ● ulimitulimit ● quotaquota ● CPU affinity per-device and per-processCPU affinity per-device and per-process ● cGroupscGroups
  • 4. cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited scheduling priority (-e) 0scheduling priority (-e) 0 real-time priority (-r) 0real-time priority (-r) 0 file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited pending signals (-i) 96832pending signals (-i) 96832 open files (-n) 1024open files (-n) 1024 file locks (-x) unlimitedfile locks (-x) unlimited pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200 max user processes (-u) 200max user processes (-u) 200 max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited core file size (blocks, -c) 0core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192 ulimitsulimits
  • 5. app1 userXuserX   user  procsuser  procs userX    1userX    1 tty:tty: core file size (blocks, -c) 0core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited scheduling priority (-e) 0scheduling priority (-e) 0 file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited pending signals (-i) 96832pending signals (-i) 96832 max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited open files (-n) 1024open files (-n) 1024 pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0real-time priority (-r) 0 stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited max user processes (-u) 200max user processes (-u) 200 virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited file locks (-x) unlimitedfile locks (-x) unlimited ulimitsulimits
  • 6. app2 app1 userXuserX userXuserX   user  procsuser  procs userX    2userX    2 tty:tty: core file size (blocks, -c) 0core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited scheduling priority (-e) 0scheduling priority (-e) 0 file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited pending signals (-i) 96832pending signals (-i) 96832 max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited open files (-n) 1024open files (-n) 1024 pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0real-time priority (-r) 0 stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited max user processes (-u) 200max user processes (-u) 200 virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited file locks (-x) unlimitedfile locks (-x) unlimited ulimitsulimits
  • 7. app2 app1 app3 userXuserX userXuserX userXuserX   user  procsuser  procs userX    3userX    3 tty:tty: core file size (blocks, -c) 0core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited scheduling priority (-e) 0scheduling priority (-e) 0 file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited pending signals (-i) 96832pending signals (-i) 96832 max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited open files (-n) 1024open files (-n) 1024 pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0real-time priority (-r) 0 stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited max user processes (-u) 200max user processes (-u) 200 virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited file locks (-x) unlimitedfile locks (-x) unlimited ulimitsulimits
  • 8. core file size (blocks, -c) 0core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimiteddata seg size (kbytes, -d) unlimited scheduling priority (-e) 0scheduling priority (-e) 0 file size (blocks, -f) unlimitedfile size (blocks, -f) unlimited pending signals (-i) 96832pending signals (-i) 96832 max locked memory (kbytes, -l) 64max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimitedmax memory size (kbytes, -m) unlimited open files (-n) 1024open files (-n) 1024 pipe size (512 bytes, -p) 8pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0real-time priority (-r) 0 stack size (kbytes, -s) 8192stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimitedcpu time (seconds, -t) unlimited max user processes (-u) 200max user processes (-u) 200 virtual memory (kbytes, -v) unlimitedvirtual memory (kbytes, -v) unlimited file locks (-x) unlimitedfile locks (-x) unlimited app2 app1 app3 userXuserX userXuserX userXuserX   user  procsuser  procs userX    4userX    4 app4 userXuserX ssh:ssh: tty:tty: ulimitsulimits
  • 9. ● login (on tty, via PAM) ● KDM, GDM, XDM & etc. (locally via PAM) ● ssh (remotely, via PAM and shell) ● pam_limits – /etc/security/limits.conf – /etc/security/limits.d/ ● shell (sh, bash, zsh, csh, tcsh) – /etc/profile.d/limits.[tcz]sh ulimitsulimits how-tohow-to
  • 10. $ cat /proc/self/limits Limit Soft Limit Hard Limit Units Max cpu time unlimited unlimited seconds Max file size unlimited unlimited bytes Max data size unlimited unlimited bytes Max stack size 8388608 unlimited bytes Max core file size 0 unlimited bytes Max resident set unlimited unlimited bytes Max processes 200 200 processes Max open files 1024 4096 files Max locked memory 65536 65536 bytes Max address space unlimited unlimited bytes Max file locks unlimited unlimited locks Max pending signals 200 200 signals Max msgqueue size 819200 819200 bytes Max nice priority 0 0 Max realtime priority 0 0 Max realtime timeout unlimited unlimited us ulimitsulimits how-tohow-to
  • 11. $ cat /proc/self/limits on older kernels: $ echo -n "Max open files=2000:6000" > /proc/self/limits $ prlimit ulimitsulimits how-tohow-to
  • 12. Other kernel limits ● fs.file-max - max fd for the machine ● fs.nr_open - max fd per process ● fs.mount-max - max mounted filesystems ● kernel.threads-max
  • 13. ● Dedicate a CPU to HW device ● Dedicate a CPU to a process ● taskset mask cmd ● /proc/interrupts – /proc/irq/NUM/smp_affinity – /proc/irq/NUM/smp_affinity_list – /proc/irq/NUM/affinity_hint CPU AffinityCPU Affinity
  • 14. ● Dedicate a CPU to HW device ● Dedicate a CPU to a process core0 core1 core2 core3 eth0 1Gbps eth4 10Gbps megaraid 6Gbps CPU AffinityCPU Affinity
  • 15. ● Dedicate a CPU to HW device ● Dedicate a CPU to a process core0 core1 core2 core3 eth0 1Gbps eth1 10Gbps eth2 10Gbps megaraid 6Gbps core0 - eth1 10Gbps core1 - eth2 10Gbps core3 - megaraid 6Gbps core4 - eth0 & processes CPU AffinityCPU Affinity
  • 16. taskset example root@terion:~# taskset -p 2727 pid 2727's current affinity mask: ff root@terion:~# taskset -pc 3 2727 pid 2727's current affinity list: 0-7 pid 2727's new affinity list: 3 root@terion:~# taskset -p 2727 pid 2727's current affinity mask: 8 root@terion:~# ps axf|grep 2727 2727 ? Ss 2:06 /usr/sbin/acpid root@terion:~#
  • 17. irq affinity example root@terion:~# cat /proc/interrupts CPU0 CPU1 16: 3567385 0 IO-APIC 16-fasteoi ehci_hcd:usb1 17: 4567 0 IO-APIC 17-fasteoi snd_hda_intel: 23: 50797 0 IO-APIC 23-fasteoi ehci_hcd:usb2 25: 78045696 0 PCI-MSI 512000-edge ahci 36: 12 0 PCI-MSI 409600-edge eth0 37: 169256226 0 PCI-MSI 1572864-edge iwlwifi 38: 3515939 0 PCI-MSI 524288-edge nvidia
  • 18. irq affinity example root@terion:~# cd /proc/irq/37 root@terion:/proc/irq/37# cat smp_affinity ff root@terion:/proc/irq/37# cat smp_affinity_list 0-7 root@terion:/proc/irq/37# echo 3 > smp_affinity_list root@terion:/proc/irq/37# cat smp_affinity 08 root@terion:/proc/irq/37# cat smp_affinity_list 3 root@terion:/proc/irq/37#
  • 19. Other resource limitations can be enforced using virtualization technologies like KVM, Xen, etc.
  • 20. What if you want to set a limit to a group of processes?
  • 21. ● CPUSET ● CPU ● CPUACCT ● MEMORY ● BLKIO ● DEVICES ● freezer ● net_cls ● net_prio ● perf_event ● hudgetlb cGroupscGroups
  • 22. cGroupscGroups ● freezer ● net_cls ● net_prio ● perf_event ● hudgetlb ● CPUSET ● CPU ● CPUACCT ● MEMORY ● BLKIO ● DEVICES
  • 23. ● cGroups have hierarchy // /user1/user1 /user2/user2 /user1/user3/user1/user3 cGroupscGroups
  • 24. root@goblin:/cgroup# ls -1 cpuset* cpuset.cpus cpuset.mems cpuset.cpu_exclusive cpuset.mem_exclusive cpuset.effective_cpus cpuset.effective_mems ... cGroupscGroups CPUSETCPUSET
  • 25. root@goblin:/cgroup# ls -1 cpu.* cpu.cfs_period_us cpu.cfs_quota_us cpu.rt_period_us cpu.rt_runtime_us cpu.shares cpu.stat cGroupscGroups CPUCPU
  • 26. root@goblin:/cgroup# ls -1 cpuacct.* cpuacct.stat cpuacct.usage cpuacct.usage_percpu cpuacct.usage_all cpuacct.usage_percpu_sys cpuacct.usage_percpu_user cpuacct.usage_sys cpuacct.usage_user CPUACCTCPUACCTcGroupscGroups
  • 30. cGroupscGroups root@goblin:/cgroup# ls -1 devices.* devices.allow devices.deny devices.list DEVICESDEVICES
  • 31. Marian HackMan Marinov Chief System Architect mm@siteground.com QuestionsQuestions