May 18

Seize the moment! There’s no time like the present when it comes to harnessing every ounce of performance from your labouring computer.

Here’s the shocking truth: dubious default settings, wrong configurations and wasteful processes are sapping many of your PC’s valuable resources. And what’s to blame? Windows. Windows is deceptive. After you’ve installed it, the OS happily connects to the internet, downloads all the necessary drivers, configures itself and there you go – one stable PC all ready to roll. It couldn’t be easier or more convenient. But the problem is, Windows doesn’t come optimised for performance. And it’s much the same story for most of your applications: they’re all set up to work, not roar along.

So what’s the answer? We say take control and don’t trust Windows’ default settings. Sure, they’ll yield a machine that is stable and dependable, and to a degree that’s the point. That’s what the average user wants, and it’s what Microsoft and PC makers need. By keeping configurations nicely conservative they’ll keep PCs the world over ticking along happily and calls to their technical support divisions low.

But we PC Plus types aren’t average users. We’re demanding users who want to squeeze every drop of performance out of our computers. So, join us as we declare war on default settings and automatic configurations. Take control of your PC and release its full potential!

Remove processes

A good first step when speeding up your system is to identify and remove the processes that are currently wasting its resources. Windows runs a slew of processes by default. Some are essential to the functioning of your machine, but many others are unnecessary resource hogs. Process Hacker (a Task Manager-type utility with many more features) is perfect for sorting the wheat from the chaff.

Launch the program and right-
click the Name column header to define what information it should display. Ensure that ‘Name’, ‘PID’, ‘Pvt Memory’, ‘CPU’, ‘I/O Total’, ‘Username’, ‘Description’, ‘CPU History’, ‘Handles’ and ‘I/O History’ are all checked. Now click ‘OK’ and you’ll see two small graphs – CPU History and I/O History – that give a visual pointer as to how each running process has been behaving in the past few seconds. This is helpful information: if your hard drive has been thrashing for some unknown reason, for example, scan the I/O History column. Anything showing spikes of activity is a suspect.

Process Hacker is great for identifying resource hogs – use the graphs to see how much each process uses the hard disk.

Exactly what Process Hacker uncovers will vary depending on your system, but on our test PC we noticed that ‘IBurn.exe’ (a packet-writing program provided with Cyberlink Media Suite) had regular I/O read spikes and that a process associated with VMware Workstation, ‘vmware-tray.exe’, was tying up CPU and I/O time.

It’s important not to overreact and start shutting down resource-hungry processes, because if you pick something important, your PC will crash. Instead, try to identify the process, and if it proves to be unnecessary, make sure it doesn’t reload next time.

To do this for IBurn.exe, we loaded the InstantBurn System Configuration Tool and clicked ‘Disable InstantBurn’ to stop it launching when Windows next started. The vmware-tray.exe process was just as easy to turn off: we launched VMware Workstation, clicked ‘Edit | Preferences | Workspace’ and cleared the ‘Show Tray Icon’ box to ensure it wouldn’t start again. The next thing to do is click the Pvt Memory column header to sort your processes by the amount of RAM they’re using – a handy way to see the real resource hogs.

Once again, we found programs that could be removed. ‘SkypePM.exe’ was the Skype Extras Manager, but we didn’t use them: clicking ‘Tools | Options | Advanced Settings’ and clearing ‘Automatically start extras’ meant that the process wouldn’t load next time.

If you’re looking for more savings, target ‘iTunesHelper.exe’. It launches iTunes when it detects an iPod or iPhone being plugged into the PC. If you don’t have one, run Regedit, head to ‘HKEY_LOCAL_MACHINE\SOFTWARE
\Microsoft\WindowsCurrentVersion
\Run’, right-click the iTunesHelper key and click ‘Delete’.

Bloated apps like iTunes come with lots of unnecessary services and processes that drag down your system.

We’ve only carried out four tweaks so far, then, but we’ve freed up at least 47MB of RAM, as well as reducing background I/O and CPU activity. That’s not bad, but some judicious tweaking of Windows services may be able to deliver even more.

Stop services running

Windows services are small programs that run in the background, providing things to the OS and your applications. Click Start, type Services.msc and click the ‘Services’ applet link to see the services installed on your PC, which is almost guaranteed to include some that you don’t need.

Here are some examples. If you don’t use Media Center then the Windows Media Center Extender, Receiver and Scheduler services are all surplus to requirements. The Distributed Link Tracking Client maintains links between NTFS files over a network. If you don’t use that feature then it’s unnecessary. Similarly, IP Helper is useless for those without an IPv6 network; Offline Files has no purpose if you don’t use its sync features; the Tablet PC Input Service is only for tablet PCs; and the Secure Socket Tunnelling Protocol Service is generally only useful if you’re connecting to a virtual private network (VPN).

Potentially redundant third-party services include Apple Mobile Device and iPod Service, which come with iTunes and can be safely turned off if you don’t have an iPod or iPhone. Bonjour Service is only required if you need iTunes or Safari to discover network services; Nero BackItUp Scheduler belongs to Nero Burning ROM, and can be turned off if you’re not using the back-up tool; and Nvidia Stereoscopic 3D Driver Service is useless unless you have the 3D glasses needed to use Nvidia’s 3D Vision technology.

Think carefully about the services that can be safely disabled on your PC. (And we do mean carefully: get this at all wrong and you could prevent Windows from loading, even in Safe Mode, so if in doubt about something, leave it alone). Then go to work turning off the unnecessary components.

In some cases you may be able to do this by uninstalling a program from Control Panel. That’s where you’ll find the Nvidia Stereoscopic 3D driver, for instance. But with most options you’ll have to launch the Services applet (‘services.msc’) and tweak the settings yourself. The safest approach is to double-click the redundant service and set its Startup Type to ‘Manual’; it won’t be launched automatically, but will still be available if another service requests it. The problem is that this can leave some services running unexpectedly, so if you’re 110 per cent sure that something isn’t in any way system critical – Apple Mobile Device, say – then set its Startup Type to ‘Disabled’, and you can be sure that it won’t be launched again.

Create a Turbo mode

Some of the most resource-hungry Windows services shouldn’t be turned off permanently. We found that Windows Search consumed more than 250MB of RAM on our test system, for instance. That’s annoying, but we’d miss the service if it weren’t there. The SuperFetch caching service can grab plenty of RAM, too, and it isn’t always effective, but on balance it’s still worth keeping it running.

Shutting down Windows Search recovered more than 250MB of RAM.

You wouldn’t want these services to disappear forever, then, but what about if you created a batch file to turn them off just temporarily? This could free up a considerable amount of RAM. You may then get better performance out of a game or some other heavy-duty application that you’re trying to run, and you could use another batch file to restore the services when you’re done.

To give this a try, launch ‘Services.msc’, double-click each service you’d like to disable and make a note of its short name. This is labelled as ‘Service name’ on the dialog. Now create a file called Turbo-On.bat that uses the net stop command (as shown below) to close each service. Feel free to leave SuperFetch enabled if it helps the particular app that you’re trying to prioritise, and of course you can add as many other services or programs as you like, just as long as they’re not system-critical. Here we’ve included a sample line that would shut down Skype’s services:

net stop wsearch
net stop sysmain
‘\program files\skype\phone\skype.exe’ /shutdown

Then create a second file called Turbo-Off.bat that uses the net start command to relaunch everything, as here:

net start wsearch
net start sysmain
‘\program files\skype\phone\skype.exe’

Store these files somewhere safe, and create shortcuts to each. Next, right-click the shortcut, click ‘Properties | Shortcut | Advanced’ and check ‘Run as administrator’.

Now, whenever you need the maximum possible performance, launch the ‘Turbo-On.bat’ shortcut to free up some RAM and system resources. Then fire up ‘Turbo-Off.bat’ when you’re done to restore normal operations.

Prioritise programs

So far we’ve concentrated on absolute ways to divert your PC’s resources. But what about those programs that you must leave running, but aren’t system-critical – such as mail apps? It’s possible to recover resources from these applications, too, although it may take a little extra work to do so.

Let’s assume that you always need to have Outlook running in the background. By default this may grab processor time on any of your CPU cores (assuming you’ve got a multicore CPU). You can restrict the app to just one, freeing up the others for different programs. In Process Hacker, right-click the ‘Outlook.exe’ process, click ‘Affinity’ and ensure that only ‘CPU 0’ is checked. Repeat the process with other non-essential programs that you have launched (nothing security-related though, and no Windows components). Their performance will fall a little because they’re restricted to one CPU, but the rest of your apps should now benefit, as they get improved access to the rest of your system’s cores.

Another way to make other apps run quicker is to reduce the CPU and I/O priority of a background process. Windows does this itself with the Windows Search indexer and other components so that they don’t interfere too much with foreground apps, and you can apply the same trick yourself to limit a program’s impact on your system.

In Process Hacker, right-click the process you’d like to change (avoiding security tools, Windows components and anything system-
critical) and select ‘Priority | Idle’. Then right-click the process again and select ‘Miscellaneous | I/O Priority | 0’ to make sure that it gets the least possible share of your system’s attention.

You could also increase the priority of more important processes to High, which may mean that they get more CPU time, but be careful – doing so is risky. It’s more likely that your programs will block Windows’ own processes from running, and that could result in your PC crashing or locking up.

Don’t expect too much from these techniques, though, especially if you don’t have many background processes. With just Outlook and a browser running in the background on our machine, our tests showed that priority and affinity tweaking delivered only a two to five per cent improvement in foreground application performance. However, if your PC is packed with busy background processes, this can be a very useful way to manage them. If you see good results then you can change your program shortcuts so that you’re able to launch them using the command-line ‘start.exe’ tool, which can set their priority and affinity without Process Hacker’s help.

Process Lasso can optimise all your process priorities to help deliver improved system speeds.

It may also be worth trying Process Lasso, which assigns and manages process priorities automatically. It’s a commercial product, but it’s reasonably priced (from $20), and there’s a free trial available so you can see if it works.

Further basic rules

If you’ve followed our advice so far, you’ll have discovered and tamed resource-hungry processes, turned off unwanted Windows services and taken steps to reduce the impact of many other programs on your PC’s performance. That’s great, but to get the most from your PC you’ll still need to follow two simple rules while you’re working.

If you have a bulky application open but you won’t be using it for a while, don’t leave the window open on your desktop – minimise it. Windows will often free up some of the RAM it’s using immediately.

If you’re walking away from your PC and leaving an app running some lengthy task – rendering video, say – then make sure that the program is running in the foreground (just click its title bar). Windows gives more CPU time to the foreground app and you should find it completes more quickly.

May 15

The market keeps on moving: SAP acquires Sybase etc. But one name attracted my attention: GemStone being acquired by VMWare/SpringSource (next to RabbitMQ, Hyperic, …).

Time flies: I remember Gemstone as a vendor of OODBMS and application server. On the OODBMS side there were also Versant, ObjectStore (eXelon –> Progress). The list of applicaton servers – just before EJB’s took off – is much longer: Netscape Applicaton Server, Forté, Jaguar CTS (Sybase), Tengah (became WebLogic), IBM Component Broker, ATG Dynamo, Novell Silverstream, Novera, … Had forgotten about most of them. Another such “hidden” company that I recently encountered is Pramati.

May 13

Linux is blessed with a variety of methods for accessing, expanding and building dynamic, scalable storage solutions. And they’re not just for industry experts either – even everyday Linux users can get access to a great deal of functionality by sharing and accessing data across a network.

Set up iSCSI and your data will stream from your PC like a magical rainbow. Perhaps. If you’re very lucky.

But there’s a new generation of solutions that can increase performance, offer more features and improve security – one of which is iSCSI. As its name implies, iSCSI is a version of the SCSI protocol, which is responsible for shuffling data between various SCSI devices. The key difference with iSCSI is that instead of transporting data across local cables and buses, the ‘i’ takes that data across the internet or your local network, attaching remote storage devices to your local system. It’s perfect for storage area networks (SANs) in particular, and you’ll find network administrators in enterprises of all sizes singing the praises of iSCSI’s ability to combine big-business fibre channel commands with generic networking hardware, saving their departments thousands of pounds in both hardware and infrastructure costs. iSCSI is also a great general-purpose remote storage solution that could easily replace the NFS protocol.

Understanding iSCSI

You can now find iSCSI in many network-attached storage (NAS) devices for the home and even standard Linux installations. This is because it’s a great storage protocol for an expanding network. It might be hard work to master, but you can build a working configuration with relative ease. The great advantage that iSCSI has over some of the alternatives is that drives are exported as block devices, just as blocks of data would be transported over an old SCSI cable. This means that, to the Linux kernel, these drives are handled exactly like local block devices. This makes it perfect for connecting the storage area of a database to the client application or, more recently, the virtual storage devices used by VMware and VirtualBox virtual machines. It’s also ideal if you want to run a machine without any local storage – traditionally the domain of NFS.

Use ‘apt-get install iscsitarget’ to add the appropriate packages to your installation.

Before getting started, your first step should be to familiarise yourself with some of the concepts that are used by iSCSI. These appear to take their names from the Terminator films, with the two most important being the Initiator and the Target. The Initiator is the iSCSI equivalent of the client. It’s the machine you want to have access to the remote data – the one that’s running the applications, or your desktop. The Target is the place the Initiator grabs the data from – another machine running the iSCSI server software and managing the requests to and from the storage medium. You’ll often find NAS drives running the Target server, for example, and you’ll only need to run the Initiator on your local machine in order to access the Target drive.

Set up the Target

