2

I have got ubuntu server 12.04 with software raid0 intel sata3 ssd(2*480GB). raid is used for postgresql database. There is 51% of raid space is free.

After postgres shutdown, "dd" command shows performance about 10mb/sec. uptime is 2 weeks.

after system reboot raid works fine again and "dd" shows about 700-800mb/sec.

cat /proc/mdstat

md127 : active raid0 sdd1[0] sdc1[1]
  937700352 blocks super 1.2 512k chunks

Why performance degrades with large uptime?

mdadm version - 3.2.5

user1941407
  • 123
  • 2
  • 7
  • Are you using `dd` to access the disk directly, or are you going through the filesystem by reading/writing a file? – Andrew Henle Apr 27 '15 at 23:08
  • trough filesystem. "dd if=/dev/zero of=/media/raid/output bs=8k count=100k" – user1941407 Apr 28 '15 at 07:11
  • Is read performance also slow? If so, how fast can you **read** from the disk? Something like `dd if=/dev/sda of=/dev/null bs=8k count=100k`, where `if=` is the path to your SSD RAID device. – Andrew Henle Apr 28 '15 at 12:39
  • after reboot it works fine. now read from disk is 400mb/sec, read from array is 800mb/sec. I will test it with performance degrade later. – user1941407 Apr 28 '15 at 15:15
  • Next time you have degradation, check the contents of /proc/mdstat to make sure your raid isn't degraded and rebuilding. – Chad Smith Apr 29 '15 at 05:08
  • /proc/mdstat added to the question. this is raid0 array, it could not be degraded. By the way it made from sdd1 and sdc1 partitions, not entire devices. is it a problem? – user1941407 Apr 29 '15 at 08:46
  • if the partitions aren't aligned correctly or if you use the other partitions that might be an issue. Additionally check if the trim command is actually send to the devices. Please additionally make sure you know the difference between MB and Mb which, while possible not related here might show issues in comparing the values. – Dennis Nolte Apr 29 '15 at 09:12

2 Answers2

3

I would recommend that you check your logs (/var/log/*) for messages like "NCQ disabled due to excessive errors", this and similar messages (try to look for anything with "ata" in it too) indicate that you are having errors on your SATA links and these may cause Linux to disable NCQ and then you'll get a very bad performance.

I've written a longer version a while ago at my blog: http://blog.disksurvey.org/blog/2013/10/28/ncq-disabled/

The errors may come from the disk itself or from the links, you can try to replace the cables. The blog post indicates some other things that can be done to alleviate this issue.

Baruch Even
  • 1,073
  • 6
  • 18
0

Not quite exactly what the OP was looking for but the use of dd isn't a best practice in my opinion.

DD is on the whole just much better used for imaging disks than benchmarking. Use Fio.

sudo dnf install fio or sudo apt-get install fio

4k random test

fio --filename=/dev/sdx --direct=1 --rw=randrw --refill_buffers --norandommap --randrepeat=0 --ioengine=libaio --bs=4k --rwmixread=100 --iodepth=16 --numjobs=16 --runtime=60 --group_reporting --name=4ktest

8k mixed test

fio --filename=/dev/sdx --direct=1 --rw=randrw --refill_buffers --norandommap --randrepeat=0 --ioengine=libaio --bs=8k --rwmixread=70 --iodepth=16 --numjobs=16 --runtime=60 --group_reporting --name=8k7030test

taken from: http://www.storagereview.com/fio_flexible_i_o_tester_synthetic_benchmark

once you are sure your raw disks are performing as they should, create the raid-0 unit via madam and then before partitioning test them again but this time instead of /dev/sd{x} pass in whatever you called your raid array, once satisfied, create your partitions aligning as needed and test that, then once good there, format and mount and test that.