-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: can't get multipath to use multiple paths with ISCSI read loads #106
Comments
If you run your fio test directly on top of the multipath device, do you still see the IO all going to one device? |
That device config is insane. Defaults for this device ( multipath -t ) should works flawlessly:
If you wish, this two can stay in the defaults section:
|
open-iSCSI will by default not set up interface binding for the default tcp transport. Therefore the kernel sends the packets according to its routing table. If there are no dedicated routes for the different paths, it's well possible that the same local NIC is used all the time even though multipath is switching paths. See §5.1.1 of the open-iscsi README for information on how to set up interface binding. To view the path usage on the block device level, use a tool such as iostat. |
I've read §5.1.1 and §5.1.3. I've run the same tests but nothing I still get the same behaviour. Balancing to block devices is done correctly (because that is dealt by ZFS as I'm using a fileio backstore). |
you don't know unless you run iostat. zfs will balance over you block devices on top of multipath, but not over paths
I don't understand. You'll need to create two iSCSI interfaces, bound to your local NICs. |
Configs with sane values are included by default in multipath-tools at hwtable.c, and specifically for your device (LIO-ORG ) at: https://github.com/opensvc/multipath-tools/blob/master/libmultipath/hwtable.c#L1062-L1076 On the Internet there are plenty of wrong/old configs, even on the vendor's web/docs. Hints to monitor ethernet devices and block devices from the shell, both from sysstat package: |
Sorry I'm a total moron and didn't understand what you were saying to me. I've checked now with
I must confess that this is not that well clear to me. On my initiator I have only 1 NIC on my target I have 4 (one for each portal) so do I need to create an Iface for each portal ?
I've liked each interface with each portal (i.e. ifaceX to 192.168.0.20X) but I can still see the same issue, on read operations the network usage, target side, is not being balanced but only one interface is being used.
Good to know, a shame that this tool didn't get as much attention as it deserves to be fair (I'm talking as a homelabber).
I really like them TBH thanks again for the heads up! |
Sorry, I got this wrong. I thought you were measuring load distribution on the initiator.
This means that the problem is actually not multipath but either on the iSCSI layer or (more likely) on the networking layer. I see that the 4 IP addresses of your target are all on the same subnet.
"Read operations" means that the target chooses the interface on which it sends the data. So I think there's a misconfiguration on the target side. Your target IP addresses all appear to be in the same subnet. The target sends data to the IP address of your host, which is reachable through each interface. Unless you have configured the target to bind the different sockets to specific interfaces, it is free to use always the same interface. There are different ways to work around this. I'd actually suggest that instead of 4 separate interfaces with different IP addresses, you use bonding or teaming on the target to establish "multipathing" on the IP level. As long as there is only one initiator, you may still observe that the target uses just one interface. But as soon as there are multiple initiators, you should see balancing taking place. The behavior also depends on the bonding mode and other parameters. Another option would be to create VLANs on both the client and the target. On the target, you'd use a different VLAN ID for each NIC (say 10, 20, 30, 40), and use separate subnets for the different VLANs (say 192.168.10.0/24, 192.168.20.0/24, etc). On the client, you'd create all 4 VLANs on top of the client's single interface and add an IP address to each one.
Next you'd set up 4 iSCSI interfaces on the client for each of your VLAN interfaces. In this configuration, the target must send data to an IP address in the VLAN, which is only reachable via the "matching" network interface. This way you'd enforce balancing while reading. |
This is what I was thinking about too, however I can't really find anything in From my understanding of what you wrote the ideal setup would be to have literal tunnels for each interface both on the target and the initiator side. Is this because whenever my target sends a package to my initiator having all 4 interfaces on the same network means that i can choose whatever and there is no good reason to switch over ? could this be implemented in a similar fashion as you do with round-robin paths on the initiator side ?
Shouldn't in this case tho (assuming I knew how to do it) still be the same? I would need to have 4 IPs on my initiator too otherwise each NIC on my target cannot distinguish between path (i.e.
This was my first idea even before I looked deeper into multipath, however general consensus seems that MPIO is better than bonding or LACP (I don't really understand why tho) for ISCSI. Still, if you are suggesting it i will test it out as soon as my new managed switch arrives. |
That's what I meant with the VLAN setup. The word "tunnel" is maybe sort of misleading because it's often used for VPNs or encrypted connections, but yes, the idea is correct.
The initiator cannot control the routing choices the target makes, unless it doesn't leave the target anything to choose, like in the dedicated VLAN setup I layed out above. If the initiator has just one IP address, AFAICS, load balancing can't work, unless perhaps if you use bonding (not sure about that).
If the 4 IPs are all in the same subnet, you can't be sure that this will work as you expect. Actually I am unsure what your goal is. If there's just one interface, how could you expect a performance improvement from load balancing on the server side? At the end of the day, every packet needs to pass through that single interface on your client. That is of course also true with the VLAN setup that I proposed. But that VLAN setup would be suitable to simulate an environnment where true load balancing happens. In my experience, multiple interfaces with different IP addresses on the same subnet are almost always a bad idea.
I haven't experimented with bonding for some time. IIRC, with bonding, too, you need to be prepared for some surprises, unless you have a switch with proper 802.3ad support. Basically, bonding can control on which the target sends packets, but not on which it receives them. IOW, your read traffic may be balanced with bonding, but your write traffic may not be. The balance-alb mode provides some means to control RX traffic, but for a single client with just one IP address, it won't work.
If that switch has 802.3ad support, you may be in luck. However, I still fail to understand what your expectation is. The single interface on your client will be the bottleneck of your setup, regardless what you do on your server. |
Sorry for the huge delay I was hoping for the switches to show up in the meantime, but I don't want to leave you on read. The main goal behind all of this is to have 4Gbit bandwidth on my target (on 4 interfaces) such that my initiators that will use 2.5Gbit interfaces can actually benefit from them. You may think you can get the job done by adding a 2.5Gb nic to the target, but I don't want to occupy any PCIe slot as I will populate them with GPUs. The new switches will support 802.3ad so I hope I can get it to work with bonding!
Ironically this is what I would prefer balanced reads and unbalanced writes. I know that this has totally spiralled out of topic, but I'll keep you updated. |
Then maybe bonding is just right for you. If you want to proceed with multipath: What you said earlier is of course true, block-based multipath has some advantages over network-based load balancing. Your initial approach was just too simplistic. With iSCSI / TCP and multipath, you need to take extra measures to make sure that each block-level path uniquely maps to a network path. By default, this is not the case, in particular not if all interfaces are on the same subnet. There are different ways to achieve this mapping from block level to network paths, the VLAN suggestion above is one of them. |
Hi, first of all thanks for making this project.
I'm a total noob when it comes to ISCSI, but it's 2 weeks that I'm struggling with setting up MPIO and I cant really find a lot online.
Let's start by saying that I have 4 portals on my target (one for each physical NIC) each with 1Gbit of bandwidth. On my initiator instead I run 1 NIC with 1Gbit of bandwidth. I wanted to balance the load on the target's 4 interfaces (as link aggregation does).
So I've set up a dataset on my ZFS box with 2 fileio backstores and I'm running targetcli with this configuration:
Now I installed multipath-tools on my machine and attached all the portals:
I've also setup multipath and I can see all the 4 paths:
for sake of completeness this is my
/etc/multipath.conf
:Now, tests are performed using:
sudo fio --filename=iscsiLib/test --direct=1 --rw=randwrite --bs=1m --size=1G --numjobs=10 --group_reporting --name=file1
The strange thing is that when running random reads I get 980Mbps only on one NIC (and always the same one).
Instead, when I perform random writes I get the expected behaviour i.e. 250Mbps from each NIC.
I don't really understand why it's doing this, I want to balance the load as I bought 2.5Gbit network equipment and I want to use MPIO to squeeze out all the bandwidth possible.
Is it a misconfiguration ? or a conceptual error on my side?
Many thanks for the time!
The text was updated successfully, but these errors were encountered: