We are trained to think that if we see “java.net.ConnectException: Connection refused”, we need to talk to our friends in networking. However, below is at least one example where this is not the case. Create a very simple socket server…
Category: Operating Systems
Which threads are talking to the database?
Often while troubleshooting, I will want to know where the bottleneck is. If I think the database may be the culprit, I will run the following to print those threads that are making database calls… -bash-4.1$ jstack 20711 | awk…
Determining the source of high java CPU
This post is related to a situtation in which you find yourself with high CPU utilization, but can’t determine the source. This will gather thread dumps and the CPU used by each thread. For the threads that use a large…
Which threads are running on a given CPU
We had a need to see which threads were running on a given CPU, as utilization was not balanced amongst the cores. We used what is below to do so. In our case, our java PID was 488. -bash-4.1$ jstack…
Simple example of tracking memory using getrusage
There is no real purpose to this post, as I rarely if ever write C code for any useful purpose anymore. However, what I do use it for is better understanding Linux system calls and other various operations in the…
Formatting garbage collection output with timestamps
If you are running a version of java where -XX:+PrintGCDateStamps is not honored, you can run what is below. For those that are unaware, by default garbage collection will print the seconds since the JVM process started. In the heat…
awk binary string to ascii string converter
There are probably better ways to this with lshift and rshift functions built into awk, but this is functional. { while (++i
Linux threads and CPU affinity
Linux provides native threading capabilities. This allows a program to run with multiple processes all accessing the same shared data, without the headache of Interprocess Communication (IPC) calls. Essentially, a single process makes calls to the system pthread library to…
How to find your Linux SMTP server
dig -t MX ${HOSTNAME#*.}
Printing counts of page requests
Simple post today, this just strips the request parameter string of a URL recorded in the Apache style log, and groups the times each base page was requested in sorted order. -bash-4.1$ grep -v login /opt/jboss/versions/jboss-eap-5.1/jboss-as/server/q_ecm_01/log/localhost_access_log.2012-12-12.log | grep jsp |…