Originally posted by: spyordie007
We've got a spare HP DL385 in our lab with 6x146GB of storage and I'm thinking about running Linux on it with one of the open source iSCSI target implementations out there so that we can take advantage of some of the more HA features in ESX (we have 2 more DL385s in the lab running ESX 3).
Anyone have some experience using Linux boxes as iSCSI servers and have suggestions about distros to use, iSCSI target implimentations, etc.? My Linux knowledge is moderate-at-best so anything you can offer that would make this easier would be much appreciated.
Right now I am typing on a computer that is booted up over PXE and use iSCSI for it's harddrive. No local disk at all. Works out decently well, but I wouldn't recommand it. Open-iscsi initiator isn't able to effectively transfer control from one daemon to another and you have to do that if your setting up the connection in the initrd (as I am) and do a root pivot. It'll get fixed as it matures.
It's stable. It's fast. I have a Linux server running software raid 5 and that serves out 'scsi disks' which are realy just logical volumes. In a setup like that it's almost as fast as local disk access.
I was a bit worried about stability so I hammered it as much as I could with different file system benchmarks and such and it worked fine. I kept track of some of them and I used the 'CSV' output from Bonnie++ and imported it into OpenOffice.org Calc and figured out how to make a pretty little graph, which luckily I still have:
(note that all of the following was done before I got rid of my local disk.. which I added to the raid 5 array by expanding it.
🙂 )
http://img179.imageshack.us/my.php?image=resultshj5.png
and I have other stuff I saved in notes:
The 'tester' file is a 1.9Gb file made up of random garbage. I wanted it big because I care about large media files also I needed it big enough that it couldn't cache entirely in RAM to get a more accurate result.
sshfs file transfer speed
real 3m41.131s
user 0m0.468s
sys 0m6.676s
SMB file transfer speed
real 2m45.295s
user 0m0.308s
sys 0m9.161s
NFS file transfer speed
real 1m44.998s
user 0m0.040s
sys 0m4.100s
iSCSI file transfer speed
real 0m49.336s
user 0m0.268s
sys 0m6.648s
For the same file using netcat, which should indicate fast raw speed:
For netcat the command would go like this:
On the 'server' you would go:
nc -l -p 8000 > tester
and on the 'client' you would go"
time nc remote.machine 8000 -q 0 < tester
For a result I got:
real 0m51.147s
user 0m0.208s
sys 0m4.048s
Which since ISCSI is faster it probably indicates that the file system cache stuff is kicking in and it's not fully writing out to disk when the program exists.
Running md5sum on transfered files...
sshfs file read speed
fd53f34f8b3f9a8e433ed00740e8c424 mnt/rocker2/tester
real 1m37.310s
user 0m4.428s
sys 0m1.376s
SMB file read speed
fd53f34f8b3f9a8e433ed00740e8c424 mnt/ok/tester
real 2m44.506s
user 0m4.480s
sys 0m4.908s
NFS file read speed
fd53f34f8b3f9a8e433ed00740e8c424 mnt/rocker/tester
real 0m51.867s
user 0m4.664s
sys 0m1.984s
iSCSI file read speed
fd53f34f8b3f9a8e433ed00740e8c424 /mnt/tester
real 1m3.691s
user 0m4.416s
sys 0m1.692s
Md5sum run locally on each machine for comparisions
On the server machine:
real 0m44.525s
user 0m7.318s
sys 0m7.018s
On the client machine:
real 0m36.029s
user 0m4.428s
sys 0m2.016s
To use the simplistic benchmarks you run the 'hdparm -tT /dev/hda' command. Of course substituting /dev/hda with proper device file.
On the server machine the test of the raw software raid device /dev/md0:
sudo hdparm -tT /dev/md0
/dev/md0:
Timing cached reads: 1272 MB in 2.00 seconds = 634.80 MB/sec
Timing buffered disk reads: 204 MB in 3.02 seconds = 67.60 MB/sec
On the server one of the SATA harddrives making up the raid array.
/dev/sda:
Timing cached reads: 1264 MB in 2.00 seconds = 631.09 MB/sec
Timing buffered disk reads: 174 MB in 3.01 seconds = 57.89 MB/sec
And my old PATA drive that makes up part of the array...
/dev/hda:
Timing cached reads: 1272 MB in 2.01 seconds = 634.22 MB/sec
Timing buffered disk reads: 144 MB in 3.04 seconds = 47.41 MB/sec
🙂
The local SATA disk on the client machine.
/dev/sda:
Timing cached reads: 4028 MB in 2.00 seconds = 2016.40 MB/sec
Timing buffered disk reads: 128 MB in 3.03 seconds = 42.20 MB/sec
The iSCSI device on the client machine
/dev/sdb:
Timing cached reads: 4048 MB in 2.00 seconds = 2025.90 MB/sec
Timing buffered disk reads: 144 MB in 3.11 seconds = 46.35 MB/sec
And I wanted to test the speed of the actual network to see what the highest I could get out of my el-cheapo 20 buck switch and onboard ethernet:
To see what the maximum actual performance of the network is I used iperf benchmark. Just ran some simple benchmarks.
From my server to the desktop I got:
0.0-60.0 sec 3.98 GBytes 569 Mbits/sec
From my desktop to the server I got:
0.0-60.0 sec 4.82 GBytes 690 Mbits/sec
So maybe that will be helpfull.
But I wouldn't recommend running any diskless machines on ISCSI or any network. There is a known problem when the machine begins to run out of RAM and begins accessing the swap file or partition on the iscsi drive. The system needs to allocate more RAM to perform the network operation to write out RAM to swap. The system is not able to properly discern the difference between required network packets for storage and just random server/network stuff. So you end up with a race condition were the machine needs to allocate more ram to allocate more ram. It's BAD.
So for anything you want to boot up over a network and you want to run heavy loads on you need to at least have a local disk for swap. Also Like I said before on Linux the open-iscsi initiator stuff has limitations that make it difficult to go diskless with that anyways. If your interested in my initramfs for doing this though I'll post it. It's realy hackish though I wouldn't recommend it.
So next time I set it up I'll go local disk for core system and use GFS or OCFSv2 other clustering file system solutions so that I can share out /home directories and /usr/local directories. Also I want to look into DNBD which a network block device solution for Linux from the GFS project. It may offer better performance for Linux as it's tuned specificly for how Linux operates. Not usefull for windows clients, obviously.
But as far as using ISCSI goes...
Microsoft has a no-cost ISCSI initaitor for
Windows XP Pro SP1 or later
Windows Server 2003 or later
Windows 2000 SP3 or later
http://www.microsoft.com/downloads/deta...-4585-b385-befd1319f825&DisplayLang=en
For Linux Open-ISCSI support is in the kernel. I don't know what version it made it in though.
For userland stuff:
http://www.open-iscsi.org/
Debian has packages for it. I don't know about other distros.
For ISCSI target there are a couple to choose from. For instance Intel released a open source one.. but those seem more for application and network testing and don't offer the best performance. Just what from I read. The one I used was 'ISCSI Enterprise Target' which seems to be designed for serious work.
http://iscsitarget.sourceforge.net/
I've never tried to do ISCSI for Windows.
Obviously for production use you want to use benchmarks and such to hammer the systems as hard as you can in testing. These things can end up very RAM-needy with large files and such so watch for that.
Personally for day to day stuff it's not a problem. Run bittorrent, play games off of it, whatever I want. hammer hammer hammer. No sweat. But if that Open-ISCSI deamon fails, since it was running out of initrd I am screwed. (otherwise it can be restarted) As long as the network stays up, so does my machine. I recommend Ext3 for Linux stuff, it's able to handle failures better then XFS can.
edit:
Also security is a issue. You want to use a private network for storage. Iscsi has some security features, but they are not strong. My idea for production servers involves using Xen to setup virtual disks on the iscsi stuff and only exposing external network for them thus removing direct access to machines running in DomU to the storage network. That way if a machine gets compromised it only can access it's own stuff. But I bet there are other ways to acheive the same effect.