# Very slow SCSI performance

## KK_r

My SCSI drive is extremly slow (writing and reading, especially reading)

The SCSI disc even locks my system (which is on my disc) when much writing is performed

In windows both the ATA and the SCSI speed is about 20 Mb/s

the disc is a Quantum Atlas V and the controller is a Tekram 390U2B

hdparm:

```
hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   1624 MB in  2.00 seconds = 810.50 MB/sec

 Timing buffered disk reads:  128 MB in  3.03 seconds =  42.28 MB/sec

hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   1640 MB in  2.00 seconds = 818.49 MB/sec

 Timing buffered disk reads:   74 MB in  3.07 seconds =  24.12 MB/sec

hdparm /dev/sda

/dev/sda:

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 17510/64/32, sectors = 35861388, start = 0
```

lsscsi:

```
 lsscsi --long

[0:0:0:0]    disk    QUANTUM  ATLAS_V_18_WLS   0200  /dev/sda

  state=running queue_depth=32 scsi_level=4 type=0 device_blocked=0 timeout=30

[0:0:1:0]    disk    QUANTUM  ATLAS_V_18_WLS   0200  /dev/sdb

  state=running queue_depth=32 scsi_level=4 type=0 device_blocked=0 timeout=30

lsscsi --hosts --long

[0]    sym53c8xx   

  cmd_per_lun=64   host_busy=0    sg_tablesize=96   unchecked_isa_dma=0  
```

dmesg (One thing that bothers me is that it says asynchronous):

```
sym0: <895> rev 0x1 at pci 0000:02:04.0 irq 19

sym0: Tekram NVRAM, ID 7, Fast-40, LVD, parity checking

sym0: SCSI BUS has been reset.

scsi0 : sym-2.2.0

  Vendor: QUANTUM   Model: ATLAS_V_18_WLS    Rev: 0200

  Type:   Direct-Access                      ANSI SCSI revision: 03

 target0:0:0: tagged command queuing enabled, command queue depth 32.

 target0:0:0: Beginning Domain Validation

 target0:0:0: asynchronous.

WIDTH IS 1

 target0:0:0: wide asynchronous.

 target0:0:0: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 31)

 target0:0:0: Ending Domain Validation

  Vendor: QUANTUM   Model: ATLAS_V_18_WLS    Rev: 0200

  Type:   Direct-Access                      ANSI SCSI revision: 03

 target0:0:1: tagged command queuing enabled, command queue depth 32.

 target0:0:1: Beginning Domain Validation

 target0:0:1: asynchronous.

WIDTH IS 1

 target0:0:1: wide asynchronous.

 target0:0:1: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 31)

 target0:0:1: Ending Domain Validation

SCSI device sda: 35861388 512-byte hdwr sectors (18361 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 35861388 512-byte hdwr sectors (18361 MB)

SCSI device sda: drive cache: write back

 sda: sda1

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

SCSI device sdb: 35861388 512-byte hdwr sectors (18361 MB)

SCSI device sdb: drive cache: write back

SCSI device sdb: 35861388 512-byte hdwr sectors (18361 MB)

SCSI device sdb: drive cache: write back

 sdb: sdb1

Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0
```

kernel config:

