Linux in Government: Optimizing Desktop Performance, Part II
As we discussed in last week's article, for most of its existence, people have distributed Linux as a workstation or a server rather than as a desktop. The default workstation that evolved has existed mostly for use by developers. So, when you install a Linux distribution with a graphical interface, it generally looks like what a developer might want. In addition, it performs similar to how many UNIX workstations work, which can seem slow.
In this article, we continue to look at the Linux desktop in a different light. Here, we think of it as a computer system with a fast interface that we can optimize for the knowledge worker and consumer.
Many points exist in a PC where an operating system can slow down. The most common point for this to happen lies between random access memory (RAM) and the hard drive. Similar to increasing the amount of RAM in your computer, you may find that purchasing a better hard drive can improve your performance. Follow the discussion below, and you should see why you may need a better hard drive.
By enabling Direct Memory Access (DMA), data can transfer directly from a hard drive's buffer to the computer's main memory, leaving the processor uninvolved. Although the results vary depending on the devices in your PC, using DMA should improve performance. You should try this to see if you experience improvements in disk performance. Please refer to Figure 1.
Most Linux distributions set the using_dma option to 1, and the Linux kernel normally sets DMA automatically. I discovered that in my system the flag was set to 0, which meant my using_dma option was off. Take a look at the top of Figure 1 which represents where I tested my hard drive parameter.
When I ran the command hdparm -t /dev/hda, my disk read 24MB in 3.11 seconds, which does not provide for the best disk access. So, I turned on using_dma using the hdparm -d 1 /dev/hda command and found that my disk access increased from 24MB in 3.11 seconds to 140MB in 3.01 seconds. You can see the results in the gray area of Figure 1.
Simply turning on using_dma enables a 16-bit mode, so I switched to 32-bit mode and found that my read time improved slightly. My buffered disk reads went from 46.50MB per second to 46.52MB, not much of an improvement. I also looked at turning on multiple sector I/O. This is a feature of modern IDE hard drives that permits the transfer of multiple sectors per I/O interrupt rather than the usual one sector per interrupt. When this feature is enabled, it typically reduces operating system overhead for disk I/O by 30-50%. On many systems, it also provides increased data throughput of anywhere from 5% to 50%.
I then ran the command hdparm -m /dev/hda and saw the following result:
/dev/hda: multcount = 16 (on)
But my buffering slowed down:
138 MB in 3.02 seconds = 45.72 MB/sec
In Fedora Core 3, you can change hdparm parameters in the /etc/sysconfig/harddisks file by uncommenting values. However, unless you see a significant improvement, don't make any changes. Simply buy a better hard drive.
Window frame image files can slow down system performance depending on the technique a theme maker uses to draw a frame. In GNOME, for example, the Crux window frame option loads slowly depending on CPU resources. In the system I used to test, I used a Sempron 2200 with a clock speed of 1.5GHz. To reduce CPU usage, I changed my frame options and noticed an increase in application start-up speed. For example, I downloaded and installed a theme called Atlanta and ran:
# gconftool-2 --type string --set /apps/metacity/general/theme Atlanta
I also could have changed the window frame by using Launch->Preferences->Theme and selected Theme Details. Then I could have selected the Window Border tab, clicked on Atlanta and closed.
Although themes use is subjective and people like to select their own eye candy, enterprises tend to want to get the best performance possible. You might try different combinations of theme elements to see if you find a difference in performance.
When you log in to a GNOME desktop, you see a splash screen, which displays icons and takes up time. I turn off my splash screen in order to reduce CPU cycles and because I find it annoying. If you have limited resources, you can use this command to save CPU cycles or get rid of the splash screen if you find it annoying:
# gconftool-2 --type bool --set /apps/gnome-session/options/show_splash_screen false
Users also can get to the splash screen options by using Launch->Preferences->More Preferences->Sessions and then unchecking it in the first tab. See Figure 2 for a look at the Sessions options.
Notice that you have several options from which to choose in the Sessions tool. Later, we use the third tab, Startup Programs, to show you how to load a script to improve the start-up time for OpenOffice.org.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Parsing an RSS News Feed with a Bash Script
- Google's SwiftShader Released
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide