1*c29d5175SchristosFaq - Frequently Asked Questions 2*c29d5175Schristos 3*c29d5175Schristos The following may serve as a guide to the DTraceToolkit. 4*c29d5175Schristos 5*c29d5175Schristos16-May-2005, ver 0.30 (first version of the FAQ) 6*c29d5175Schristos 7*c29d5175SchristosThe DTraceToolkit is new, and as such there hasn't been many questions asked. 8*c29d5175SchristosThis may be better called a "possibly asked questions" :) 9*c29d5175Schristos 10*c29d5175Schristos 11*c29d5175SchristosQuestions 12*c29d5175Schristos 13*c29d5175Schristos1. Intro 14*c29d5175Schristos1.1. What is the DTraceToolkit? 15*c29d5175Schristos1.2. Who wrote the DTraceToolkit? 16*c29d5175Schristos1.3. Where do I get support? 17*c29d5175Schristos1.4. Am I now a performance tuning expert? 18*c29d5175Schristos1.5. Will this solve all my performance problems? 19*c29d5175Schristos1.6. So the DTraceToolkit *is* DTrace? 20*c29d5175Schristos 21*c29d5175Schristos2. Toolkit 22*c29d5175Schristos2.1. What is in it? 23*c29d5175Schristos2.2. What performance effect can the DTraceToolkit cause? 24*c29d5175Schristos 25*c29d5175Schristos3. Contributing 26*c29d5175Schristos3.1. Where do I send bugs? 27*c29d5175Schristos 28*c29d5175Schristos 29*c29d5175SchristosAnswers 30*c29d5175Schristos 31*c29d5175Schristos1. Intro 32*c29d5175Schristos 33*c29d5175Schristos1.1. What is the DTraceToolkit? 34*c29d5175Schristos 35*c29d5175Schristos The DTraceToolkit is a collection of tools written using DTrace for 36*c29d5175Schristos the Solaris 10[tm] OS by Sun Microsystems[tm]. Many of these scripts 37*c29d5175Schristos will also work on OpenSolaris. 38*c29d5175Schristos 39*c29d5175Schristos1.2. Who wrote the DTraceToolkit? 40*c29d5175Schristos 41*c29d5175Schristos Volunteers of the DTrace and OpenSolaris community. Check the scripts 42*c29d5175Schristos themselves, Docs/Contrib, Docs/Who and Docs/History. 43*c29d5175Schristos 44*c29d5175Schristos1.3. Where do I get support? 45*c29d5175Schristos 46*c29d5175Schristos As the DTraceToolkit is a freeware product, there is no official company 47*c29d5175Schristos offering support for this. Sun Microsystems does not support this. If you 48*c29d5175Schristos post messages to the DTrace forums found in the Docs/Links file, a 49*c29d5175Schristos volunteer may help you out. 50*c29d5175Schristos 51*c29d5175Schristos1.4. Am I now a performance tuning expert? 52*c29d5175Schristos 53*c29d5175Schristos The DTraceToolkit does not turn people into performance tuning experts in 54*c29d5175Schristos the same way that owning a set of golf clubs won't make you a professional 55*c29d5175Schristos golfer. Experience and understanding are necessary. The toolkit certainly 56*c29d5175Schristos helps by fetching the data in an easy way, and also by providing some 57*c29d5175Schristos documentation. So it is valuable, but not magical. 58*c29d5175Schristos 59*c29d5175Schristos1.5. Will this solve all my performance problems? 60*c29d5175Schristos 61*c29d5175Schristos This is similar to the previous point; the DTraceToolkit is valuable 62*c29d5175Schristos for it's scripts and documentation, but it's no magical product. 63*c29d5175Schristos Understanding and experience are necessary. 64*c29d5175Schristos 65*c29d5175Schristos1.6. So the DTraceToolkit *is* DTrace? 66*c29d5175Schristos 67*c29d5175Schristos The DTraceToolkit is one use of DTrace, but there is far more to DTrace 68*c29d5175Schristos than just the toolkit. DTrace allows people to write their own customised 69*c29d5175Schristos scripts to solve a wide number of problems. 70*c29d5175Schristos 71*c29d5175Schristos Think of the DTraceToolkit as a starting point. Maybe your problem has 72*c29d5175Schristos a solution in the kit. Maybe changing one of the toolkit programs slightly 73*c29d5175Schristos is what you want. Finally you may need to write your script from scratch. 74*c29d5175Schristos 75*c29d5175Schristos 76*c29d5175Schristos2. Toolkit 77*c29d5175Schristos 78*c29d5175Schristos2.1. What is in it? 79*c29d5175Schristos 80*c29d5175Schristos Read the Guide file for a table of contents, and Docs/Contents for a 81*c29d5175Schristos list of commands. 82*c29d5175Schristos 83*c29d5175Schristos2.2. What performance effect can the DTraceToolkit cause? 84*c29d5175Schristos 85*c29d5175Schristos Enabling DTrace to monitor events has little effect on the system, 86*c29d5175Schristos especially when compared to the disruptive behaviour of truss (See 87*c29d5175Schristos http://www.brendangregg.com/DTrace/dtracevstruss.html for a comparison). 88*c29d5175Schristos 89*c29d5175Schristos It really boils down to how often the events occur that you are monitoring. 90*c29d5175Schristos The following numbers have been provided as an approximation: 91*c29d5175Schristos 92*c29d5175Schristos 1. Fixed rate scripts. For example, dispqlen.d samples at 1000 hz. 93*c29d5175Schristos The impact will be negligible, close to 0% CPU. (in testing, 0.1% CPU). 94*c29d5175Schristos 95*c29d5175Schristos 2. Demand rated scripts. For example, iosnoop probes disk I/O events. 96*c29d5175Schristos The impact depends on the rate of events, for many servers the disk 97*c29d5175Schristos events would be slow enough for this to be less than 0.2% CPU. 98*c29d5175Schristos Scripts such as execsnoop would expect even fewer events, their impact 99*c29d5175Schristos would be close to 0.0% CPU. However scripts that monitor potentially 100*c29d5175Schristos very rapid events will have a greater impact, for example running 101*c29d5175Schristos dapptrace on Xorg (over 6000 lines of output per second) was consuming 102*c29d5175Schristos around 10% of a CPU to do so. 103*c29d5175Schristos 104*c29d5175Schristos 3. Heavy voodoo scripts. A few scripts in the toolkit must probe either 105*c29d5175Schristos a ton of different events, or very rapid events, or both. They are 106*c29d5175Schristos going to hurt and there is no way around it. Scripts such as cputimes 107*c29d5175Schristos and cpudists trace very frequent events, and can chew around 5% of 108*c29d5175Schristos the CPUs; scripts such as dapptrace and dappprof trace extreamly 109*c29d5175Schristos frequent events, and can chew over 20%. 110*c29d5175Schristos 111*c29d5175Schristos There is an emphasis in the DTraceToolkit to write demand rated scripts 112*c29d5175Schristos that measure the fewest events, such that their impact is close to 0.0% 113*c29d5175Schristos CPU usage. Some scripts are fixed rate, which are safer as their impact 114*c29d5175Schristos has a known upper bound, and are most suitable to run in production. 115*c29d5175Schristos 116*c29d5175Schristos There are additional notes in Notes/ALLoverhead_notes.txt about the 117*c29d5175Schristos overheads for running DTrace. 118*c29d5175Schristos 119*c29d5175Schristos 120*c29d5175Schristos3. Contributing 121*c29d5175Schristos 122*c29d5175Schristos3.1. Where do I send bugs? 123*c29d5175Schristos 124*c29d5175Schristos The DTraceToolkit maintainer. See the Docs/Maintainer file. 125*c29d5175Schristos 126*c29d5175Schristos 127