trim - Ubuntu SSD - Was fast, is now extremely slow - Ask Ubuntu


this i'm getting now, crucial mx300 750gb ssd (with latest firmware [there no firmware updates yet]).

lptp [ blah ]: sudo hdparm -tt /dev/sda  /dev/sda:  timing cached reads:   10202 mb in  2.00 seconds = 5103.20 mb/sec  timing buffered disk reads: 128 mb in  3.06 seconds =  41.88 mb/sec 

see buffered disk read speed!!!! soooo slowww!!!! when first setup laptop, seeing on 400mb/sec, fine me considering older laptop, and luks encrypted well.

this /etc/fstab. i've enabled trim, manually ran trim, enabled/disabled features, rebooted, everything. can't fast speeds come back:

/dev/mapper/ubuntu--gnome--vg-root /               ext4    noatime,nodiratime,errors=remount-ro,barrier=0,discard 0       1 

just it's clear, these options i'm using. i've tried various combinations of them no avail:

noatime,nodiratime,errors=remount-ro,barrier=0,discard 

any tips? driving me crazy.

oh, also, i'm running ubuntu 16.04 (x64) on lenovo t420 16gb ram , i7 processor:

 lptp [ blah ]: lsb_release -a no lsb modules available. distributor id: ubuntu description:    ubuntu 16.04.1 lts release:    16.04 codename:   xenial 

smartctl output:

 lptp [ blah ]: sudo smartctl /dev/sda -a smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-38-generic] (local build) copyright (c) 2002-16, bruce allen, christian franke, www.smartmontools.org  === start of information section === device model:     crucial_ct750mx300ssd1 serial number:    xxxxxx lu wwn device id: 5 xxxxx xxxxxxx firmware version: m0cr011 user capacity:    750,156,374,016 bytes [750 gb] sector size:      512 bytes logical/physical rotation rate:    solid state device form factor:      2.5 inches device is:        not in smartctl database [for details use: -p showall] ata version is:   acs-3 t13/2161-d revision 5 sata version is:  sata 3.2, 6.0 gb/s (current: 6.0 gb/s) local time is:    tue nov  1 21:22:05 2016 cdt 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:  (0x00) offline data collection activity                     never started.                     auto offline data collection: disabled. self-test execution status:      (   0) previous self-test routine completed                     without error or no self-test has ever                      been run. total time complete offline  data collection:        ( 1987) 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:    (   2) minutes. extended self-test routine recommended polling time:    (  10) minutes. conveyance self-test routine recommended polling time:    (   3) minutes. sct capabilities:          (0x0035) sct status supported.                     sct feature control supported.                     sct data table supported.  smart attributes data structure revision number: 16 vendor specific smart attributes thresholds: id# attribute_name          flag     value worst thresh type      updated  when_failed raw_value   1 raw_read_error_rate     0x002f   100   100   000    pre-fail        -       0   5 reallocated_sector_ct   0x0032   100   100   010    old_age         -       0   9 power_on_hours          0x0032   100   100   000    old_age         -       52  12 power_cycle_count       0x0032   100   100   000    old_age         -       41 171 unknown_attribute       0x0032   100   100   000    old_age         -       0 172 unknown_attribute       0x0032   100   100   000    old_age         -       0 173 unknown_attribute       0x0032   100   100   000    old_age         -       1 174 unknown_attribute       0x0032   100   100   000    old_age         -       11 183 runtime_bad_block       0x0032   100   100   000    old_age         -       0 184 end-to-end_error        0x0032   100   100   000    old_age         -       0 187 reported_uncorrect      0x0032   100   100   000    old_age         -       0 194 temperature_celsius     0x0022   059   052   000    old_age         -       41 (min/max 21/48) 196 reallocated_event_count 0x0032   100   100   000    old_age         -       0 197 current_pending_sector  0x0032   100   100   000    old_age         -       0 198 offline_uncorrectable   0x0030   100   100   000    old_age   offline      -       0 199 udma_crc_error_count    0x0032   100   100   000    old_age         -       0 202 unknown_ssd_attribute   0x0030   100   100   001    old_age   offline      -       0 206 unknown_ssd_attribute   0x000e   100   100   000    old_age         -       0 246 unknown_attribute       0x0032   100   100   000    old_age         -       138859820 247 unknown_attribute       0x0032   100   100   000    old_age         -       4354463 248 unknown_attribute       0x0032   100   100   000    old_age         -       1675456 180 unused_rsvd_blk_cnt_tot 0x0033   000   000   000    pre-fail        -       3558 210 unknown_attribute       0x0032   100   100   000    old_age         -       0  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, not read-scan remainder of disk. if selective self-test pending on power-up, resume after 0 minute delay. 

what's killing me it working while. worked 1 day, , stopped next, , didn't (that can think of) should have changed it.

update

tested specific device (/dev/sda1), same slow results:

lptp [ ~ ]: sudo hdparm -tt /dev/sda1  /dev/sda1:  timing cached reads:   13130 mb in  2.00 seconds = 6568.77 mb/sec  timing buffered disk reads: 128 mb in  3.06 seconds =  41.79 mb/sec 

