Wednesday Nov 05, 2008

dtrace top tip

When logged on to a laptop (or any desktop system using X) don't run this command:

 $ pfexec dtrace -l -p $(pgrep Xorg)

Instead do this:

 $ pfexec dtrace -l -o /tmp/dt -p $(pgrep Xorg)

The former will deadlock the Xserver and if, like me you are in a hotel room with no other way to login to the system require you to power cycle it. The latter will put the results in /tmp/dt which you can then look at.

Even as I hit return I thought I should not do that as bad things could happen, See CR 4259419.

I blame this on staying up late at an Election night Party with some very happy people. Thank you to them for letting me share the experience, I just hope that you are not let down in the same way we have been after the 1997 Labour victory which brought so much hope to so many.

Wednesday Sep 12, 2007

Don't let find drop into /proc

Today I had the pleasure of looking at a crash dump of a system where ps, prstat et al were hanging. I never got the chance to get to the bottom of it due to meetings. However there was one command that was running on that dump that jumped out as doing lots of harm to the performance of the system for no benefit. The command was “find / .....”. The find had descended into “/proc” where it would have been walking all the directories locking and unlocking processes when what it was looking for was never going to be in /proc. Clive pointed out similar issues from running ps, prstat on performance by walking /proc and supplied the dtrace to show it.

Given that it is so rarely the case that you would want a find starting form “/” to drop into /proc I wonder if it would not be better if either /proc was invisible in the same way as the “.zfs” directories can be invisible in ZFS. I'd be interested in comments on that.

In the mean time if you really want to run find from “/” do this:

find / \\( -fstype proc -prune \\) -o ....


It will not descend into procfs but in all other respects will be the same.

About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today