Hacker News new | past | comments | ask | show | jobs | submit login
Using DTrace to observe the SQL statements on a live running MySQL database (sun.com)
25 points by qhoxie on Oct 16, 2008 | hide | past | favorite | 7 comments



I generally use http://iank.org/querysniffer/mysqlsniff-0.10.html to get real queries. Works even on remote databases you don't have access to turn on query logging. Not to say DTrace isn't freaking awesome. (Check out Instruments in the Developer Tools on Leopard if you want to see DTrace but through a GUI).


One thing this is useful for: security testing. Get your web application up and running under OpenSolaris, OS X or FreeBSD, then run a "web fuzzer" like Burp Suite or WebScarab against it, while watching the queries in the backend. It'll give you a quick and dirty way to see how user inputs are being passed through to the database.


It's not the greatest example (since there are various ways to get SQL queries from a live mysql db - tcpdump/ngrep, query logging or strace from a client - you could strace the server but mysql appears to die when you strace it - dunno why).

Everyone who I know who has used dtrace loves it - so it seems likely to me that it is great+useful tech - but can someone come up with a real-world example of info it can give you that you can't get with tcpdump/strace?


This looks really cool. Anybody know about DTrace support for Linux (specifically, Debian)?


There's a lot of debate about its license CDDL, versus the GPL.

Either way there's a port being developed currently: http://www.crisp.demon.co.uk/blog/index.html


It's not so much as a debate as the maintainers and legal people saying "hell no, their code is incompatible. you'll have to do a clean-room implementation for it to land", and some people saying "but we really want it." Plus, there are the usual "GPL is bad" trolls.


instruments in Xcode is based on top of dtrace and is awesome.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: