Archive for the ‘Computer Stuff’ Category

SRP vs Samba on 10Gb Infiniband Fabric

Saturday, January 14th, 2012

 

Here’s some more ramblings on 10G Networking on the Cheap.

Having gone to all the trouble of getting a 900MB/sec SRP target working, I was interested to go back and see how a samba mount would perform now that I’d sorted out all the cards into their optimum PCI-express slots.

So, I did the same setup as the 900MB/sec SRP test, Ramdisk to Ramdisk. This time, I set up a 2Gig ramdisk as a samba mount, and copied large files to and from that ramdisk from a 4G Ramdisk on the Windows side. ATTO disk benchmark doesn’t test network drives, so I had to make do with copying large files and keeping an eye on the throughput with dstat.

I initially measured the IPoIB throughput using netperf, than this gave me about 6Gbits.

daveh@raid:~$ netperf -H 10.4.12.2
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0
AF_INET to 10.4.12.2 (10.4.12.2) port 0 AF_INET : demo
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec
 8192  16384  16384    10.00    6022.50

Based on that number, I was not expecting anywhere close to the 900MB/sec throughput I was getting with SRP. Anyway, just to compare samba throughput with SRP, I pressed on.

While copying a 1 GB video file to
the ramdisk on the linux box (write)
usr sys idl wai hiq siq| read  writ| recv  send
  3  57  31   0   0   9|   0     0 | 191M  565k
  3  61  28   0   0   8|   0     0 | 188M  556k
  4  56  31   0   0   9|4096B   40k| 192M  568k
  4  59  32   0   0   6|   0     0 | 163M  485k
  5  56  29   0   0   9|   0     0 | 186M 6419k
  3  61  29   0   0   8|   0     0 | 187M 6519k
  2  64  25   0   0   9|   0     0 | 183M  543k
 

While copying a 1 GB video file from
the ramdisk on the linux box (read)

usr sys idl wai hiq siq| read  writ| recv  send
  3  40  54   0   0   4|   0  4096B| 863k  251M
  6  42  47   1   0   5|   0    52k| 910k  263M
  5  44  48   0   0   5|   0     0 | 816k  233M
  5  42  46   0   0   6|   0     0 | 812k  231M
  4  45  48   0   0   4|   0     0 | 826k  236M
  3  44  49   0   0   5|   0     0 | 819k  234M
  4  44  48   0   0   5|   0     0 | 832k  236M

I know it’s not very scientific, and I didn’t spend any time tuning samba. But the 900MB/sec throughput is practically out-of-the-box for SRP, so why not test samba at it’s out-of-the-box settings. :)

So, even with netperf showing a 6Gbit throughput, I was only seeing around 190-235MB/sec throughput over samba (at 40-60% CPU usage).  So I think I’ll stick with my SRP target setup rather than going back to samba. With SRP, I know that whatever disk subsystem I put into the linux box, it probably won’t be able to keep up with the 900MB/sec  that the link is capable of. Unless, that is, I buy a very expensive RAID card and a bunch more disks. And with the way disk prices have gone over the last few months with the floods in Thailand, it’ll be a while until I even think about doing that. :)

 

 

Infiniband IPoIB & SRP target setup on Ububtu 11.10

Saturday, December 24th, 2011

In a previous blog article, I covered how to get the infiniband fabric up on Ubuntu 10.10 (Maverick Meerkat). This time I’ll cover IPoIB on Ubuntu 11.10 (Oneiric Ocelot), and also add in the information on how to also get the SRP target configured and running. This guide does not require you to rebuild the linux kernel, and works from the stock install of Ubuntu 11.10. So you should be up-and running with an SRP target in about 15 minutes, all going well.
As before, I’m using an Ubuntu box for the disk subsystem, and a Windows 7 as a client (initiator) machine.

Here’s a few acronyms:

SCSI – we should know what this one is (Small Computer Systems Interface)
iSCSI – SCSI protocol over a network.  (Internet SCSI).
SCST – SCSI Target subsystem for linux with target drivers for iSCSI, Fibre Channel, SRP, SAS, FCoE, etc. We’re most interested in the SRP target.
RDMA – Remote Direct Memory Access – fast way of copying chunks of memory from one machine to another.
SRP – SCSI RDMA Protocol – wraps it all up using RDMA over SCSI protocol.

Stage 1 – Setting up IPoIB

This section shows how to get the basic fabric up and running with TCP/IP over Infiniband (IPoIB). Once you’ve done this, you’ll be able to send pings between the machines, ssh from one to the other across the fabric, etc.

For the windows 7 machine, it’s a simple case of installing the OFED drivers from  openfbrics.org. While installing the windows drivers, make sure you select the SRP options, as later in this guide we’ll be setting up the RAID box as a drive on the Windows box using SRP (iSCSI RDMA Protocol). So,  install the OFED driver package.

To enable improved throughput, enable connected mode on the link by updating the “Connected Mode” and “Connected Mode Payload Mtu size” in the properties of the interface. Open up “Device Manager” and find your Infiniband adapter:

Right clock on the adapter and bring up the properties dialog:

 

So, on to the linux box. I started with a fresh install of Ubuntu 11.10.

Firstly Install Ubuntu. Update all the packages to the latest using

sudo apt-get update
sudo apt-get upgrade

Everything below is done as root, this avoids having to type ‘sudo’ before every command, so I just call “sudo bash”.

Note: No need to edit the udev rules any more as per the Ubuntu 10.10 HOWTO, as they are correctly set by the kernel 3.0.0 and newer.

Edit /etc/modules and add the following modules:

ib_sa
ib_cm
ib_umad
ib_addr
ib_uverbs
ib_ipoib
ib_ipath
ib_qib

Next,

apt-get install opensm

This will install the subnet manager and all the relevant dependencies, libibverbs, etc.
Then add the relevant entries for the interface into /etc/network/interfaces file:

auto ib0
iface ib0 inet static
address 192.168.1.1
netmask 255.255.255.0

Then reboot. This will create the relevant infiniband entries in /sys, load the ipoib modules, and bring up the infiniband port with an ip address. You should now have a functioning infiniband port on your Ubuntu machine, and you should be able to ping the remote machine.

The next thing is to enable connected mode for the infiniband connection. I found that this increased the tcp/ip netperf benchmarks from 3gbps tp 7gbps.

root@raid:~# echo connected >`find /sys -name mode | grep ib0`
root@raid:~# echo 65520 >`find /sys -name mtu | grep ib0`

To make this happen when the ib0 interface is brought up, modify the /etc/network/interfaces file as follows:

auto ib0
iface ib0 inet static
address 10.4.12.1
netmask 255.255.255.0
up echo connected >`find /sys -name mode | grep ib0`
up echo 65520 >`find /sys -name mtu | grep ib0`

 

Stage 2 – Setting up SRP Target

The next step, should you wish to take it, is to set up the SRP targets. This is much better option than using samba shares, as it gives you a massive boost in throughput, and uses much less CPU. For example, on my setup using IPoIB and samba shares, I was able to achieve no more than 125MB/sec. Using a ramdisk set up as an SRP target, I was able to achieve 900MB/sec between my two machines.
So, first get a few packages:

apt-get install libmthca1
apt-get install iscsitarget
apt-get install open-iscsi
apt-get install lsscsi
apt-get install scsitools
change /etc/default/iscsitarget to:
ISCSITARGET_ENABLE=true

We now need to get scstadmin. I typically pull the latest version from subversion, so we first need to get svn. apt-get install subversion
There’s a choice to me made now. According to the guide at http://iscsi-scst.sourceforge.net/iscsi-scst-howto.txt , you get a slight performance increase by patching and re-compiling the kernel. That’s a lot of work, so I skipped that step for this guide. I went for the easier option, which is just to run the few commands below. I’m not sure what the difference in performance is, but I can still pull 900MB/sec across the fabric from a ramdisk set up as a an SRP target. And not having to rebuild the kernel makes this a 15 minute procedure rather than a 3 hour one. :)

cd ~
svn co https://scst.svn.sourceforge.net/svnroot/scst/trunk scst
cd scst
make scst scst_install
make iscsi iscsi_install
make scstadm scstadm_install
make srpt srpt_install

N.B.: You’ll need to rebuild these each time Ubuntu upgrades the kernel, as the modules get out of sync. Just re-run the make’s again.

Lets now use scstadmin to create an SRP target:

First we modprobe a couple of kernel modules. That will make the relevant drivers and targets available to scstadmin. We should then be able to see thse drivers/targets with a few scstadmin ‘list’ commands:

modprobe scst_vdisk
modprobe ib_srpt
root@raid:~# scstadmin -list_handler

Collecting current configuration: done.
 Handler
 -------------
 vdisk_fileio
 vdisk_blockio
 vdisk_nullio
 vcdrom

All done.
root@raid:~# scstadmin -list_driver

Collecting current configuration: done.

 Driver
 -------
 ib_srpt

All done.
root@raid:~# scstadmin -list_device

Collecting current configuration: done.

 Handler           Device
 ------------------------
 vdisk_nullio     -
 vdisk_fileio     -
 vdisk_blockio    DISK01
 vcdrom           -

All done.
root@raid:~#
So, if you can see those handlers, targets, and drivers, your good to go with the next step.

Summary:

The following command list is the quick list to use (and modify) if you’ve done this kind of thing before. The detail section below gives a bit of explanation on each of the lines.

scstadmin -disable_target ib_srpt_target_0 -driver ib_srpt
scstadmin -clear_config -force
scstadmin -open_dev DISK01 -handler vdisk_blockio -attributes filename=/dev/sda
scstadmin -set_dev_attr DISK01 -attributes t10_dev_id=0x2346,threads_num=4
scstadmin -add_group HOST01 -driver ib_srpt -target ib_srpt_target_0
scstadmin -add_lun 0 -driver ib_srpt -target ib_srpt_target_0 -group HOST01 -device DISK01 -attributes read_only=0
scstadmin -add_init 0x0002c9020021f9fc0002c902002200bc -driver ib_srpt -target ib_srpt_target_0 -group HOST01
scstadmin -enable_target ib_srpt_target_0 -driver ib_srpt
scstadmin -write_config /etc/scst.conf

Detail:

Clear the current config (only if that’s ok, and you don’t have any other config that you want to keep. I do this because I’m starting with a clean slate).

scstadmin -clear_config -force

Create DISK01, assigning it to a partition (/dev/sdg1, /dev/md0p1, etc., etc.). I’m using a disk partition in this example.

scstadmin -open_dev DISK01 -handler vdisk_blockio -attributes filename=/dev/sdg1

Now set the drive attributes.

scstadmin -set_dev_attr DISK01 -attributes t10_dev_id=0x2345

Now add a group

scstadmin -add_group HOST01 -driver ib_srpt  -target ib_srpt_target_0

Add a LUN to the group, assigning it to DISK01

scstadmin -add_lun 0 -driver ib_srpt -target ib_srpt_target_0 -group HOST01 -device DISK01 -attributes read_only=0

Add an initiator to the group, allowing the initiator to connect to our new target. I got this from watching /var/log/messages while I was disabling and enabling the Infiniband SRP miniport in device manager on the Win7 box. This caused the SRP miniport to attempt to connect to the Ubuntu target, and that attempt is shown in the /var/log/messages file along with the initiator ID.

scstadmin -add_init 0x0002c9020021f9fc0002c902002200bc -driver ib_srpt -target ib_srpt_target_0 -group HOST01

Finally enable the target

scstadmin -enable_target ib_srpt_target_0 -driver ib_srpt

And write the config.

scstadmin -write_config /etc/scst.conf

At this point you should see a new drive appear on the Win7 box, and asking you to format it. If not, you could try disabling and enabling the SRP miniport driver again, and take a look at /var/log/messages to see what’s happening.

Once the new drive appears on the Windows host, you should be able to format it and start using it. If you don’t see it immediately, have a look in “Disk Management”.

I found that the //etc/init.d/scst script was not getting called at boot, so I added a softlink in /etc/rcS.d

cd /etc/rcS.d
ln -s ../init.d/scst S26scst

This is so it will start after scsitools, opensm and open-iscsi. Using the /etc/init.d/scst script also resolved a problem I’ve had for a long time, in that I used to have some modules in /etc/modules, so the SRP miniport would attempt to connect too early in the linux boot sequence, and fail, so that I had to go into the device manager and disable/enable to get it working. Now it pops up perfectly every boot of the linux box, and I  don’t have to go into device manager on the Win7 box any more.

I’d suggest you run a benchmark on it also just to see what kind of speed you’re getting out if it in real-world usage. There’s a very handy (free) benchmarking took available from attotech.com. Oh, and please do drop a comment below if you do get decent speeds. I’m always interested to hear what people are getting. Oh, and also, comment if you find this guide useful!

 

References:

SCST – http://scst.sourceforge.net/

Installing iSCSI-SCST – http://iscsi-scst.sourceforge.net/iscsi-scst-howto.txt

 

Performance Testing.

If you have plenty of memory in your linux machine, you might like to do a test of a ramdisk SRP target over the fabric.

There’s a ramdisk set up by default in Ubuntu at /dev/ram0, but it’s quite small, at 64K. I like to bump it up to 1Gig or 2Gig, as I have 4Gig in my linux box and it does need all that for normal operation. Adding an extra parameter to the kernel line in /boot/grub/grub.cfg does the trick nicely.

ramdisk_size=1024000 for a 1Gig ramdisk at /dev/ram0

ramdisk_size=2048000 for a 2Gig ramdisk at /dev/ram0

so the full line would look like:

linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=39331d95-e9ba-48a5-9dd9-09978e0503c4 ro   quiet splash vt.handoff=7 ramdisk_size=1024000

Then using scstadmin, we add another disk to the script above, but we use vdisk_fileio rather than vdisk_blockio.

scstadmin -open_dev DISK02 -handler vdisk_fileio -attributes filename=/dev/ram0

Then when you open disk manager in windows, you should see a disk requesting a new MBR, which you go ahead and add, then format and run a few benchmarks on it.

 

900MB/sec Network at Home

Thursday, December 22nd, 2011

I’ve just made a breakthrough in my research into setting up an infiniband fabric at home. I started out at about 135MB/sec. made slow progress up to 200-220MB/sec, but this evening broke the 900MB/sec barrier. Almost 1 GIGABYTE per second. That’s well over a CD every second! Here’s the ATTO benchmark output…

In previous posts, I’d identified several bottlenecks, and as I got around each one, I slowly got the speed up. However, everything seemed to max out at 200-220MB/sec. I’d identified PCI-express slots as one potential problem but when I set up a ramdisk on the linux box and exported that as an SRP target, I was still only getting 200MB/sec. Then I thought – could it be my i7 Win7 box? Surely not. That’s sooo much more powerful than the athlon64 x2 3GHz box that I’d linux installed on. But for a laugh I had a look at the PCI express slot that I’d inserted the Mellanox Infiniband card into. Even though it’s a 16x sized slot, my jaw dropped when I saw PCIEx4 written on the motherboard beside it. But the Mellanox card is a PCIEx8 card! So I moved the card into the spare PCIEx16 slot, and re-ran my tests, only to smash all previous records, achieving almost 950MB/sec for some packet sizes.

Just to put this into context:

Machine A:

  • 3GHz Athlon 64 dual core, Asus A8N-SLI Premium, 4Gig ram, Mellanox MHEA28-XTC 10Gbps Infiniband card.
  • Running Ubuntu 11.10, 2Gig Ramdisk set up as an SRP target

Machine B:

  • 3.20GHz Intel i7 quad core, Gigabyte GA-X58-USB3, 12Gig ram, Mellanox MHEA28-XTC 10Gbps Infiniband card
  • Running Windows 7 Home Premium, OFED infiniband drivers package, SRP Initiator. ATTO Disk Benchmark utility.

Both machines are connected directly together, no switch was needed.

Consumer grade hardware for the most part, with the magical Mellanox ingredient that pushes this beyond what I previously though possible.

Also, it’s worth noting that this is a stock Ubuntu 11.10 install, a custom kernel was NOT required. I’m working on a HOWTO to get the Infiniband fabric up and SRP targets configured, I’ll be posting that soon.  I reckon it’ll be possible to configure an Ubuntu box up to the 900MB/sec speeds in under 15 minutes.