It’s possible to share a large variety of different storage types over iSCSI, but the easiest to configure are entire drives. iSCSI connects devices at the block level, which means the job of partitioning and formatting can be left to the Initiator rather than the machine that’s attached directly to the hard drive. On our system, the drive we used was listed as /dev/sdb, and we’ll stick with this example throughout this tutorial. The system drive is normally /dev/sda. To find out what yours is, type fdisk -l on the command line for an overview of what’s connected to your system.

Edit the configuration file in nano. You’ll need to add a line which ensures iSCSI is switched on.

On the Target machine, you first need to install the ‘iscsitarget’ package. You can do this either from the Synaptic package manager or by typing sudo apt-get install iscsitarget on the command line. This will also install several configuration files, and the first of these that we need to look at is ‘/etc/default/iscsitarget’. You can type sudo nano followed by the path to the file name to edit it on the command line, or use your favourite desktop editor if you prefer. We only need to make a single edit here – making sure ‘ISCSITARGET_ENABLE=true’ is the only line in the file. Nano users need to press [Ctrl]+[X], then [Y] to save the changes.

Edit configuration files

The next file we need to edit is ‘/etc/ietd.conf’, which you’ll need to open in an editor. This document contains a working configuration, with lines using the # symbol designated as comments and therefore out of action.

The first line we need to edit defines what’s known as the iSCSI qualified name, or IQN for short. Just search for Target, followed by iqn. As with pages on the net, this IQN name has to be unique to your installation, and it takes the form of ‘iqn’, followed by the year and month, then a reversed version of your domain name. This is then followed by a colon and a reference to whatever you’re going to call the target storage device. This can be anything you like. Here’s what we chose:

iqn.2010-01.com.example:storage.disk2

Next, we need to define the drive that’s going to be shared over iSCSI. Remove the # symbol from the line starting with ‘Lun’ and modify it to read Lun 0 Path=/dev/sdb,Type=fileio. You need to change ‘/dev/sdb’ to the location of the drive that you’ve decided to share. Next, uncomment the Alias line at the bottom of the current section and save the file.

You’ll need to do some deeper editing to the ‘/etc/ietd.conf’ file.

You may have noticed that there are two lines available for a username and password, but we’re going to leave these untouched for now because we’re running our iSCSI device over a trusted network. You can always come back to this point and change the configuration after you’ve got the basic connection working, if you think that you need to.

To enable the device to be shared, open ‘/etc/initiators.allow’ and add iqn.2010-01.com.example:storage.disk2 ALL. When you get the connection working, you’ll need to change ‘ALL’ to the IP address of the machines allowed to access your iSCSI device, but for now we’re trying to remove all obstacles that could stop us getting the connection working. Start the Target server by typing sudo /etc/init.d/iscsitarget start.

Set up the Initiator

It’s now the turn of the other machine, the Initiator. To begin, you need to install the ‘open-iscsi’ package. Once that’s done, open the ‘/etc/iscsi/iscsid.conf’ configuration file and look for the line starting with ‘node.startup’. Change the default value of ‘manual’ to automatic, save the file and restart the service by typing sudo /etc/init.d/open-iscsi restart.

Make sure you change the node startup option to ‘manual’.

Almost everything is now configured and ready to go. Our next step is to probe the Target machine to see what storage services it offers, hopefully listing our drive in the process. Type iscsiadm -m discovery -t st -p, followed by the IP address of the Target. You can find this by typing ipconfig on the Target machine. If everything is set up correctly, you should see the IQN of your drive as output to the iscsiadm. This is the output we received:

iscsiadm -m discovery -t st -p 192.168.1.61
192.168.1.61:3260,1 iqn.2010-01.com.example:storage.disk2

Now you know that the Target machine is correctly configured and that iSCSI can see the remote storage device, you need to type iscsiadm -m node. This will automatically create configuration files within /var/lib/iscsi/nodes for the storage unit on your local machine, which will allow the Initiator to mount the device automatically when the service is restarted. You may need to do this manually by typing sudo /etc/init.d/open-iscsi restart.

The remote drive should now be mounted locally. The best way to check is to type fdisk -l to list all the storage devices attached to your machine. The iSCSI drive should be part of the output, but you won’t see any indication that it’s being connected over a network. That’s the great advantage of using iSCSI.

Mount the drive

iSCSI passes the block information, so you need to format the remote drive from the Initiator machine before it can be used. This process is exactly the same as partitioning and formatting any other drive on your system. You could use fdisk on the command line, for example, or you could take the easy route and use a graphical partitioning tool like GParted, which you can install through your distro’s package manager.

After launching GParted, you first need to select the remote drive from the dropdown list in the top-right of the main window. As with fdisk, the iSCSI drive looks exactly like a local drive, so you need to take special care to select the correct device. You can lose data from other drives permanently with GParted, so proceed with caution.

If you’re hooked up to your target drive you should be able to treat it like any locally connected module – including partitioning it.

With the remote drive selected, click on the large grey area in the middle of the window marked ‘unallocated’. This is the unpartitioned area on your remote drive. Click on ‘New’. By default GParted will use the entire disk, but you’re free to subdivide the remote drive in exactly the same way you would a local one if you prefer. Leave ‘Primary Partition’ selected, then select ‘ext4’ as the filesystem and give your drive a meaningful label before clicking ‘Add’. Click on ‘Apply’ to make the changes to the remote drive, and then simply sit back and wait while the formatting process finishes.

Now that the drive is correctly formatted and partitioned, it’s time to mount it onto the local filesystem so you can start reading and writing data to it. You can use the ‘mount’ command to attach the drive just as you would any other, but there’s one small difference that you have to consider whenever you use multiple iSCSI devices – they might not always have the same /dev path. The solution is to navigate to the device using the /dev/disk/by-path/ nodes, so you can be sure you’re getting the same disk every time.

If you type ls /dev/disk/by-path, for example, you can easily see which devices are using the IQN address. In our example, we mounted the remote drive onto the local /mnt/iscsi folder with the following commands:

mkdir /mnt/iscsi
mount /dev/disk/by-path/ip-192.168.1.61\:3260-iscsi-iqn.2010-01.com.example\:storage.disk2-lun-0-part1 /mnt/iscsi

You can now read and write files to the /mnt/iscsi mount point, and these are passed directly to the remote drive just as if they were connected using an extremely long SCSI cable.

iSCSI on NAS boxes

Two of the trickiest parts of using iSCSI are finding the hardware and configuring the Target machine, but luckily there may be another option if you have a Linux-based network-attached storage box. Many of these will offer up a chunk of the storage inside the box over an iSCSI connection, and you can usually activate and configure this facility with just a couple of clicks. Some of these will let multiple Initiators access a single target and enable you to add CHAP password authentication. Then it’s simply a case of running the iSCSI discovery procedure on your Initiator hardware. If you’ve chosen to use a password and username, you’ll need to run the ‘iscsiadm’ command on the Initiator to add those values to the configuration file for that Target. The command takes the following format:

iscsiadm -m node --targetname IQN --portal IP AND PORT OF TARGET --op=update --name node.session.auth.

You need to run this three times, changing the end parameters each time. With the first execution, add authmethod –value=CHAP to the authentication check. For the second, add username –value=username to specify the username for the connection, and for the third execution add password –value=password to specify the password.

Create a virtual hard drive

Many more technical distributions, such as Fedora, use logical volume management (LVM) for local storage and filesystems. One of the advantages of LVM is that you can shrink, expand and create partitions on the fly from the pool of storage on your machine. Logical volumes can be used for all sorts of tasks. Virtual machines often use them to keep data from the main system, and they’re handy if you enjoy playing with filesystems. They’re also useful if you want to try iSCSI, because you don’t need to have a spare hard drive – you just need the space within your logical volume pool.

The key to adding new virtual drives is the ‘lvcreate’ command. We used the following command to create a 10GB logical volume: lvcreate -L10G -n vdrive vg. This creates a volume called ‘vdrive’ in a volume group called ‘vg’. You’ll need to take a look in your /dev directory to discover the name of the logical volume group used by your installation. After creating the drive, it appears in the /dev volume tree just like any other device and you can share it across the iSCSI connection like a real hard drive.

Even without LVM, there are other options for dynamically shared storage. You could create an image file, for example, by typing dd if=/dev/zero of=/mnt/iscsi.img bs=1024k count=1000. The ‘count’ value is the size of the image, while ‘/mnt/iscsi.img’ is the file that’s created. You can use that path as the source for the iSCSI Target on the ‘Lun 0’ line in the ‘/etc/ietd.conf’ configuration file, and use it like a real partition.

Virtualisation

iSCSI is commonly used by cloud applications and the world of virtualisation. This is so you can access the same hard drive data regardless of where the virtual machine is running. If you’re in the market for a major, enterprise-grade virtualisation solution that uses iSCSI, take a look at VMware’s ESXi solution, which is available for free from www.vmware.com.

Boot options

If you want the Target iSCSI device to be available each time you boot the Initiator machine, you will need to add the remote device to the ‘/etc/fstab’ file. The quickest way to do this is to copy another line in the file and change the parameters to suit the iSCSI device. Make sure the path uses the ‘by-name’ format so that you can be sure you get the same drive at each boot.