Add rctl limits to the manpage

This commit is contained in:
Matt Churchyard
2016-04-07 16:05:40 +01:00
parent 833500eee0
commit 649eb41231
2 changed files with 25 additions and 6 deletions

View File

@@ -56,9 +56,11 @@ __vm_set_rctl_limits(){
[ ${_exit} -ne 0 ] && \ [ ${_exit} -ne 0 ] && \
__log "guest" "${_name}" "RCTL support requested but RCTL not available" && return 1 __log "guest" "${_name}" "RCTL support requested but RCTL not available" && return 1
__log "guest" "${_name}" "applying rctl limits"
if [ -n "${_pcpu}" ]; then if [ -n "${_pcpu}" ]; then
/usr/bin/rctl -a process:${_pid}:pcpu:deny=${_pcpu} /usr/bin/rctl -a process:${_pid}:pcpu:deny=${_pcpu}
__log "guest" "${_name}" "limit rctl pcpu resource to ${_pcpu}" __log "guest" "${_name}" " pcpu=${_pcpu}"
fi fi
# at this point we can return if < FreeBSD 11 # at this point we can return if < FreeBSD 11
@@ -66,21 +68,21 @@ __vm_set_rctl_limits(){
if [ -n "${_rbps}" ]; then if [ -n "${_rbps}" ]; then
/usr/bin/rctl -a process:${_pid}:readbps:throttle=${_rbps} /usr/bin/rctl -a process:${_pid}:readbps:throttle=${_rbps}
__log "guest" "limit rctl readbps resource to ${_rbps}" __log "guest" " readbps=${_rbps}"
fi fi
if [ -n "${_wbps}" ]; then if [ -n "${_wbps}" ]; then
/usr/bin/rctl -a process:${_pid}:writebps:throttle=${_wbps} /usr/bin/rctl -a process:${_pid}:writebps:throttle=${_wbps}
__log "guest" "limit rctl writebps resource to ${_wbps}" __log "guest" " writebps=${_wbps}"
fi fi
if [ -n "${_riops}" ]; then if [ -n "${_riops}" ]; then
/usr/bin/rctl -a process:${_pid}:readiops:throttle=${_riops} /usr/bin/rctl -a process:${_pid}:readiops:throttle=${_riops}
__log "guest" "limit rctl readiops resource to ${_riops}" __log "guest" " readiops=${_riops}"
fi fi
if [ -n "${_wiops}" ]; then if [ -n "${_wiops}" ]; then
/usr/bin/rctl -a process:${_pid}:writeiops:throttle=${_wiops} /usr/bin/rctl -a process:${_pid}:writeiops:throttle=${_wiops}
__log "guest" "limit rctl writeiops resource to ${_wiops}" __log "guest" " writeiops=${_wiops}"
fi fi
} }

19
vm.8
View File

@@ -932,6 +932,22 @@ Multiple properties can be specified, separated by a space. For example, the fol
will configure the ZVOL block size to 128k, and turn compression off. will configure the ZVOL block size to 128k, and turn compression off.
.Pp .Pp
zfs_zvol_opts="volblocksize=128k compress=off" zfs_zvol_opts="volblocksize=128k compress=off"
.It limit_pcpu
Limit the bhyve process to the specified cpu percentage.
.Pp
Please note this, as with all
.Sy limit
settings, requires
.Xr rctl 8
to be enabled in your kernel.
.It limit_rbps
Limit guest disk read throughput to the specified bits per second.
.It limit_wbps
Limit guest disk write throughput to the specified bits per second.
.It limit_riops
Limit guest disk read iops to the specified number of operations per second.
.It limit_wiops
Limit guest disk write iops to the specified number of operations per second.
.El .El
.\" ============ SEE ALSO ============= .\" ============ SEE ALSO =============
.Sh SEE ALSO .Sh SEE ALSO
@@ -944,7 +960,8 @@ zfs_zvol_opts="volblocksize=128k compress=off"
.Xr cu 1 , .Xr cu 1 ,
.Xr fetch 1 , .Xr fetch 1 ,
.Xr truncate 1 , .Xr truncate 1 ,
.Xr zfs 8 .Xr zfs 8 ,
.Xy rctl 8
.\" ============ BUGS ============= .\" ============ BUGS =============
.Sh BUGS .Sh BUGS
Please report all bugs/issues/feature requests to the github project at Please report all bugs/issues/feature requests to the github project at