Here’s the HDTune benchmark of the same setup. Not quite 900MB/sec, but not far off….

“You can learn from my mistakes” (putting the infiniband card in the wrong slot)  :)

More to come soon…..

 

 

Additional Notes:

Here’s a shot of the Linux Box. It’s changed a bit since this photo was taken, there’s now a raid card in there where the graphics card is shown, but it give you and idea of the “consumer grade” hardware I’m doing this with….

 

RAID controller installation & benchmarks

Saturday, December 17th, 2011

Continuing on my research into a high-bandwidth infiniband fabric at home, mainly with a view to fast backups of the 2000Gigs of photos I now have, I was now on the lookout on eBay for a good-value hardware RAID controller card. After a couple of weeks of looking at cards and prices, I came across an auction for a Dell PERC 5/i 8-port card. Bidding was pretty low, probably due to the comment on the auction that the seller could not guarantee that the card was in fully working condition. Turned out later to be in great working order. :)

I ended up getting it for €31 including shipping to Ireland from Finland. Most of these cards go for three times that price. I was just lucky that the auction ended at 3am, and I dont think that  many people bothered to stay up to keep an eye on it.

About a week later, the card arrived, along with the seperate order of a couple of SFF8484 to 4-way SATA cables, I was ready to go.

I’d already freed up one of the PCI-e 16x slots in by Ubuntu box, so the Perc 5/i slotted right in. I hooked up the 5 x 1TB drives that I was configuring in a RAID5 volume, and booted up.

Upon boot, the raid card was detected, and I hit CTRL-R to enter the setup. It was fairly straightforward, I selected the 5 drives that I’d connected up to it, and initialised a new RAID5 volume.

Anyway, the drive then appeared to Linux as a 4TB volume, which I used parted to partition into one big volume.

There were a couple of problems once I’d installed the drive,  read speed and write speed. I was getting 200MB/sec reads and 50MB/sec writes. I did a bit of googling and found an excellent thread on the Dell PERC 5/i controller (ref1), so I flashed the firmware up to the very latest from LSI. I initially did not have a battery, but the latest firmware allowed me to force Write-Back and Adaptive Read-Ahead (not safe settings without battery, but it’d be ok till the battery arrived, another eBay purchase), which should improve the throughput. Also, I found that when you do a quick init of the aray, it says that it completes very quickly, but it’ll go ahead and do a full background init afterwards thereby confusing my throughput results. I found that the best thing to do was to do a full init in the RAID configuration utility and let it sit there for 2.5 hours to complete the full init of 4TB (5x1TB). That way I’d know that the initialisation process would not be skewing my measurements later. Before I did the full init, though, I was getting 170MB read/write (across the infiniband fabric) even when the background init was in progress, so the firmware upgrade was definitely a step in the right direction. I was looking forward to full speed measurements in a couple of hours.

Once the init finished, I was disappointed to find that I was only getting just under 200MB/sec read/write.

So, I tore down the array again and went back to a 5 disk RAID0 array, for max speed. This gave me the following:

This was only marginally better than the RAID5 readings, and worse read speed than using software RAID and motherboard SATA connectors. So to eliminate my Linux box motherboard and CPU, I took the RAID controller out of the Linux box and interted it into my i7  desktop (i7-950@3.07GHz 12G RAM), leaving the drives in the linux box, and running the SATA cables between the two machines. The throughput from the raid card was quite different.

So, now I was getting 300-350MB/sec writes, and up to 600MB/sec reads, with 500MB/sec reads quite common above block size of 64K. That proved that my linux box motherboard is now the bottleneck. Maybe the fact that I’ve two PCIe-8x cards plugged into the two PCIe-16x slots intended for graphics cards is a problem?

At least now I knew what the Perc 5i RAiD controller was capable of, I just had to get the machine that it was hosted in up to spec to be able to drive it at full speed. Maybe then we’ll get more out of the infiniband link between the two machines. I’ll look at re-organising the cards in the machine, maybe look at getting a new motherboard with faster PCI-express lanes.

I’m rapidly coming to the conclusion that trying to re-cycle 5-year-old components to get uber-speed throughput is a lot more difficult than it seems at first. Might be something to do with the hardware not being up to the task when pushed to the limit. The motherboard I’m using in the Linux box with the RAID controller is an Asus A8N-LSI-Premium, which was a top-end consumer-grade motherboard in 2005. With two PCI-e 16x slots, each theoretically capable of 2GB/sec (PCI-e 1.0 8 lanes) in SLI mode, yet I’m only able to get 200-300MB/sec through them? What’s with that? Surely there’s gotta be a helluva lot more data going through those slots when there’s two big fat graphics cards in them.

Stay posted for more updates soon….

Update: Just to help narrow down the bottleneck, I managed to get a 1Gigabyte ramdisk set up as an SRP target. Here’s the throughput across the fabic:

So, The infiniband card in the PCI-express socket with 8 lanes assigned is only getting 200MB/sec through it from RAM. CPU was about 25% busy through the whole test.

 

 

 

References:

http://www.overclock.net/t/359025/perc-5-i-raid-card-tips-and-benchmarks

 

Infiniband SRP target on Ubuntu from Win7

Tuesday, November 22nd, 2011

 

While building a linux box as a hard drive farm, I wanted to get the fastest transport possible between the machines using my existing Infiniband fabric (10Gbps), and all research lead to methods using RDMA. I had to rule out NFS/RDMA, as there is no NFS client delivered with Windows 7 Home Premium. I looked at iSCSI, and there is an implementation which uses RDMA called SRP. Having tried and initially failed, I gave up for a few months and was happy enough with a samba link over IPoIB. That was giving me about 130MB/sec reads. I still would have love to get SRP working, as that should theoretically be a lot faster.

Then, someone dropped me a comment on one of my Infiniband blog articles about how they’d got SRP working between a Windows 7 machine and a SLES target. Since this confirmed that Windows 7 was capable of SRP, I had another go. I had thought that it was a limitation of the OFED drivers on Windows 7, but it turns out that I was incorrect,  it was mis-configuration on the Ubuntu side. This article take you through that setup, after which we’ll have an SRP target on the Ubuntu box, accessed from an initiator on a Windows 7 box.

Firstly, here’s some acronyms:

SCSI – we should know what this one is (Small Computer Systems Interface)
iSCSI – SCSI protocol over a network.  (Internet SCSI).
SCST – SCSI Target subsystem for linux with target drivers for iSCSI, Fibre Channel, SRP, SAS, FCoE, etc. We’re most interested in the SRP target.
RDMA – Remote Direct Memory Access – fast way of copying chunks of memory from one machine to another.
SRP – SCSI RDMA Protocol – wraps it all up using RDMA over SCSI protocol.

This article assumes that you’ve already got Infiniband working. See link to “Enabling Infiniband on Ububtu 10.10″ article below which guides you though that.

I found that the easiest way to get SCST (SCSI Target) with SRP (SCSI RDMA Protocol) was to patch the ubuntu kernel source and run a custom kernel. I haven’t tried the latest Ubuntu installs, hopefully it’s included in those and that a kernel rebuild is not necessary. For the moment, I patched my kernel and booted it.

Patch broke kernel. I had to add

#define REQ_WRITE 0×4
to block/blk-map.c

Your kernel might be ok, but that fix allowed my compile to complete.

Once the kernel was up and running, there’s various packages to be installed. I didn’t keep track of these, apologies. However, I do intend to do a complete rebuild soon, so I’ll update the main article with the complete list from start to finish, including the basic infiniband setup all the way to setting up SRP targets so you can have a clean install. Ubuntu 11.10 might even have the scst stuff built into the kernel, eliminating the need to build a custom kernel.

The srp_daemon was complaining on startup about missing /dev/class/infiniband/uverbs* files, so again the udev rules had to be edited to create these. Also, the libmthca1 package needed to be installed to provide user-space drivers for the Mellanox HCAs for use with the ibverbs library.

Now, onto the SCST (SCSI target subsystem) setup. We should have the ib_srp driver installed and available as a target to scstadmin. We can verify this by using “scstadmin -list_target” go show the ib_srpt target is available.

First, we’ll do a few ‘lists’.
scstadmin -list_handler
scstadmin -list_driver
scstadmin -list_target
So, then the list of commands to set up the target:

Summary

scstadmin -clear_config -force
scstadmin -open_dev DISK01 -handler vdisk_blockio -attributes filename=/dev/sdg1
scstadmin -set_dev_attr DISK01 -attributes t10_dev_id=0x2345
scstadmin -add_group HOST01 -driver ib_srpt  -target ib_srpt_target_0
scstadmin -add_lun 0 -driver ib_srpt -target ib_srpt_target_0 -group HOST01 -device DISK01 -attributes read_only=0
scstadmin -add_init 0x2c902002200bc -driver ib_srpt -target ib_srpt_target_0 -group HOST01
scstadmin -add_init 0x0002c9020021f9fc0002c902002200bc -driver ib_srpt -target ib_srpt_target_0 -group HOST01
scstadmin -enable_target ib_srpt_target_0 -driver ib_srpt
scstadmin -write_config /etc/scst.conf

 

Detail

Clear the current config (only if that’s ok, and you don’t have any other config that you want to keep. I do this because I’m starting with a clean slate).

scstadmin -clear_config -force

Create DISK01, assigning it to a partition (/dev/sdg1, /dev/md0p1, etc., etc.). I’m using a disk partition in this example.

scstadmin -open_dev DISK01 -handler vdisk_blockio -attributes filename=/dev/sdg1

Now set the drive attributes.

scstadmin -set_dev_attr DISK01 -attributes t10_dev_id=0x2345

Now add a group

scstadmin -add_group HOST01 -driver ib_srpt  -target ib_srpt_target_0

Add a LUN to the group, assigning it to DISK01

scstadmin -add_lun 0 -driver ib_srpt -target ib_srpt_target_0 -group HOST01 -device DISK01 -attributes read_only=0

Add an initiator to the group, allowing the initiator to connect to our new target. I got this from watching /var/log/messages while I was disabling and enabling the Infiniband SRP miniport in device manager on the Win7 box. This caused the SRP miniport to attempt to connect to the Ubuntu target, and that attempt is shown in the messages file along with the initiator ID.

scstadmin -add_init 0x0002c9020021f9fc0002c902002200bc -driver ib_srpt -target ib_srpt_target_0 -group HOST01

Finally enable the target

scstadmin -enable_target ib_srpt_target_0 -driver ib_srpt

And write the config.

scstadmin -write_config /etc/scst.conf

At this point I saw a new drive appear on the Win7 box, and it was asking me to format it. I formatted it with NTFS, 16K blocks, then did some benchmarks. 250MB/sec reads and 50MB/sec writes. The 50MB/sec writes were down to the speed of the software RAID on linux. Once I split the drives into a couple of RAID0 arrays, the writes went up to 200MB/sec (two drives in RAID0).

So, the SRP issue is resolved, now I need a hardware RAID card with enough horsepower to push the drives at full speed. I’m looking at an 8-port RAID card with PCI-e 4x or 8x. I’ll soon have a spare PCI-e 8x slot in my motherboard once I move the graphics card to a 1x slot. I’ve hacked the 1x slot so I can fit a larger card into it. I don’t need a fast gfx card, and I’ve even disabled the graphical desktop on the machine, all I need is a text-based interface. So a PCI-e 1x graphics card should be fine. It’s also interesting to note that my motherboard has 20 PCI-express lanes in total, 16 for the two PCI-e 16x slots, but the 16 lanes are shared.  It’s either 16x + 1x or 8x + 8x, depending on the SLI settings in the BIOS. That leaves 3 or 4 lanes for the PCI-e 4x slot (2 lanes)  and 1 or two left for the motherboard RAID controller. Not enough really, so I want to get the new RAID controller into one of the PCIe 16x slots using 4-8 PCIe lanes on the mobo. Who’d have known that the slot sizes don’t actually have that amount of lanes assigned. That’s one of the cheats that manufacturers use to bring down the price of motherboards.

More to come soon….

Edit: See what happened when I got the RAID controller…

References:
SCST - http://scst.sourceforge.net/
Rebuild a new linux kernel https://help.ubuntu.com/community/Kernel/Compile
Installing iSCSI-SCST - http://iscsi-scst.sourceforge.net/iscsi-scst-howto.txt

 

 

Facebook Image Tag Spam

Tuesday, June 7th, 2011

In the last few months I’ve decided to put some of my images up on Facebook, even though I don’t fully agree with their terms and conditions with regards to them using my images as they see fit. Anyway, it’s a great way to get your name out there to people, and to keep people up to date with your latest photographical goings-on.
However, I’ve recently been hit (annoyed) with a new type of spam that’s becoming more and more commonplace on Facebook. And it’s all down to the way the photo back-end of Facebook works.
If I post up an image, then a notification will appear on all my friends news feeds. However, if I tag 30 of my friends in that image, then all their friends will also get a notification, multiplying the number of people that get notified about that image by many times. Say each of those 30 friends had 100 friends, then instantly the number of people notitified goes up to 3000!
Many of my friends happen to “like” a particular page that indulges in this dubious practice to sell their products. I would urge everyone to “unlike” any pages like this to keep the replication of this spam to a minimum.

So, if you’re the victim of Facebook image-tag spam, you can do one of the following, assuming that you’ve already “un-liked” the page yourself:

  • ask any of your friends that “like” the page to “unlike” it
  • “de-friend” any of your friends that “likes” the page
  • Report the page to Facebook for Spam, although I’d say this has limited effect.
  • wait for Facebook to implement a mechanism that allows you to block relevant notifications in your news feed, or some other fix.

Bear in mind that you do not necessarily need to like the page yourself to get this spam, it’s caused by your friends liking a page who’s tagging them in their photos, even though those friends are not actually in the photo. it’s purely a method of marketing that should be frowned upon. I can’t use the word “scam” as it’s not a scam, it’s a perfectly legal, but in my view it’s a dubious practice, as it’s akin to unsolicited email. Facebook provide the mechanism to do this, but do not provide a mechanism for the users on the receiving end to switch it off (yet).

So, if you receive a request to “unlike” a page that you’re subscribed to (by “liking” it), this is probably why. Have a look at some of that page, and if you see dozens of tags on an image where they’re obviously not all in it, then please “unlike” the page. It’ll do us all a favor.

References:
http://blog.maexotic.de/archives/240-Facebook-Spam-by-Image-Tagging.html

 

Note: If you’re looking to “like” something on Facebook that won’t spam-tag you, you could do worse than “liking” my photography page at http://www.facebook.com/davidhuntphotography ;)

 

Eye-Fi Wireless SD card

Monday, May 30th, 2011

I recently got my hands on a very clever little device (and it IS very little) calle the Eye-Fi X2 Pro 8GB SD card. What this looks like is a standard SD memory card that slots into your digital camera. What’s clever about it is that it contains Wifi functionality that will wireless transmit your pictures from the camera as you take them. It’s amazing that they can pack that much functionality into a package that small.

The EyeFi X2 Pro cost $99 in Best Buy, and comes with it’s own SD to USB adapter, which is used to plug the card into your PC/Mac for initial configuration. This was all very straightforward, and the software installed easily. However, before I started configuring the card, it was prompting me to update the card’s firmware. After dozens of attempts (with “Firmware Update Failed” errors), I gave up and attempted to configure the card in “direct” mode, only to be told that this particular feature requires the latest firmware. So, I persisted with the firmware update, installed the Eye-Fi software onto another computer, and this time the firmware update worked flawlessly. I was then able to configure the Eye-Fi card in direct mode.

I guess I’d better explain what direct mode actually is. Normally, Wifi networks work around what’s called an “access point”. This access point is the centre of the wifi network, and all clients connect into this. So, if you’ve several laptops and desktops connecteded wirelessly, they all connect in to the central access point(s), and it’s this access point that allows the clients (laptops/desktops) to talk to each other.

It’s quite common that  Wifi hardware can only function in client mode, in that they need an access point  in order to connect to a network. Some wireless cards have extra functionality that allows them to BECOME the access point, allowing them to form their own wireless mini-network. This is the case with the new Eye-Fi cards (and the new iPhone 4, with it’s personal hotspot feature). The folks at Eye-Fi call this “Direct Mode”, so you can then have another device connect directly to it without the need for a separate access point. This is important when you’re out in the field (or even out in an actual field), and there’s no power, and no wifi network available, AND it cuts down on the hardware needed. All you need is your camera with it’s Eye-Fi, set the Eye-Fi into direct mode, and associate your client device to the network created by the Eye-Fi. I’ve used an iPad with an app called “Shuttersnitch” running on it.

So, Once I switch on my camera, a few seconds later the new wireless network appears. I then go into the settings on my iPad, and associate to the Eye-Fi wireless network. Then when I run Shuttersnitch, it will wait for incoming images from the camera.

I’ve only tested this so far with a 7megapixel compact camera, I forgot to order a SD-CF adapter for my Canon 5d MarkII which takes Compact Flash memory cards, and it needs this adapter before I can insert the Eye-Fi card. With the 2mb files from the compact camera, transfers only took a couple of seconds. It’ll be a bit longer for the 5-15mb files from the 5DmkII. I guess I can always set the jpeg size to small for faster transfers/previews.

A feature of the X2 Pro version of the Eye-Fi is that it can be configured to transmit RAW files as well as JPEGs. This is fine if you’ve got a minute between shots, but for typcial uses I’d see people sticking to the small or medium JPEG option. If you’re in the habit of shooting several shots continuously, then you’d probably be better sticking to the smallest JPEG option, and let the full size RAWs stay on the card.

I realise the effective range will be reduced when I insert the Eye-Fi into a SD-CF adapter, but I’ll comment on that when the adapter arrives (it’s in the post at the moment). More to follow when that arrives….

References:
Eye-Fi website –  http://uk.eye.fi
Shuttersnitch website - http://www.shuttersnitch.com


Workflow Tip – Fast cards & Fast readers

Thursday, May 19th, 2011

Here’s something that might be of interest, and will help speed up some parts of your workflow.

Get a faster memory card, and the means to get the images onto your PC as quick as possible.


I recently ordered a couple of 600x Duracell 8Gb Compact flash cards from 7DayShop.com….
They give a read speed of 90MB/sec. and are only £20.99 for 8Gigs. That’s great value.

Now USB 2.0 can’t go that fast, it can only manage about 45MB/sec if you’re lucky.
But USB 3.0 is getting much more popular, so you could get yourself a USB 3.0 card reader.
This one is about €19 from the UK.

USB 3.0 is rated at 5gbps, or in megabytes about 500MB/sec, More than enough for the fastest CF/SD card, so should be able to max out the 600x Compact Flash card.

If your PC doesnt have a USB 3.0 connection, you can always add one using a USB 3.0 PCIe adapter (about €20).

Or, for a laptop (about €20).

The Pretec card reader comes with a pretty short stubby adapter, so if you want to have the card reader on your desk, you’ll also need a cable (about €5).

So, you’ll have the added advantage that your camera will be able to keep going longer for those rapid-fire shots (by writing to the card faster), and you’ll also get your images off your card and onto your PC MUCH quicker, giving you more time to process, etc.

The following is a benchmark of the above setup.

As you can see, this card is really tuned to work with a block size of 64K or greater. The write speeds max out at  is 30MB/sec, but the read speed jumps dramatically to 90MB/sec once the block size hits 64K.

Rgds,
Dave.

The Shuttersnitch Proxy

Sunday, April 17th, 2011

What the heck is “The Shuttersnith Proxy?” I hear you ask! Well, Shuttersnitch is an excellent application for the iPad that allows you to view images as they are sent to it from a Wifi enabled camera. It listens for incoming images, then displays them on the iPad, allowing you to zoom in, tag & rate the images as they are received. This is ideal in a wireless environment where your camera can send images wirelessly to the iPad, such as the Canon 5D Mark II when used the an WFT-E4 wireless grip.

For those of us not lucky enough to have a €900  WFT-E4 there’s another option. Stick a laptop in the middle. I know this limits to using the camera tethered via USB cable rather than wireless, but it’s the next best thing.

Now comes the “Proxy” bit. I’ve hacked together a VBScript program that monitors a particular folder on the laptop for new jpg files, then opens a session to the iPad and sends on the file. It’s a kind of proxy, and since it’s main intention is for use with Shuttersnitch, I’ve called it “The Shuttersnitch Proxy”. :)

So, the full setup is:

  • Camera tethered to Latop via USB cable.
  • Canon EOS Utility running on laptop to take RAW and JPG files into a configured directory on laptop.
  • Shuttersnitch Proxy monitoring the directory into which the images are coming from the camera.
  • iPad running Shuttersnitch.

Oh, and I forgot to mention that there’s a wireless router providing wireless connectivity between the laptop and the iPad. (Must get me a battery powered one of these for more mobility).

So, when I click my camera shutter, the image is sent to the laptop via USB, and as soon as the script sees the JPG, it forwards it onto the FTP server on the iPad, and is displayed a second or two later. The script looks specifically for “.JPG” files, and ignores the “.CR2″ RAW files, which the iPad wouldn’t be able to display anyway, and would take too long to transfer via wireless

For anyone that’s interested, here’s the VBScript:

sPath = "\\localhost\C$\tmp\tmp"
sComputer = split(sPath,"\")(2)
sDrive = split(sPath,"\")(3)
sDrive = REPLACE(sDrive, "$", ":")
sFolders = split(sPath,"$")(1)
sFolders = REPLACE(sFolders, "\", "\\") & "\\"
Dim oShell, oExec, sLine
Const ForReading = 1, ForWriting = 2

Set oShell = CreateObject("WScript.Shell")

Set objWMIService = GetObject("winmgmts:\\" & sComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE " _
& "TargetInstance ISA 'CIM_DataFile' AND " _
& "TargetInstance.Drive='" & sDrive & "' AND " _
& "TargetInstance.Path='" & sFolders & "'")

Wscript.Echo vbCrlf & Now & vbTab & "Begin Monitoring for a Folder Change Event..." & vbCrlf

Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Select Case objLatestEvent.Path_.Class

Case "__InstanceCreationEvent"
if objLatestEvent.TargetInstance.Extension = "jpg" then
WScript.Echo Now & vbTab & objLatestEvent.TargetInstance.FileName & " was created" & vbCrlf
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(sPath & "\cmdfile.txt", ForWriting, True)
f.WriteLine "open 10.4.11.44 26000"
f.WriteLine "snitch"
f.WriteLine "password"
f.WriteLine "bin"
f.WriteLine "put """ & objLatestEvent.TargetInstance.FileName & ".jpg"""
f.WriteLine "bye"
f.close
Set oExec = oShell.Exec("ftp -s:cmdfile.txt")
end if

Case "__InstanceDeletionEvent"
WScript.Echo Now & vbTab & objLatestEvent.TargetInstance.FileName & " was deleted" & vbCrlf

Case "__InstanceModificationEvent"
If objLatestEvent.TargetInstance.LastModified <> objLatestEvent.PreviousInstance.LastModified then
WScript.Echo Now & vbTab & objLatestEvent.TargetInstance.FileName & " was modified" & vbCrlf
End If

IF objLatestEvent.TargetInstance.LastAccessed <> objLatestEvent.PreviousInstance.LastAccessed then
WScript.Echo Now & vbTab & objLatestEvent.TargetInstance.FileName & " was accessed" & vbCrlf
End If

End Select
Loop

 

 

 

 

Set objWMIService = nothing
Set colMonitoredEvents = nothing
Set objLatestEvent = nothing

So there you have it. “The Shuttersnitch Proxy”. Not coming to a movie theatre near you. :)

Shuttersnitch costs about €12 and is available in the Apple AppStore.

 

Enabling Infiniband on Ububtu 10.10

Thursday, February 17th, 2011

I do mention in my tagline that this blog may contain some information about computers, so you’ve been warned. The following article is quite technical, and may not be of interest to the photography contingent that might otherwise be interested in my blog articles. I posted this because I spent several days attempting a particular task, and managed to get it down to a few simple instructions. It may be useful for other attempting the same task.

I’ve recently set up an Infiniband fabric at home, and had a lot of trouble getting it working on Ubuntu. Windows 7 was a breeze, I just instlled the OFED drivers from openfbrics.org.
Here’s the steps to get it working on Ubuntu 10.10. It might not seem a lot, but there was a lot of messing to get it down to these few steps.

Install Ubuntu. Everything below is done as root – “sudo bash”.
Add a file to /etc/udev/rules.d called, say, 99-udev-umad.rules. This will cause the correct entries to be created in /sys, which otherwise do not get created for Ubuntu 10.10.
Insert the following (Make sure you check the cut-and-paste, some people find that the quotes get changed):

KERNEL==”umad*”, NAME=”infiniband/%k”, MODE=”0666″
KERNEL==”issm*”, NAME=”infiniband/%k”, MODE=”0666″
KERNEL==”uverbs*”, NAME=”infiniband/%k”, MODE=”0666″

Edit /etc/modules and add the following modules:

ib_sa
ib_cm
ib_umad
ib_addr
ib_uverbs
ib_ipoib
ib_ipath
ib_qib

Next, “apt-get install opensm”. This will install the subnet manager and all the relevant dependencies, libibverbs, etc.

Then add the relevant entries for the interface into /etc/network/interfaces file:

auto ib0
iface ib0 inet static
address 192.168.1.1
netmask 255.255.255.0

Then reboot. This will create the relevant infiniband entries in /sys, load the ipoib modules, and bring up the infiniband port with an ip address.

You should now have a functioning infiniband port on your Ubuntu machine.

However, there is still some more investigation to be done. Initially, when I was mixing custom kernels with OFED drivers, and stock linux kernel drivers, netperf was showing 7 gbps throughput. With the configurtation above, it’s down at about 25 mbps. Dreadfully slow. I’ll have to find out what optimisations are needed (or other drivers) in order to get the speed back up to 7 gbps.

–EDIT–

Note: iperf maxed out at 1.2 gbps, and on the current linux install, I couldnt get netperf client working at all. netserver would work, but only showed a throughput of 25mbps from a Win7 client. HOWEVER, when I set up the raid with 6 old 160G drives, the “hdparm -t /dev/md0p1″ showed 250MB/sec reads, and I got the same from the Win7 machine using samba across the infiniband fabric. This seems to indicate that iperf and netperf are completely unreliable for testing this type of connection. Bear in mind though that I did have netperf running on the previous ubuntu install, but that installation was so messy I don’t know what drivers and user-space software was running. I reckon it’s the kind of think that may be fixed in the stock Ubuntu install in the near future. For the moment, just go with real-world testing, i.e. copying large files from ramdisk to ramdisk, for example.