Do Jails have resource limits?

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
Out of the box defaults, does TrueNAS-12.0-U8.1 limit jails? The reason I ask is when I ssh to the truenas server, it feels peppy. When I ssh into a jail, it feels sluggish. The jails have a lot of work being done but I assumed jails were more or less just chroot trickery and so as far as CPU and memory, it is basically running on the real hardware.

I see where I can create limits with rctl but I haven't done that.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Jails support resource limits and the jail management tool that TrueNAS uses - iocage - does, too. Only the UI doesn't.

You need to enable racct via a tuneable:
  • type: loader
  • tuneable: kern.racct.enable
  • value: 1
and reboot. Then you can e.g.

Code:
# limit memory use of jail to 4G:
iocage set memoryuse=deny=4G <jail>
# limit CPU use of jail to 2 cores (2x 100%):
iocage set pcpu=deny=200 <jail>
 
Top