• Linux,  Work

    Leap second causing ksoftirqd and java to use lots of cpu time

    Today there was a leap second at 23:59:60 UTC. On one of my systems, this caused a high CPU load starting from around 02h00 GMT+2 (which corresponds with the time of the leap second). ksoftirqd and some java (glassfish) process where using lots of CPU time. This system was running Debian Squeeze with kernel 2.6.32-45. The problem is very easy to fix: just run # date -s "`date`" and everything will be fine again. I found this solution on the Linux Kernel Mailing List: http://marc.info/?l=linux-kernel&m=134113389621450&w=2. Apparently a similar problem can happen with Firefox, Thunderbird, Chrome/Chromium, Java, Mysql, Virtualbox and probably other processes. I was a bit suprised that this problem…

  • Linux,  Work

    MegaCLI: useful commands

    Recently I installed a server with a Supermicro SMC2108 RAID adapter, which is actually a LSI MegaRAID SAS 9260. LSI created a command line utility called MegaCLI for Linux to manage this adapter. You can download it from their support pages. The downloaded archive contains an RPM file. I installed mc and rpm on Debian with apt-get, and then extracted the MegaCli64 binary (for x86_64) to /usr/local/sbin, and the libsysfs.so.2.0.2 from the Lib_utils RPM to /opt/lsi/3rdpartylibs/x86_64/ (that’s the location where MegaCli64 looks for this library). Here are some useful commands: View information about the RAID adapter For checking the firmware version, battery back-up unit presence, installed cache memory and the…

  • Linux,  Work

    Fixing grub-probe error: Couldn’t find PV, check your device.map.

    Today I was getting this error when installing a new kernel on a server running Debian: /usr/sbin/grub-probe: error: Couldn't find PV pv2. Check your device.map. The error can be reproduce by running the update-grub command. The day before, a new RAID disk was added to this server, so I suspected this could be the cause. The file /boot/grub/device.map contained a reference to the first RAID disk as (hd0) but did not contain a reference to the new RAID disk. I ran # ls -l /dev/disk/by-id/ to find out which SCSI ID referred to sdb (the new RAID disk), and then added the following line to device.map: (hd1) /dev/disk/by-id/scsi-3600304800087c4f015fb4f2e4cc7a8e5 Now installing…

  • Linux,  Work

    Linux performance improvements

    Two years ago I wrote an article presenting some Linux performance improvements. These performance improvements are still valid, but it is time to talk about some new improvements available. As I am using Debian now, I will focus on that distribution, but you should be able to easily implement these things on other distributions too. Some of these improvements are best suited for desktop systems, other for server systems and some are useful for both.

  • Linux,  Work

    Improving Mediawiki performance

    Now that I am on the subject of improving performance, I configured some performance improvements for a Mediawiki installation here: Make sure you run the latest Mediawiki version. Mediawiki 1.16 introduced a new localisation caching system which is supposed to improve performance, so you definitely want this to get the best performance. Create a directory where Mediawiki can store the localisation cache (make sure it is writable by your web server). By preference store it on a tmpfs (at least if you are sure it will be big enough to store the cache), and configure it in LocalSettings.php: $wgCacheDirectory = "/tmp/mediawiki"; Iif /tmp is on a tmpfs, you might add…

  • Linux,  Work

    Improving performance by using tmpfs

    Today I analyzed disk reads and writes on a server with iotop and strace and found some interesting possible optimizations. With iotop you can check which processes are reading and writing from the disks. I always press the o, p and a keys in iotop so that it only shows me processes doing I/O and so that it will show accumulated I/O instead of the bandwidth. With the left and right arrows I select on which columns to sort the list. Once you have identified the processes wich are doing much I/O, you can check what they are reading or writing with strace, for example # strace  -f -p $PID …

  • Linux,  Work

    DHCPd failover

    Last week, I set up two dhcpd servers in a fail-over configuration. The goal is that when one DHCP server goes down, the other one takes over so that clients don’t lose their network connection. I read different tutorials on the web, such as this one of a fellow blogger and this documentation published by IBM.

  • Linux,  Work

    Flash and Java: the end of obsolete technologies

    Already for a long time, I am a total opponent of Flash and things are clearly not improving. Quite on the contrary: Flash is still unstable on my systems, often not working correctly or causing browser hangs and it has many serious security flaws, which are fixed rather slowly by Adobe. Another piece of technology which is annoying is Java. Java is a serious memory hog, does not integrate very well in Linux distributions (no centralized package management system for the gazillion of Java libraries and frameworks), and Java’s new owner, Oracle, is trying to make Java a patent minefield by suing Google. Recently, Oracle also decided to publish a…

  • Linux,  Work

    Server migration to Debian

    Since this afternoon, this server is now running Debian GNU/Linux Squeeze. Just like the previous system, this is a KVM virtual machine running on a HP Proliant DL185G5 host. The host server has always been running Debian. This was my last production system still running Mandriva. I might have forgotten to move over a few things or there might be some breakage somewhere, so let me know if you encounter a problem.

  • Linux,  Work

    Migrating from Microsoft SQL Server to PostgreSQL

    One of the servers I manage at work is still running Microsoft Windows 2000. This system is hosting a few old forgotten web sites and it runs Microsoft SQL Server containing a few databases still in use. This server was already there when I started working at the university. Fortunately I never had to do much work on it and there never was a serious crash: it would have been a serious headache for me restoring this system because I do not have much knowledge about Windows and SQL Server. During some spare time at work I decided taking a look at migrating the MS SQL Server databases to PostgreSQL.…