update

tested on logical partition too:

 lptp [ ~ ]: sudo hdparm -tt /dev/mapper/ubuntu--gnome--vg-root   /dev/mapper/ubuntu--gnome--vg-root:  timing cached reads:   11468 mb in  2.00 seconds = 5736.85 mb/sec  timing buffered disk reads: 178 mb in  3.04 seconds =  58.47 mb/sec 

update dd test

this test shows it's slower hdparm shows...

 lptp [ blah ]:  dd if=/dev/zero of=tempfile bs=1m count=1024 conv=fdatasync,notrunc status=progress 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 gb, 1.0 gib) copied, 35.0156 s, 30.7 mb/s  lptp [ blah ]: sudo bash -c "echo 3 > /proc/sys/vm/drop_caches"  lptp [ blah ]: dd if=tempfile of=/dev/null bs=1m count=1024 status=progress 1066401792 bytes (1.1 gb, 1017 mib) copied, 34.0193 s, 31.3 mb/s 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 gb, 1.0 gib) copied, 34.256 s, 31.3 mb/s 

update: partition alignment

here's partition alignment on laptop:

lptp [ ~ ]: sudo parted gnu parted 3.2 using /dev/sda welcome gnu parted! type 'help' view list of commands. (parted) p                                                                 model: ata crucial_ct750mx3 (scsi) disk /dev/sda: 750gb sector size (logical/physical): 512b/512b partition table: msdos disk flags:   number  start   end    size   type      file system  flags  1      1049kb  512mb  511mb  primary   ext2         boot  2      513mb   750gb  750gb  extended  5      513mb   750gb  750gb  logical  (parted) align-check opt 1                                                        1 aligned (parted) align-check opt 2 2 not aligned (parted) align-check opt 5 5 aligned (parted) 

i'm not sure think of partition 2 not being aligned :^/ partitions 1 , 5 though.

also, here's partitions seen fdisk -l

device     boot   start        end    sectors   size id type /dev/sda1  *       2048     999423     997376   487m 83 linux /dev/sda2       1001470 1465147391 1464145922 698.2g  5 extended /dev/sda5       1001472 1465147391 1464145920 698.2g 83 linux 

update: fixed? changed scheduler noop scheduler (instead of deadline). seems have worked (did changing /etc/default/grub have line:

grub_cmdline_linux_default="quiet splash elevator=noop" 

and updating grub sudo update-grub2 , rebooting.

i'm going wait few days see if works after few more reboots/usage before make answer , accept it.

current speeds after changing scheduler:

 lptp [ ~ ]: sudo hdparm -tt /dev/sda  /dev/sda:  timing cached reads:   12388 mb in  2.00 seconds = 6197.19 mb/sec  timing buffered disk reads: 1454 mb in  3.00 seconds = 484.59 mb/sec 

options in fstab are:

noatime,nodiratime,errors=remount-ro,barrier=0 

enter image description here

"fix" update

after using bit , rebooting few times, it's back slow speeds :( :( :( :( :( :(

update - possible "fix"

i had thought perhaps laptop doing battery-saving optimizations when it's booted , running off battery. after 1 simple test of booting charger plugged in, it's fast speeds. i'm case - time tested @ fast speeds had charger plugged in. i'll run few more tests verify, i'm causing slowdown.

the quick answer:

sudo hdparm -b254 /dev/sda 

the long answer:

it appears linux or laptops in general (verified on both lenovo , dells) default apm level 80h (128) when booted on battery , feh (254) when booted on ac power.

for ssds, won't notice difference. lite-on ssds seem not support power management @ , run @ max speed. intel ssds seem run @ 75% full speed @ apm level 128, , 100% speed @ apm level 254/255. crucial ssds seem run @ 6% full speed @ apm level 128 (booted on battery) when compared apm level 254 (booted on ac power).

the bad news there no bug , no fault here. ata spec sufficiently vague crucial ssds running super slow in apm mode 128 allowed , compliant spec. laptop defaulting apm level 80h (128) reasonable. spec says:

table 106 — apm levels
count field level
00h reserved
01h minimum power consumption standby mode
02h..7fh intermediate power management levels standby mode
80h minimum power consumption without standby mode
81h..fdh intermediate power management levels without standby mode
feh maximum performance
ffh reserved

(from ata spec)

here experience crucial mx300 ssd booted on battery power:

root@ubuntu:~# hdparm -b /dev/sda  /dev/sda:  apm_level  = 128  root@ubuntu:~# hdparm -t /dev/sda  /dev/sda:  timing buffered disk reads:  94 mb in  3.02 seconds =  31.11 mb/sec  root@ubuntu:~# hdparm -b254 /dev/sda  /dev/sda:  setting advanced power management level 0xfe (254)  apm_level  = 254  root@ubuntu:~# hdparm -t /dev/sda  /dev/sda:  timing buffered disk reads: 1466 mb in  3.00 seconds = 488.44 mb/sec 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User