debugging


jmx and firewalls

So at least with Java 1.6 the JVM can use SOCKS for proxying RMI requests, so to get the wonderful jvisualvm (think 1.5 visualGC) working use the following incantations. This requires the initial RMI registry port is open to the client. First the initial SSH to server enabling the SOCKS tunnel {% highlight bash %} $ ssh -D localhost:9696 servername {% endhighlight %} And now for jvisualvm: {% highlight bash %} $ jvisualvm -J-Dnetbeans.

searching java log files

So debugging java can be a mighty pain, a little few lines of ways to make it simpler. # grep -m 1 -n '^2010-06-30 14:20:' catalina.out 11746233:2010-06-30 14:20:01,011 DEBUG com.beginning.of.line # grep -m 1 -n '^2010-06-30 14:21:' catalina.out 11747788:2010-06-30 14:21:00,161 WARN org.apache.commons.httpclient.HttpMethodBase - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended # sed -n '11746233,11747788p' < catalina.out This gives start line and end line between any two greps and then the body of the log file from those two lines.

smokeping and SOAP

We’ve had an issue with performance of a SOAP interface, and here’s how you go about setting up smokeping to time it:- extraargs = -H Content-Type:text/xml --data @/srv/scripts/soap_check/soap-test.xml urlformat = http://server.name.com/url/soap_url The only annoying problem is that the SOAP payload cannot be included as part of the command line, so any slaves would require the file manually copied into the same location

utf8 and mysql

Nice bugs that no one seems to want to fix:- mysql> create table test5 ( wibble varchar(500), PRIMARY KEY (wibble) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes mysql> create table test5 ( wibble varchar(500), PRIMARY KEY (wibble) ) ENGINE=myisam DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ERROR 1071 (42000): Specified key was too long; max key length is 1332 bytes And even with MySQL 6.

playing with TCP Trace

# tcpdump -ni en0 port 80 -w output.trace # tcptrace -G output.trace # xplot *tput.xpl From the online manpage: Yellow: instantaneous packets Red: Throughput for the last few packets Blue: Throughput since the start of the stream/connection Other useful graphs: _owin.xpl - outstanding data/congestion _rtt.xpl - round trip time/time _ssize.xpl - segment size/time _tput.xpl - throughput/time _tsg.xpl - time sequence graph _tline.xpl - Timeline graph - W Richard Stevens style Just some notes here so I don’t forget the basics - manual over at here