CPUset command broken in TrueNAS/FreeBSD12.2 ?

janb14

Dabbler
Joined
Apr 19, 2017
Messages
25
I just upgraded to Truenas from Freenas 11.3 (U5) and while upgrading my jails to FreeBSD 12.2 i noticed the cpuset command can only be issued ONCE after a jail started, compared to an unlimited time back on FreeNAS.
Steps to reproduce;
1. start a 12.2 jail
2. find out jailid by iocage list
3. set corecount restriction with "cpuset -j<ID> -l 1-6" to any core amount
4. check corerestriction by either running work inside the jail or check with "cpuset -j<ID> -g"
5. run command again with different corecount results in: "cpuset: setaffinity: Invalid argument"
(Even rerunning the original command gets rejected)
Can anyone please verify this ?
Best regards and thanks for the new version of the best NAS software ;)
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
You can limit the CPU usage directly with iocage.

E.g. iocage set pcpu=deny=200 <jailname> to limit to two cores.

HTH,
Patrick
 

janb14

Dabbler
Joined
Apr 19, 2017
Messages
25
Hey Patrick,
i know that iocage can do that theoreticaly but TrueNAS/FreeNAS deploy iocage 1.2 where the official dokumentation states:

Warning
This functionality is only available for legacy versions of iocage. It is not yet implemented in the current version. This applies to all subsections of Resource Limits.

found at: https://iocage.readthedocs.io/en/latest/advanced-use.html

I wanted to rely on cpuset as a "formally" more reliable command.
Best Regards,
Jan
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
The docs seem to be outdated. Here's the relevant code in iocage 1.2:

Here's the functional test:

And here's the documentation:


I knew because we us that in production outside of FreeNAS ...

Kind regards,
Patrick
 

janb14

Dabbler
Joined
Apr 19, 2017
Messages
25
Oh well i did not bother to look at the source for confirmation as the doku was labled as LATEST ^^.
Glad you did though. Then i guess its finally time to retire cpuset on my TrueNAS.
Thank you Mate.
Best regards,
Jan
 
Top