In the past we have covered performance tweaks for the Initiator side, Linux OS tweaks, and networking speed tweaks; we have not covered the Target side though, and that is what we will do now. So read on for the details on how to optimize the IET.conf file to optimal performance.
First sign in to your iSCSI target server; while we recommend using CentOS 5 x64, just about any distribution should work though. Open up your favorite conf file editing program and point it at the /etc/ietd.conf file. (Or just type 'vi /etc/ietd.conf')
Under the target that you have already specified add the follwoing:
MaxRecvDataSegmentLength 262144
MaxXmitDataSegmentLength 262144
MaxOutstandingR2T 8
Wthreads 8
ImmediateData Yes
InitialR2T No
That is nice and all... but what does it REALLY do? Well lets find out.
MaxRecvDataSegmentLength - Sets the maximum data segment length that can be received. This value should be set to multiples of PAGE_SIZE. Currently the maximum supported value is 64 * PAGE_SIZE, e.g. 262144 if PAGE_SIZE is 4kB.
Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host.
MaxXmitDataSegmentLength - Sets the maximum data segment length that can be sent. This value actually used is the minimum of MaxXmitDataSegmentLength and the MaxRecvDataSegmentLength announced by the initiator. It should be set to multiples of PAGE_SIZE. Currently the maximum supported value is 64 * PAGE_SIZE, e.g. 262144 if PAGE_SIZE is 4kB. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host.
MaxOutstandingR2T - Controls the maximum number of data transfers the target may request at once, each of up to MaxBurstLength bytes.
Wthreads - The iSCSI target employs several threads to perform the actual block I/O to the device. Depending on your hardware and your (expected) workload, the number of these threads may be carefully adjusted. The default value of 8 should be sufficient for most purposes.
InitialR2T - the initiator has to wait for the target to solicit SCSI data before sending it. Setting it to "No"
allows the initiator to send a burst of FirstBurstLength bytes unsolicited right after and/or (depending on the setting of ImmediateData together with the command. Thus setting it to "No" may improve performance.
ImmediateData
Now you just need to restart the iSCSI service on the Linux server, " /etc/init.d/iscsi-target restart ". Enjoy the new performance!