Back to article
Get the Most Out of Your Multicore Processor
Two heads are better than one!
September 11, 2009
Ooh, shiny! A new machine, and it has a Core 2 Quad processor! Everything's going to run so much faster now!
Or is it? When you have four processor cores, does that mean everything runs four times faster? Or is everything still running on the first CPU and ignoring the others? How do you find out, and how do you make the best use of that shiny new multi-core processor?
Performance Monitors: How busy are your CPUs?
To find out how fully your CPU cores are being used, you have a choice of several performance monitors.
gnome-system-monitor is the easiest to use (Figure 1). The Resources tab shows you a running graph of all your CPUs as well as details on your memory and network use.
Conky (Figure 2) is an alternative that's very popular with the "lightweight desktop" crowd. It can monitor nearly anything, and you can even set it up to display graphs on a transparent background so they look like they're part of your wallpaper.
Unfortunately, by default conky doesn't show each CPU separately, and it's a bit tricky to configure. Here's a minimal .conkyrc to show two cores. If you prefer a transparent background, remove the first line.
For more conky screenshots and sample configuration files, see the Conky web page.
For a lightweight monitor that's easier to configure than conky, try xosview (Figure 3). It shows all your CPU cores by default. Of course, you can adjust the display, using the command-line or with X resources. For instance,
xosview -geometry 370x330 +cpu +load +mem -swap -page -ints -disk
gives you something more like Figure 4.
There's also gkrellm (Figure 5). It, too, is highly configurable and has a huge list of plug-ins available.
Finally, if you prefer the command-line, mpstat will give you an overview of how hard your processors are working:
$ mpstat -P ALL
08:59:55 PM CPU %usr %nice %sys %iowait %irq %soft%steal %guest %idle
mpstat has lots of other statistics to offer as well: man pstat will give you the details.