Thursday, April 15, 2010

OpenSolaris notes

I've been using OpenSolaris dtrace facility to study certain application behavior. Coming from the Linux world, these are some notes that help me cope with the difference, as well as to allow me to repeat this experiment in the future.
  • Package manager: pkg search keyword; pkg install pkgname
  • Packages that I may need: SUNWnetcat, gcc-dev
  • Restarting SSH: /lib/svc/method/sshd restart
  • DTrace options to minimize trace losses:
    • -x switchrate=20Hz (tell DTrace to query kernel buffer 20 times a second)
    • -b 32m (set kernel buffer size to 32MB, the max)
    • -w (ignore systematic unresponsiveness)
  • Tip on preventing drop-out
    • Use gzip to compress trace output before it is written to disk.
    • Renice dtrace subject to nice 20. If this still does not work, use a computationally intensive compression algorithm like bzip2 and pin it on the same CPU as the subject. When a lot of traces come across, bzip2 will naturally slow the subject down by taking precedence in scheduling priority.
    • Command to set CPU affinity: pbind -b cpu# pid
  • Equivalent of ps -ax on Linux: ps -eo pid,tty,s,time,args
  • Equivalent of killall on Linux: pgrep pattern; pkill pattern

No comments: