ISCSI TGT

Данный вариант не работает с кластером Hyper-V / Windows Server
Тут минимальная настройка, подходит для тестирования, не нужно это применять в реальных проектах.

Настраиваем таргет

Установка Ubuntu/Debian

aptitude install tgt

Установка CentOS/Red Hat /Oracle Linux:

yum install scsi-target-utils

Установка OpenSuse

zypper install tgt

И редактируем файл /etc/tgt/targets.conf

include /etc/tgt/conf.d/*.conf

<target iqn.2012-04.local.dim:tgt>
 backing-store /dev/sda
</target>

Хотя лучше создать файлик iqn.2012-04.local.dim.conf , в каталоге /etc/tgt/conf.d/:

<target iqn.2012-04.local.dim:tgt>
 backing-store /dev/sda
</target>

Он автоматически подключится благодоря строке include /etc/tgt/conf.d/*.conf в файле /etc/tgt/targets.conf, это нужно чтобы при обновлении/переустоновке программы конфиг не затерся.

Рестартуем:

Ubuntu/Debian

/etc/init.d/tgt restart

CentOS/Red Hat /Oracle Linux/OpenSuse

/etc/init.d/tgtd restart

Автозапуск в Ubuntu/Debian ключится автоматически,
в CentOS/Red Hat /Oracle Linux/OpenSuse включаем стандартно:

chkconfig tgtd on

Настройка закончена.

***********************************************************************************
***********************************************************************************

Тесты скорости винта с файловой системой XFS внутри раздающиго компьютера

Запись:
dd if=/dev/zero of=/var/tst/test bs=512K count=5000
2621440000 bytes (2,6 GB) copied, 15,2617 s, 172 MB/s
dd if=/dev/zero of=/var/tst/test bs=512K count=10000
5242880000 bytes (5,2 GB) copied, 37,1689 s, 141 MB/s
dd if=/dev/zero of=/var/tst/test bs=512K count=20000
10485760000 bytes (10 GB) copied, 77,2739 s, 136 MB/s
write: (g=0): rw=write, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
fio 1.59
Starting 1 process
write: Laying out IO file(s) (1 file(s) / 10240MB)
Jobs: 1 (f=1): [W] [100.0% done] [0K/128.9M /s] [0 /32.3K iops] [eta 00m:00s]
write: (groupid=0, jobs=1): err= 0: pid=1139
  write: io=10240MB, bw=134510KB/s, iops=33627 , runt= 77955msec
    clat (usec): min=1 , max=15204 , avg=29.04, stdev=519.11
     lat (usec): min=1 , max=15204 , avg=29.15, stdev=519.11
    bw (KB/s) : min=117120, max=1184439, per=100.02%, avg=134537.78, stdev=85233.52
  cpu          : usr=3.51%, sys=8.61%, ctx=6821, majf=1, minf=24
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued r/w/d: total=0/2621440/0, short=0/0/0
     lat (usec): 2=6.94%, 4=78.71%, 10=13.89%, 20=0.18%, 50=0.01%
     lat (usec): 100=0.01%, 250=0.01%
     lat (msec): 4=0.01%, 10=0.04%, 20=0.22%

Run status group 0 (all jobs):
  WRITE: io=10240MB, aggrb=134510KB/s, minb=137738KB/s, maxb=137738KB/s, mint=77955msec, maxt=77955msec

Disk stats (read/write):
  sda: ios=0/19511, merge=0/3, ticks=0/11096276, in_queue=11134484, util=99.67%

Чтение:

read: (g=0): rw=read, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
fio 1.59
Starting 1 process
read: Laying out IO file(s) (1 file(s) / 5120MB)
Jobs: 1 (f=1): [R] [100.0% done] [121.9M/0K /s] [30.5K/0  iops] [eta 00m:00s]
read: (groupid=0, jobs=1): err= 0: pid=1315
  read : io=5120.0MB, bw=123770KB/s, iops=30942 , runt= 42360msec
    clat (usec): min=0 , max=46311 , avg=31.99, stdev=267.04
     lat (usec): min=0 , max=46311 , avg=32.04, stdev=267.04
    bw (KB/s) : min=103400, max=137216, per=100.02%, avg=123790.17, stdev=8581.11
  cpu          : usr=2.16%, sys=5.95%, ctx=20958, majf=1, minf=25
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued r/w/d: total=1310720/0/0, short=0/0/0
     lat (usec): 2=98.07%, 4=0.35%, 10=0.01%, 20=0.01%, 50=0.01%
     lat (usec): 100=0.01%, 250=0.01%, 500=0.01%, 1000=0.01%
     lat (msec): 2=1.23%, 4=0.33%, 10=0.01%, 20=0.01%, 50=0.01%

Run status group 0 (all jobs):
   READ: io=5120.0MB, aggrb=123769KB/s, minb=126740KB/s, maxb=126740KB/s, mint=42360msec, maxt=42360msec

Disk stats (read/write):
  sda: ios=20355/5, merge=6/0, ticks=80376/24364, in_queue=104720, util=99.82%

Скорость на принмающей стороне

dd if=/dev/zero of=/var/data/test bs=512K count=5000
2621440000 bytes (2,6 GB) copied, 17,5303 s, 150 MB/s
dd if=/dev/zero of=/var/data/test bs=512K count=10000
5242880000 bytes (5,2 GB) copied, 51,0667 s, 103 MB/s
dd if=/dev/zero of=/var/data/test bs=512K count=20000
10485760000 bytes (10 GB) copied, 118,559 s, 88,4 MB/s
write: (g=0): rw=write, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
fio 1.59
Starting 1 process
write: Laying out IO file(s) (1 file(s) / 10240MB)
Jobs: 1 (f=1): [W] [100.0% done] [0K/88915K /s] [0 /21.8K iops] [eta 00m:00s]
write: (groupid=0, jobs=1): err= 0: pid=2554
  write: io=10240MB, bw=85194KB/s, iops=21298 , runt=123081msec
    clat (usec): min=1 , max=55049 , avg=46.34, stdev=498.87
     lat (usec): min=1 , max=55049 , avg=46.43, stdev=498.88
    bw (KB/s) : min= 7944, max=1810288, per=100.12%, avg=85299.31, stdev=134873.55
  cpu          : usr=1.74%, sys=5.04%, ctx=27673, majf=1, minf=24
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued r/w/d: total=0/2621440/0, short=0/0/0
     lat (usec): 2=20.15%, 4=67.22%, 10=10.15%, 20=1.35%, 50=0.10%
     lat (usec): 100=0.01%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
     lat (msec): 2=0.01%, 4=1.00%, 10=0.01%, 20=0.02%, 50=0.01%
     lat (msec): 100=0.01%

Run status group 0 (all jobs):
  WRITE: io=10240MB, aggrb=85193KB/s, minb=87238KB/s, maxb=87238KB/s, mint=123081msec, maxt=123081msec

Disk stats (read/write):
  sdc: ios=0/18356, merge=0/4, ticks=0/17625860, in_queue=17692944, util=99.63%

Bonding

auto eth0
  iface eth0 inet manual
  bond-master bond0
auto eth1
  iface eth1 inet manual
  bond-master bond0
auto bond0
  iface bond0 inet static
  address 10.10.10.6
  netmask 255.255.255.0
  bond-mode 0
  bond-miimon 100
  bond-slaves none
  mtu 7000

Запись:

write: (g=0): rw=write, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
fio 1.59
Starting 1 process
write: Laying out IO file(s) (1 file(s) / 10240MB)
Jobs: 1 (f=1): [W] [100.0% done] [0K/133.8M /s] [0 /33.5K iops] [eta 00m:00s]
write: (groupid=0, jobs=1): err= 0: pid=2681
  write: io=10240MB, bw=144697KB/s, iops=36174 , runt= 72467msec
    clat (usec): min=1 , max=55303 , avg=27.12, stdev=370.90
     lat (usec): min=1 , max=55303 , avg=27.20, stdev=370.90
    bw (KB/s) : min= 7984, max=1907904, per=100.09%, avg=144832.53, stdev=185547                 .78
  cpu          : usr=2.69%, sys=7.23%, ctx=16139, majf=1, minf=24
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued r/w/d: total=0/2621440/0, short=0/0/0
     lat (usec): 2=27.39%, 4=65.79%, 10=5.43%, 20=0.70%, 50=0.10%
     lat (usec): 100=0.01%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
     lat (msec): 2=0.01%, 4=0.56%, 10=0.01%, 20=0.01%, 50=0.01%
     lat (msec): 100=0.01%

Run status group 0 (all jobs):
  WRITE: io=10240MB, aggrb=144697KB/s, minb=148169KB/s, maxb=148169KB/s, mint=72                 467msec, maxt=72467msec

Disk stats (read/write):
  sdc: ios=0/18405, merge=0/0, ticks=0/10262084, in_queue=10406340, util=99.36%

dd if=/dev/zero of=/var/data/test bs=512K count=20000
10485760000 bytes (10 GB) copied, 68,8445 s, 152 MB/s

Чтение:

read: (g=0): rw=read, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
fio 1.59
Starting 1 process
read: Laying out IO file(s) (1 file(s) / 5120MB)
Jobs: 1 (f=1): [R] [100.0% done] [121.7M/0K /s] [30.4K/0  iops] [eta 00m:00s]
read: (groupid=0, jobs=1): err= 0: pid=2705
  read : io=5120.0MB, bw=123656KB/s, iops=30913 , runt= 42399msec
    clat (usec): min=0 , max=35190 , avg=31.84, stdev=263.50
     lat (usec): min=0 , max=35190 , avg=31.92, stdev=263.50
    bw (KB/s) : min=106259, max=137376, per=100.00%, avg=123655.73, stdev=8669.93
  cpu          : usr=1.74%, sys=6.35%, ctx=21231, majf=1, minf=25
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued r/w/d: total=1310720/0/0, short=0/0/0
     lat (usec): 2=96.11%, 4=1.25%, 10=0.20%, 20=0.74%, 50=0.13%
     lat (usec): 100=0.01%, 250=0.01%, 500=0.01%, 1000=0.01%
     lat (msec): 2=1.07%, 4=0.48%, 10=0.01%, 20=0.01%, 50=0.01%

Run status group 0 (all jobs):
   READ: io=5120.0MB, aggrb=123655KB/s, minb=126623KB/s, maxb=126623KB/s, mint=42399msec, maxt=42399msec

Disk stats (read/write):
  sdc: ios=20437/3, merge=1/0, ticks=80588/6320, in_queue=86884, util=99.83%

dd of=/dev/zero if=/var/data/test bs=512K count=20000
10485760000 bytes (10 GB) copied, 65,2742 s, 161 MB/s

multipath-tools

Конфиг для примера такой:

defaults
{
      path_selector       "round-robin 0"
      path_grouping_policy multibus
      rr_min_io           200
      no_path_retry       5
   failback            immediate
   user_friendly_names yes
}
blacklist
{
            devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
            devnode "^hd[a-z][[0-9]*]"
            devnode "^sda$"
            devnode "^sdb$"

}

multipaths
{
   multipath
   {
      wwid 1IET_00010001
   }
}

Запись:

dd if=/dev/zero of=/var/data/test bs=512K count=5000
2621440000 bytes (2,6 GB) copied, 8,88133 s, 295 MB/s
dd if=/dev/zero of=/var/data/test bs=512K count=10000
5242880000 bytes (5,2 GB) copied, 27,2995 s, 192 MB/s
dd if=/dev/zero of=/var/data/test bs=512K count=20000
10485760000 bytes (10 GB) copied, 67,5151 s, 155 MB/s
write: (g=0): rw=write, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
fio 1.59
Starting 1 process
write: Laying out IO file(s) (1 file(s) / 10240MB)
Jobs: 1 (f=1): [W] [100.0% done] [0K/136.9M /s] [0 /34.2K iops] [eta 00m:00s]
write: (groupid=0, jobs=1): err= 0: pid=3088
  write: io=10240MB, bw=144821KB/s, iops=36205 , runt= 72405msec
    clat (usec): min=1 , max=74088 , avg=27.08, stdev=428.44
     lat (usec): min=1 , max=74089 , avg=27.16, stdev=428.44
    bw (KB/s) : min= 7944, max=1844032, per=100.15%, avg=145032.47, stdev=184809.11
  cpu          : usr=2.87%, sys=7.36%, ctx=14213, majf=1, minf=24
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued r/w/d: total=0/2621440/0, short=0/0/0
     lat (usec): 2=24.58%, 4=67.45%, 10=6.57%, 20=0.80%, 50=0.08%
     lat (usec): 100=0.01%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
     lat (msec): 2=0.01%, 4=0.47%, 10=0.01%, 20=0.02%, 50=0.01%
     lat (msec): 100=0.01%

Run status group 0 (all jobs):
  WRITE: io=10240MB, aggrb=144820KB/s, minb=148296KB/s, maxb=148296KB/s, mint=72405msec, maxt=72405msec

Disk stats (read/write):
  dm-0: ios=0/18294, merge=0/0, ticks=0/10235156, in_queue=10329464, util=99.35%, aggrios=4/9175, aggrmerge=0/0, aggrticks=1108/4042520, aggrin_queue=4082784, aggrutil=99.35%
    sdc: ios=4/9211, merge=0/0, ticks=1464/4974476, in_queue=5027484, util=99.35%
    sdd: ios=4/9140, merge=0/0, ticks=752/3110564, in_queue=3138084, util=93.57%

Чтение:

dd of=/dev/zero if=/var/data/test bs=512K count=20000
10485760000 bytes (10 GB) copied, 78,3925 s, 134 MB/s
read: (g=0): rw=read, bs=4K-4K/4K-4K, ioengine=sync, iodepth=1
fio 1.59
Starting 1 process
read: Laying out IO file(s) (1 file(s) / 5120MB)
Jobs: 1 (f=1): [R] [100.0% done] [104.5M/0K /s] [26.2K/0  iops] [eta 00m:00s]
read: (groupid=0, jobs=1): err= 0: pid=2124
  read : io=5120.0MB, bw=102949KB/s, iops=25737 , runt= 50927msec
    clat (usec): min=0 , max=27491 , avg=38.39, stdev=303.73
     lat (usec): min=0 , max=27491 , avg=38.46, stdev=303.73
    bw (KB/s) : min=91792, max=115992, per=99.99%, avg=102938.66, stdev=6958.22
  cpu          : usr=1.58%, sys=5.24%, ctx=21170, majf=0, minf=26
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued r/w/d: total=1310720/0/0, short=0/0/0
     lat (usec): 2=96.62%, 4=1.21%, 10=0.02%, 20=0.57%, 50=0.01%
     lat (usec): 100=0.01%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
     lat (msec): 2=0.32%, 4=1.24%, 10=0.01%, 20=0.01%, 50=0.01%

Run status group 0 (all jobs):
   READ: io=5120.0MB, aggrb=102948KB/s, minb=105419KB/s, maxb=105419KB/s, mint=50927msec, maxt=50927msec

Disk stats (read/write):
  dm-0: ios=20483/1, merge=0/0, ticks=98040/28, in_queue=140836, util=99.90%, aggrios=10245/2, aggrmerge=0/0, aggrticks=49006/14, aggrin_queue=49020, aggrutil=56.02%
    sdc: ios=10200/3, merge=0/0, ticks=54828/28, in_queue=54856, util=56.02%
    sdd: ios=10290/2, merge=0/0, ticks=43184/0, in_queue=43184, util=44.29%

Запись опубликована в рубрике ISCSI. Добавьте в закладки постоянную ссылку.