I tried RCTL for the first time, so maybe it is error on my side. I have system with 2 jail with the following rctl.conf jail:fox:swapuse:log=32M jail:fox:swapuse:deny=512M jail:fox:memoryuse:log=3G jail:fox:memoryuse:deny=4096M jail:olymp:swapuse:log=32M jail:olymp:swapuse:deny=512M jail:olymp:memoryuse:log=2G jail:olymp:memoryuse:deny=3072M Both jails are small webservers with PHP + Apache. They do not use much memory and they really do not user any swap space. (according to top and swapinfo) # swapinfo -h Device 1K-blocks Used Avail Capacity /dev/mirror/gm0s1b 16777216 0B 16G 0% # rctl -hu jail:fox | grep swap swapuse=0 Processes in both jails are logged as using more than 32MB of swap: Mar 21 01:18:55 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" matched by pid 20783 (httpd), uid 80, jail fox Mar 21 01:18:55 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" matched by pid 20787 (httpd), uid 80, jail fox Mar 21 01:18:58 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" matched by pid 19207 (httpd), uid 80, jail fox Mar 21 01:18:58 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" matched by pid 20790 (sh), uid 0, jail fox Mar 21 01:18:58 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" matched by pid 20792 (sh), uid 0, jail fox Mar 21 01:18:58 neon kernel: rctl: rule "jail:olymp:swapuse:log=33554432" matched by pid 20793 (sh), uid 0, jail olymp Mar 21 01:18:58 neon kernel: rctl: rule "jail:olymp:swapuse:log=33554432" matched by pid 20795 (sh), uid 0, jail olymp Is it expected? I do not think so. Or am I doing something wrong with rctl? # uname -srmi FreeBSD 10.1-RELEASE-p8 amd64 GEN_RCTL Kernel is GENERIC + RCTL options Miroslav Lachman
Miroslav Lachman wrote on 03/21/2015 01:35:> I tried RCTL for the first time, so maybe it is error on my side.[...]> Both jails are small webservers with PHP + Apache. They do not use much > memory and they really do not user any swap space. (according to top and > swapinfo) > > > # swapinfo -h > Device 1K-blocks Used Avail Capacity > /dev/mirror/gm0s1b 16777216 0B 16G 0% > > > # rctl -hu jail:fox | grep swap > swapuse=0 > > > Processes in both jails are logged as using more than 32MB of swap: > > Mar 21 01:18:55 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" > matched by pid 20783 (httpd), uid 80, jail fox > Mar 21 01:18:55 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" > matched by pid 20787 (httpd), uid 80, jail fox > Mar 21 01:18:58 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" > matched by pid 19207 (httpd), uid 80, jail fox > Mar 21 01:18:58 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" > matched by pid 20790 (sh), uid 0, jail fox > Mar 21 01:18:58 neon kernel: rctl: rule "jail:fox:swapuse:log=33554432" > matched by pid 20792 (sh), uid 0, jail fox > Mar 21 01:18:58 neon kernel: rctl: rule > "jail:olymp:swapuse:log=33554432" matched by pid 20793 (sh), uid 0, jail > olymp > Mar 21 01:18:58 neon kernel: rctl: rule > "jail:olymp:swapuse:log=33554432" matched by pid 20795 (sh), uid 0, jail > olymp > > Is it expected? I do not think so. > Or am I doing something wrong with rctl?This is really strange. FOP (Java application) in jail is failing unless rctl swapuse is set to 7GB or more. Does swapuse means anything completely different than what is swapinfo or top reporting? The same web services with FOP is running completely fine on real server with 2GB of physical RAM installed and less than 5GB of swap partition (swap is empty). But it is not working in jail if RCTL is set to swapuse:deny=4GB or memoryuse:deny=4GB. Can somebody explain it? Miroslav Lachman