Skip to content

Instantly share code, notes, and snippets.

@matthiasg
Forked from RantyDave/small-arc.sh
Created August 15, 2019 12:21
Show Gist options
  • Save matthiasg/0a04483c8222db4729d3876f33bc7331 to your computer and use it in GitHub Desktop.
Save matthiasg/0a04483c8222db4729d3876f33bc7331 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