How to Speed Up Your NAS With iSCSI

Many technologies originally intended for the enterprise end up trickling down into the consumer market at some point. Some of these technologies (ethernet or virtualization, for instance) are more practical than others; but if businesses find a use for a specific piece of technology, then chances are good that consumers can benefit from it as well. Such is the case with iSCSI.

iSCSI stands for Internet Small Computer System Interface. SCSI (sans i) has long served to connect a variety of peripherals to computer systems, but most commonly it appears in storage devices, such as hard drives or tape-backup drives. iSCSI builds upon the base technology by allowing users to connect to a remote storage volume over a network, as if said storage volume were a locally attached disk. Simply put, iSCSI transmits SCSI commands over IP (Internet Protocol) networks. iSCSI is like a virtual SATA (or SCSI) cable, in that it uses a network connection to link a system and a storage volume.

Judging from that description, you may be wondering how iSCSI differs from any other network share with a mapped drive letter. On many levels, the end results are similar. With iSCSI, though, the attached volume appears to the operating system as a locally attached, block storage device that you can format with the file system of your choice. In addition, fewer layers of abstraction separate an iSCSI volume and your PC, which can result in increased performance.

Ready to get your hands dirty with some hardware? If you wish to use iSCSI, there are two main requirements: a network-attached storage device or server with a volume that can be configured as an iSCSI target, and an iSCSI initiator, which allows a system to connect to the target.

If you own a NAS drive attached to a Windows PC (or if you have managed to make your own NAS), you probably have everything you need; virtually all NAS (network-attached storage) servers offer the ability to configure iSCSI targets, and Microsoft has included an iSCSI initiator tool with every version of Windows since Vista. You can download and install Microsoft’s iSCSI initiator on all previous versions of Windows from 2000 on up, too.

For this project, we chose a two-bay Thecus N2200XXX NAS server with a pair of Western Digital 2TB RE4 hard drives installed, running in a RAID 1 configuration for data redundancy.

To show you how to use iSCSI, we're using a two-drive Thecus N2200XXX NAS server, which runs a custom version of Linux with iSCSI support, and a desktop system running Windows 7 Ultimate. Any system running Windows will do when paired with a NAS that supports iSCSI (such as the excellent Iomega StorCenter PX6-300d).

Pros and Cons

I've already touched on some of the benefits of using iSCSI. As mentioned above, an iSCSI network target appears to a system as a local drive; therefore, not only can you format the iSCSI target with the host OS’s file system, but you can also run applications that require local storage from the iSCSI volume instead. This flexibility is great for small businesses because many programs cannot run over shared networks, even if you're using mapped drive letters; iSCSI works around that issue.

For some workloads, iSCSI may also offer better performance. Although iSCSI improves PC performance in the enterprise by allowing large storage arrays to connect to client systems without the need for custom hardware or cabling (which can result in a huge cost savings), I'm going to focus on average consumers and desktop systems here. To prove that iSCSI can enhance your PC's performance, we ran some benchmarks on a testing unit; I'll show you the results on the next page.

Note, however, that using iSCSI has some drawbacks. While setup is not terribly difficult, configuring an iSCSI target and initiator is more involved than simply browsing to a shared network resource. Also, only one initiator should be connected to the iSCSI target at a time, to prevent possible data loss or corruption. In addition, assuming that you use a fast server and drives, performance may be limited by your network connection speed. A gigabit network connection (or better) is the optimal choice; with slower network connections, the potential benefits of iSCSI may be nullified.

Getting Started

Following are the steps necessary to set up a Thecus N2200XXX NAS server for use with iSCSI. The steps should be similar for other devices and servers as well. To see how everything works, click on each screenshot for a larger version.

Step 1: Log in to the NAS server’s configuration menu, configure the RAID mode, and reserve some storage space for the eventual iSCSI volume. We used RAID 1 for redundancy with two 2TB drives, and split our setup right down the middle--dedicating half of the usable capacity to an EXT4 data share while leaving the other half unused. We would later configure the unused space for iSCSI purposes.

Make sure to allocate plenty of space on your NAS drive for sharing via iSCSI.

Step 2: After you allocate space to the RAID, you must format it before continuing. When the formatting process is complete (depending on your drive setup, it could take hours), you can then configure the unused space as an iSCSI target. Note that if you reserved all of the available storage space for iSCSI, you will have no need to format the array at this point.

Remember to format your NAS first if you aren't planning on using the entire capacity for iSCSI access.

Step 3: Next, we configured the iSCSI target. On our Thecus NAS, we first had to click the Space Allocation link under the Storage menu in the left pane. Then we clicked the Add button under the 'iSCSI target' tab; a new window popped up, in which we had to set the desired size of the iSCSI target, enable it, and give it a name. At this point, you can also enable CHAP (Challenge Handshake Authentication Protocol) authentication if you wish to add a layer of security, but we chose not to. Another note: If you decide not to dedicate all of the available space to a single iSCSI target, you can assign individual LUN (Logical Unit Number) identifiers to multiple targets should you want to connect multiple systems to a single NAS device or server, and give each client system its own iSCSI target.

You'll need to set up an iSCSI target, which is basically a section of your NAS that serves as an extension of your PC hard drive.

Next Page: Connecting Through an iSCSI Initiator; Performance Comparison

Hit the Target

With the iSCSI target created, you must now connect to it through the iSCSI initiator on the client Windows PC. To do so, click Start, type iSCSI into the Search/Run field, and press Enter (or go to Start > Control Panel > System and Security > Administrative Tools > iSCSI Initiator). If you see a message indicating that the iSCSI service is not running, go ahead and allow it, and the iSCSI initiator will open.

Select the Discovery tab, and then click the Discover Portal button. In the window that opens, enter the IP address of your NAS device or server hosting the iSCSI target (ours was 192.168.1.100) in the necessary field. Leave the port setting alone, assuming that you didn’t specify a custom iSCSI port earlier; by default, iSCSI will use port 3260. Note that if you enabled CHAP authentication earlier, you should click the Advanced button here and enter the CHAP login credentials in the necessary fields. Otherwise, just click OK, and the IP address of your NAS or server should appear in the list of Target portals.

If the target is not found and listed, confirm that you entered the IP address correctly and that the necessary port is open in any firewall application you may be running.

Open the iSCSI Initiator utility in Windows to tell your PC where to find your NAS drive.

Once the server is in the list of Target portals, click the Targets tab at the top. The iSCSI target you created earlier should show up in the groups of discovered targets in the middle of the window. Click the target to highlight it, and then click the Connect button. In the Connect To Target dialog box that opens, check Add this connection to the list of Favorite Targets... and click OK. Then click OK in the iSCSI Initiator Properties window to close it.

If everything is properly configured, you should see your NAS drive appear in the iSCSI Initiator list of targets.

Now that the client system is connected to the iSCSI target, you must format the target. To do so, follow the same procedure that you would for any local drive. Click the Start button, and then right-click Computer and select Manage from the menu. In the Computer Management utility that opens, click Disk Management in the Storage subsection in the left pane. You should immediately see an Initialize Disk dialog box. Ensure that the disk is checked in the 'Select disks' field, and then choose your preferred partition type (we used MBR) and click OK. Follow the on-screen prompts to specify the volume size, assign a drive letter, and choose a file system and volume label. Click Finish. Once the formatting is complete, a new drive letter should be available and ready to use. You can now transfer files and run programs from your NAS drive (no matter where it may be) as though it were just another drive in your PC.

Once your PC sees your NAS drive as an iSCSI target, you can format it just as you would any other hard drive.

Performance Comparison

To quantify the performance benefits of using a remote NAS drive connected via iSCSI, we ran a couple of disk benchmarks on our setup. Since we had dedicated half of the available storage space on our NAS to the iSCSI target and the other half to an EXT4 network share, we were able to have the iSCSI initiator connected and a drive letter mapped to the NAS to test speeds when accessing the NAS via iSCSI versus a standard mapped network drive. Here are our results.

As you can see above, the ATTO Disk Benchmark didn't show much of a performance difference between the mapped network drive and iSCSI, although the mapped drive appeared to offer slightly more bandwidth overall. However, this is a relatively light-duty benchmark that tests only sequential transfers.

The CrystalDiskMark benchmark tests both sequential and random transfers using a couple of different file sizes. In this benchmark, the iSCSI target performed significantly better overall. Write speeds were similar between iSCSI and the standard mapped network drive, but read speeds were roughly 30 to 40 percent better with iSCSI. As these results show, the ability to access or format your NAS as a local drive and run programs from it isn't the only benefit you can derive from iSCSI--the technology also allows your system to read data from the drive faster than it could otherwise. If you work with NAS drives at home or at the office, iSCSI offers an excellent (and free) way to boost performance.

Subscribe to the Power Tips Newsletter

Comments