Archive
Posts in Linux
Figuring out how long a Linux process has been alive
I've bumped into a few problems in the past where processes that were supposed to be short lived encountered an issue and never died. Over time these processes would build up and if it wasn't for a cleanup task I developed the process table would have eventually filled up (the bug that caused this was eventually fixed). Now how would you go about checking to see how long a process has been alive? There are actually several ways to get the time a process started on a Linux host…
$ read more →Viewing resource limits for Linux processes
Most Linux distributions ship with the pam_limits module to limit the resources that can be used by a process. You can enforce process resource limits by the user that a process runs as or by the group name a process runs as. These limits are set in /etc/security/limits.conf. To see the limits for your running shell you can run ulimit with the "-a" option: All of the limits above are the system defaults, since I haven't made any changes to /etc/security/limits.conf…
$ read more →Dealing with xauth error in locking authority file errors
I recently logged into one of my servers and received the following error: I haven't seen this one before, but based on previous "locking issues" I've encountered in the past I ran strace against xauth to see if an old lock file existed: In the output I saw the following which confirmed my suspicion: A quick check with ls revealed the same thing: I removed both of the lock files and haven't seen the error again. Thought I would pass this on in case someone else encountered this issue.
$ read more →Displaying CPU temperatures on Linux hosts
Intel and AMD keep coming out with bigger and faster CPUs. Each time I upgrade (I'm currently eyeing one of these) to a newer CPU it seems like the heat sinks and cooling fans have tripled in size (I ran across this first hand when I purchased a Zalman CPU cooler last year). If you use Linux and a relatively recent motherboard, there should be a set of sensors on the motherboard that you can retrieve the current temperatures from. To access these sensors you will first need to install the lm_sensors package: Once the software is installed and configured for your hardware you can run the sensors tool to display the current temperatures: This is useful information, especially if you are encountering unexplained reboots…
$ read more →Using collectl on Linux to view system performance
I recently needed to figure out what process was generating a bunch of I/O requests on a Linux system. On Solaris, there are a ton of tools available in the DTraceToolkit that can pin down i/o performance consumers. Using iostat in Linux, I can see that the drives are spinning like mad, but I really want to know which process on the machine is driving the disk. Using collectl, we can view this…
$ read more →