extrem langsames Schreiben mit 4k Disks

apairon

New Member
GELÖST: extrem langsames Schreiben mit 4k Disks

Hallo,

ich habe neue Server mit folgender Konfiguration aufgesetzt:
- Hardware: Hetzner EX4S (32G RAM, 2x 3TB Platten, Core i7 2600)
- Software: Ubuntu 12.04 LTS

Das Problem ist, dass die Schreibgeschwindigkeit beim Schreiben kleiner Blöcke extrem langsam ist.

Ich erhalte folgende Werte:

mit ext4 barrier=1
Code:
# dd if=/dev/zero of=test bs=1024 count=100 oflag=direct
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 1.77619 s, 57.7 kB/s

# dd if=/dev/zero of=test bs=1024 count=100 oflag=direct,sync
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 5.97551 s, 17.1 kB/s

mit ext4 barrier=0
Code:
# dd if=/dev/zero of=test bs=1024 count=100 oflag=direct
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 2.85351 s, 35.9 kB/s

# dd if=/dev/zero of=test bs=1024 count=100 oflag=direct,sync
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 4.22029 s, 24.3 kB/s

Zum Vergleich sind hier noch Werte meines alten Debian Lenny (FS: ext3) auf nem Hetzner EQ9 Server:
Code:
# dd if=/dev/zero of=test bs=1024 count=100 oflag=direct,sync
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.271635 s, 377 kB/s

Zufälligerweise habe ich noch ein fast identisches lokales System (Ubuntu 12.04 LTS auf Core i7 2600, 16GB RAM, 2x 1TB Platten). Dazu folgende Werte:

mit ext4 barrier=1
Code:
# dd if=/dev/zero of=test bs=1024 count=100 oflag=direct,sync
100+0 Datensätze ein
100+0 Datensätze aus
102400 Bytes (102 kB) kopiert, 4,49577 s, 22,8 kB/s

mit ext4 barrier=0
Code:
# dd if=/dev/zero of=test bs=1024 count=100 oflag=direct,sync
100+0 Datensätze ein
100+0 Datensätze aus
102400 Bytes (102 kB) kopiert, 0,0933634 s, 1,1 MB/s

Alle System haben das getestete Dateisystem auf einem Software Raid1. Die Partitionen des Problemsystems sind auch korrekt aligned (denke ich, oder?):

Code:
# gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): FA583146-F427-4E70-BF31-3F493A724723
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            4096        16781311   8.0 GiB     FD00  
   2        16781312        18878463   1024.0 MiB  FD00  
   3        18878464        39849983   10.0 GiB    FD00  
   4            2048            4095   1024.0 KiB  EF02  
   5        39849984      5860533134   2.7 TiB     FD00  Linux RAID

Die einzigen markanten Unterschiede der fast identischen System sind die eingesetzten Platten und die Verwendung einer GPT Partitionstabelle auf den 3 TB Platten.

Die Platten im Problemsystem sind: ST3000DM001-9YN166
Platten im lokalen System: WDC WD10EARS-22Y5B1

Beide Plattentypen sind 4k Platten. Es kann also, denke ich, auch nicht an einer eventuellen Fehlbehandlung der großen Sektorgröße von Ubuntu, bzw. dem Kernel liegen.

NCQ habe ich im neuen System probeweise auch mal deaktiviert, was aber keinen Unterschied brachte.

Jetzt meine verzweifelte Frage. Warum sind die neuen 3TB Platten mit 7200rpm soviel langsamer als die Green Platten mir 5400rpm meines lokalen Systems, obwohl OS und Raid-Konfiguration identisch sind? Sind diese Platten wirklich so schlecht für kleine Blöcke oder habe ich was übersehen?

Hier noch ein SMART Report, falls er etwas hilft:
Code:
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-26-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     ST3000DM001-9YN166
Serial Number:    S1F07PG4
LU WWN Device Id: 5 000c50 04a46f825
Firmware Version: CC4C
User Capacity:    3,000,592,982,016 bytes [3.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Thu Jul  5 00:51:55 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever 
                                        been run.
Total time to complete Offline 
data collection:                (  575) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine 
recommended polling time:        (   1) minutes.
Extended self-test routine
recommended polling time:        ( 255) minutes.
Conveyance self-test routine
recommended polling time:        (   2) minutes.
SCT capabilities:              (0x3085) SCT Status supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   117   100   006    Pre-fail  Always       -       141363176
  3 Spin_Up_Time            0x0003   096   096   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       5
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   072   060   030    Pre-fail  Always       -       14840855
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       734
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       5
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   063   058   045    Old_age   Always       -       37 (Min/Max 27/42)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       3
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       35
194 Temperature_Celsius     0x0022   037   042   000    Old_age   Always       -       37 (0 25 0 0)
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       107653355274967
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       58409315312188
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       48906194537199

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Keine Ahnung, welche Infos noch hilfreich wären. Zum Vergleich noch ein paar Tests mit größeren Blöcken:
Code:
# dd if=/dev/zero of=test bs=1M count=100 oflag=direct,sync
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 6.13677 s, 17.1 MB/s

# dd if=/dev/zero of=test bs=10M count=10 oflag=direct,sync
10+0 records in
10+0 records out
104857600 bytes (105 MB) copied, 1.32221 s, 79.3 MB/s

# dd if=/dev/zero of=test bs=100M count=1 oflag=direct,sync
1+0 records in
1+0 records out
104857600 bytes (105 MB) copied, 0.821385 s, 128 MB/s


Danke für jede Hilfe

apairon


EDIT:

Ich Depp hatte den Disk-Cache "hdparm -W /dev/sda" wegen tausendfachen herumprobieren auf "0" und daher die schlechten Werte.
Die werte mit Cache sind OK:
Code:
# dd if=/dev/zero of=test bs=1024 count=100 oflag=direct,sync
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.0693772 s, 1.5 MB/s

Den Cache hatte ich wegen eines anderen Problems mal ausgeschaltet.
 
Last edited by a moderator:
Es geht nicht um die WD EARS, sondern um die 3 TB Platten (Seagate ST3000DM001-9YN166).

Ein normales fdisk wird da nix bringen, wegen der GPT denke ich.

Hier aber trotzdem mal:

Code:
# fdisk -lu /dev/sda

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
256 heads, 63 sectors/track, 363376 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Und über gdisk:

Code:
# gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): FA583146-F427-4E70-BF31-3F493A724723
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            4096        16781311   8.0 GiB     FD00  
   2        16781312        18878463   1024.0 MiB  FD00  
   3        18878464        39849983   10.0 GiB    FD00  
   4            2048            4095   1024.0 KiB  EF02  
   5        39849984      5860533134   2.7 TiB     FD00  Linux RAID

Und zu Sicherheit:

Code:
(parted) unit s
(parted) print                                                            
Model: ATA ST3000DM001-9YN1 (scsi)
Disk /dev/sda: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start      End          Size         File system  Name        Flags
 4      2048s      4095s        2048s                                 bios_grub
 1      4096s      16781311s    16777216s                             raid
 2      16781312s  18878463s    2097152s                              raid
 3      18878464s  39849983s    20971520s                             raid
 5      39849984s  5860533134s  5820683151s               Linux RAID  raid

(parted) align-check opt 1                                                
1 aligned
(parted) align-check opt 2
2 aligned
(parted) align-check opt 3
3 aligned
(parted) align-check opt 4
4 aligned
(parted) align-check opt 5
5 aligned

Könnte es ein Firmware-Problem sein?
 
gelöst

Wie schon oben im EDIT geschrieben, lag es am Cache. Dieses Problem ist also gelöst und der Fehler war vor dem Monitor ;)
 
Back
Top