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.
|Designing Electronics with Linux||May 22, 2013|
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
- Linux Systems Administrator
- Senior Perl Developer
- New Products
- Technical Support Rep
- UX Designer
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Have you tried Boxen? It's a
18 min 1 sec ago
- seo services in india
4 hours 49 min ago
- For KDE install kio-mtp
4 hours 50 min ago
- Evernote is much more...
6 hours 50 min ago
- Reply to comment | Linux Journal
15 hours 35 min ago
- Dynamic DNS
16 hours 9 min ago
- Reply to comment | Linux Journal
17 hours 8 min ago
- Reply to comment | Linux Journal
17 hours 58 min ago
- Not free anymore
22 hours 27 sec ago
1 day 1 hour ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?