```
#

# SCSI device support

#

CONFIG_SCSI=y

CONFIG_SCSI_PROC_FS=y

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

# CONFIG_CHR_DEV_ST is not set

# CONFIG_CHR_DEV_OSST is not set

# CONFIG_BLK_DEV_SR is not set

CONFIG_CHR_DEV_SG=y

#

# Some SCSI devices (e.g. CD jukebox) support multiple LUNs

#

# CONFIG_SCSI_MULTI_LUN is not set

# CONFIG_SCSI_CONSTANTS is not set

# CONFIG_SCSI_LOGGING is not set

#

# SCSI Transport Attributes

#

CONFIG_SCSI_SPI_ATTRS=y

# CONFIG_SCSI_FC_ATTRS is not set

# CONFIG_SCSI_ISCSI_ATTRS is not set

#

# SCSI low-level drivers

#

# CONFIG_BLK_DEV_3W_XXXX_RAID is not set

# CONFIG_SCSI_3W_9XXX is not set

# CONFIG_SCSI_ACARD is not set

# CONFIG_SCSI_AACRAID is not set

# CONFIG_SCSI_AIC7XXX is not set

# CONFIG_SCSI_AIC7XXX_OLD is not set

# CONFIG_SCSI_AIC79XX is not set

# CONFIG_SCSI_DPT_I2O is not set

# CONFIG_MEGARAID_NEWGEN is not set

# CONFIG_MEGARAID_LEGACY is not set

# CONFIG_SCSI_SATA is not set

# CONFIG_SCSI_BUSLOGIC is not set

# CONFIG_SCSI_DMX3191D is not set

# CONFIG_SCSI_EATA is not set

# CONFIG_SCSI_FUTURE_DOMAIN is not set

# CONFIG_SCSI_GDTH is not set

# CONFIG_SCSI_IPS is not set

# CONFIG_SCSI_INITIO is not set

# CONFIG_SCSI_INIA100 is not set

# CONFIG_SCSI_PPA is not set

# CONFIG_SCSI_IMM is not set

CONFIG_SCSI_SYM53C8XX_2=y

CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1

CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=32

CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64

# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set

# CONFIG_SCSI_IPR is not set

# CONFIG_SCSI_QLOGIC_FC is not set

# CONFIG_SCSI_QLOGIC_1280 is not set

CONFIG_SCSI_QLA2XXX=y

# CONFIG_SCSI_QLA21XX is not set

# CONFIG_SCSI_QLA22XX is not set

# CONFIG_SCSI_QLA2300 is not set

# CONFIG_SCSI_QLA2322 is not set

# CONFIG_SCSI_QLA6312 is not set

# CONFIG_SCSI_LPFC is not set

# CONFIG_SCSI_DC395x is not set

# CONFIG_SCSI_DC390T is not set

# CONFIG_SCSI_NSP32 is not set

# CONFIG_SCSI_DEBUG is not set

```

----------

## R!tman

 *KK_r wrote:*   

> hdparm:
> 
> ```
> hdparm -tT /dev/hda
> 
> ...

 

Doesn't that mean your drive also achieves the >20MB/s in Linux too?

----------

## KK_r

yes, but only reading. Writing is below 5 Mb/s (tested with time cp <file> <destination>). And the transfer rate should be 80 Mb/s

----------

## hw-tph

 *KK_r wrote:*   

> yes, but only reading. Writing is below 5 Mb/s (tested with time cp <file> <destination>). And the transfer rate should be 80 Mb/s

 

The 80MB/s indicates that maximum transfer rate for your SCSI bus. No disk that I have ever used can saturate 80MB/s on its own (the best I have ever seen is about 60MB/s and that's a brand new SATA disk), but in RAID configurations you can achieve that.

I haven't used SCSI systems much but look into the configuration options for your SCSI driver module, there might be some parameters you can pass to the kernel at boot (or when you load the module if you have it configured that way).

Håkan

----------

## KK_r

well, I don't really know what parameters I should try...I wasn't really expecting 80 Mb/s but at least 50 Mb/s. The biggest problem is that it seems to write (at least big files) in a rate below 5 Mb/s and doesn't allow much reading from the disc in the same time.

----------

## hw-tph

Using the documentation is probably a good start, although it may be a tad too technical at times: /usr/src/linux/Documentation/scsi/sym53c8xx_2.txt.

Håkan

----------

## KK_r

the only thing that I thought looked interesting was to set the sync but that didn't work at all.

I found some spec. on the disc. It says it can handle 160 Mb/s with Ultra160 and 80 Mb/s with Ultra2 which is of course the maximum of the protocols (no, I can't be 100% sure they're right)

My card is supporting Ultra2 with 80 Mb/s as maximum transfer rate and has an internal 68 pin LVD connector.

Now I figured out that I don't really have the right cable, that might be the source of this problem?

However I'm gonna buy me a nice LVD cable and a terminator and see.

http://www.hothardware.com/viewarticle.cfm?articleid=28

http://www.tekram.com/ProductSpec.ASP?Product=DC-390U2_Series

----------

## s0be

```

bigiron ~ # hdparm -tT /dev/{sd[a-e],md[0-3]}

/dev/sda:

 Timing cached reads:   2148 MB in  2.00 seconds = 1074.16 MB/sec

 Timing buffered disk reads:   18 MB in  3.27 seconds =   5.51 MB/sec

/dev/sdb:

 Timing cached reads:   2148 MB in  2.00 seconds = 1073.09 MB/sec

 Timing buffered disk reads:    4 MB in  3.90 seconds =   1.03 MB/sec

/dev/sdc:

 Timing cached reads:   2148 MB in  2.00 seconds = 1072.02 MB/sec

 Timing buffered disk reads:   24 MB in  3.11 seconds =   7.71 MB/sec

/dev/sdd:

 Timing cached reads:   2144 MB in  2.00 seconds = 1071.09 MB/sec

 Timing buffered disk reads:   24 MB in  3.03 seconds =   7.92 MB/sec

/dev/sde:

 Timing cached reads:   2148 MB in  2.00 seconds = 1072.55 MB/sec

 Timing buffered disk reads:   76 MB in  3.00 seconds =  25.30 MB/sec

/dev/md0:

 Timing cached reads:   2156 MB in  2.00 seconds = 1077.63 MB/sec

 Timing buffered disk reads:   24 MB in  3.01 seconds =   7.96 MB/sec

/dev/md1:

 Timing cached reads:   2160 MB in  2.00 seconds = 1079.08 MB/sec

 Timing buffered disk reads:   24 MB in  3.19 seconds =   7.53 MB/sec

/dev/md2:

 Timing cached reads:   2144 MB in  2.00 seconds = 1071.09 MB/sec

 Timing buffered disk reads:   24 MB in  3.19 seconds =   7.53 MB/sec

/dev/md3:

 Timing cached reads:   2148 MB in  2.00 seconds = 1072.55 MB/sec

 Timing buffered disk reads:   22 MB in  3.17 seconds =   6.93 MB/sec

```

```

Personalities : [raid1]

md1 : active raid1 sdd2[1] sdc2[0]

      977856 blocks [2/2] [UU]

md2 : active raid1 sdd3[1] sdc3[0]

      3907520 blocks [2/2] [UU]

md3 : active raid1 sdd4[1] sdc4[0]

      9478080 blocks [2/2] [UU]

md0 : active raid1 sdd1[1] sdc1[0]

      2930560 blocks [2/2] [UU]

```

```

bigiron ~ # lspci | grep storage

0000:02:08.0 Unknown mass storage controller: American Megatrends Inc. MegaRAID 428 Ultra RAID Controller (rev 03)

0000:02:09.0 SCSI storage controller: Adaptec AHA-2940U/UW/D / AIC-7881U (rev 01)

0000:02:0d.0 Unknown mass storage controller: Silicon Image, Inc. SiI 3512 [SATALink/SATARaid] Serial ATA Controller (rev 01)

0000:03:04.0 SCSI storage controller: Adaptec AHA-3940U/UW/UWD / AIC-7882U

0000:03:05.0 SCSI storage controller: Adaptec AHA-3940U/UW/UWD / AIC-7882U

```

sda is /home and /boot, and, as there are no local users, /home doesn't need to be mirrored, and I always keep a bootable cd ready in the case that /boot dies.  It's an old seagate hard drive.

sdb is an iomega scsi zip (100meg)

these are on the adaptec aha-2940uw

sdc/sdd are a pair of IBM full height DXHS18Y discs.  They mirror (as shown from my /proc/mdstat) to become /var , /tmp , /usr.

these are each on their own channel on the adaptec aha-3940uw

sde is a hardware raid 5 on the American Megatrends 428.  It consists of 5 drives, 4 forming a 27gig raid 5 with a hot spare.  They're 9gig segate cheetahs.  This drive is constantly serving media to my lan.  

If there is anything else I can provide you with that might help you out, let me know.

----------

## neo86

Atlas V is a pretty old drive I think. What you'res seeing seems pretty normal. If you go here , pull down the menu and click on "WB Disk/Read Transfer Rate - Being" and then scroll all the way to the bottom of the list you'll see your drive listed with a begin read rate of 29 MB/s.

edit: Any anomalies you might be seeing such as the "5 MB/s" are probably because something is writing to the drive at the time I'm guessing. However, your read performance is normal.

----------

## KK_r

That kind of sucks, better start thinking of getting my system back to ATA...

----------

