Why Linux people lust after DTrace

Back in 2002, I was managing the team that worked with Oracle on the engineering side.  This was when they were transitioning from developing the database on Solaris to Linux, and we were helping them with this transition.  Of the various requests their devs made, one of the first was "when can we get DTrace on Linux?" 

I was a bit confused, since I had never heard of DTrace! 

Fast forward to 2007, and I sat listening to Bryan Cantrill, the inventor of DTrace show some examples of the power of this little tool which comes with Solaris. 


  • The kernel has been instrumented with probes which cause no impact if they are not activated, but which allow the DTrace command to program them to fire.

  • The command can be used to count probe firings as events and display these counts as histograms for example.

  • Besides the kernel, one of the speakers I heard had instrumented the javascript runtime engine to enable DTrace usage, so you can identify where your time is going in a web site.

  • It has absolutely no GUI. Someone experienced in the art can simply write DTrace scripts on the fly and get amazing results.



The recent example they used was Twitter.  Remember my recent comments about this new micro-blogging application?  Well it turns out that the gang at Twitter implemented their system using Ruby on Rails, the new and sexy rapid website programming system.  After the article in the New York Times, Twitter has grown in popularity to be the biggest application of Ruby on Rails.  And of course, they were having performance problems. 

Fortunately for Twitter, they implemented it on Solaris, and thus DTrace to the rescue.  Within a few hours, they had identified an issue with how often deep stack back traces were being taken, they get a fix from the Ruby guys and had a 30% performance boost.  Pretty snaz, yeah

No wonder I saw DTrace listed as one of the top 10 reasons Solaris is better than Linux.
For more complete information about compiler optimizations, see our Optimization Notice.

Comments

Josh Bancroft (Intel)'s picture

Great story, David. I'm an avid Twitter user, and anything that helps them improve performance and uptime is great in my book. ;-)

's picture

Of course if you actually have your 5 nines, "improving uptime" hardly merits a mention.

At this point, I'm not sure if twitter has 2 nines, let alone more, and has been plagued for a fortnight with 503's, offline messages, and null pages.

's picture

Isn't there KTrace for Linux?

's picture

Linux has its own DTrace-alike coming along, and some would argue that it's better than DTrace in some ways.
http://sourceware.org/systemtap/

's picture

Solaris has had very slow startup times for a process. Historically thats been one reason to avoid it.

's picture

Efforts are being made to port DTrace to FreeBSD. I think it's scheduled for release with FreeBSD 7 http://people.freebsd.org/~jb/dtrace/

Josh Bancroft (Intel)'s picture

Oh, cool! It looks like DTrace is coming to Mac OS X Leopard, with a cool GUI. It's called Xray, and it's part of the XCode 3 IDE that's coming when Leopard launches.

http://www.apple.com/macosx/leopard/xcode.html

Can't wait to try it out! :-)

David Stewart (Intel)'s picture

Yes, well of course if you LIKE the GUI interface, it's good to have one. I think I heard about one that's Solaris-based as well.

Lack of a GUI doesn't phase most *nix developers. In fact they prefer the command line interface for development when they can.

I could write a bunch about the GUI vs non-GUI approach for development. A lot seems to be based on where you got your start as a developer.

's picture

Try SystemTap: http://sourceware.org/systemtap/

's picture

http://people.freebsd.org/~jb/dtrace/

MacOS, FreeBSD ... where is the problem with Linux? Some silly license-war?

Pages