Skip to content

Instantly share code, notes, and snippets.

@RantyDave
Created May 27, 2016 00:10
Show Gist options
  • Save RantyDave/4c3a3683a5403040434dda2eadc66b31 to your computer and use it in GitHub Desktop.
Save RantyDave/4c3a3683a5403040434dda2eadc66b31 to your computer and use it in GitHub Desktop.
Limit the SmartOS (and Solaris?) ARC to a maximum of 256Mb. Works live, no reboot needed :)
#!/bin/bash
echo "arc_stats::print -a arcstat_p.value.ui64" | mdb -kw > value.ui64
ui64=$(cat value.ui64)
echo "${ui64:0:16}/Z 0x10000000" | mdb -kw
echo "arc_stats::print -a arcstat_c.value.ui64" | mdb -kw > value.ui64
ui64=$(cat value.ui64)
echo "${ui64:0:16}/Z 0x10000000" | mdb -kw
echo "arc_stats::print -a arcstat_c_max.value.ui64" | mdb -kw > value.ui64
ui64=$(cat value.ui64)
echo "${ui64:0:16}/Z 0x10000000" | mdb -kw
rm value.ui64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment