Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have an 512 GB Samsung 840 Pro SSD on a Linux machine (CentOS 6.4, 64-bit) with an i7 CPU. The SSD drive is connected to a 6 Gb/sec SATA connector on the system board. The entire SSD has one large 480 GB ext4 partition. Tom's Hardware reports this SSD as giving 480 MB/sec for sequential writes. However, when I fill the disk with repeated calls to this dd command:
Quote:
dd count=1048576 bs=1024 if=/dev/zero of=file.nnn
I only see about 240 MB/sec. If I run fstrim in the entire partition, and rerun the test, I only see 240 MB/sec. If I delete the files, and then DON'T run fstrim, and rerun the test, I still only see 240 MB/sec. I tried other block sizes as well. However, I can't get the write speed to budge from 240 MB/sec.
So it seems that either fstrim isn't working for me, or maybe this isn't the correct way to perform sequential write benchmarks, or maybe the SSD isn't somehow configured correctly, or fstrim isn't configured properly, or maybe Linux doesn't support SSDs correctly? Does anyone know why I'm not seeing faster write speeds, and what can I do to see the faster write speeds?
I'm not sure what that was supposed to do, but I tried 'conv=fdatasync' and write speeds were about 190 megabytes/second.
From the dd man page:
"fdatasync: physically write output file data before finishing"
In other words it should show the actual data throughput without the effect of caching to RAM. You might find this interesting: https://wiki.archlinux.org/index.php/SSD_Benchmarking
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
SSD speed can be wildly contrived. For instance, the hdparm -T command might read 2,000 MB/s. But that's from the drive buffer cache, so it's not really fair. Making a 50 GB file of zeroes with dd is better, but dd uses four buffers. I believe the source data is read into the first buffer, a second buffer verifies the data with the original read bufer, after which data is written to the target and then read into the third buffer, which is compared to the first buffer for verification. If all that checks out right, the dd program moves on the next block of data.
To say the least, that is just going to be slow. It's not like an office application writing to the disk. From what I know, about 250 MB/s is a good realistic rate for such a drive as yours.
After Edit: You can also try what interface its using (1.5/3/6). For example my SATA hdd uses 1.5 Gb/s and 3 Gb/s. In your case it should also show 6 Gb/s. If not, check sata cable. Cant say it works for SSD though.
After Edit: You can also try what interface its using (1.5/3/6). For example my SATA hdd uses 1.5 Gb/s and 3 Gb/s. In your case it should also show 6 Gb/s. If not, check sata cable. Cant say it works for SSD though.
This is interesting. The SSD is connected to the SATA 6.0 Gb/s connector on the system board. Why does hdparm report 3.0 Gb/s? You said to check the cable. The SSD did not come with a SATA cable, so I used whatever I had handy. I see on newegg that some SATA Cables are listed as 6.0 Gb/s. Are they really different then other cables?
You said to check the cable. The SSD did not come with a SATA cable, so I used whatever I had handy. I see on newegg that some SATA Cables are listed as 6.0 Gb/s. Are they really different then other cables?
Actually i was suggesting to check if there are different SATA2 and SATA3 interface, and that have you plugged to correct SATA3 interface. But a quick google cleared that there should not be difference (bet 3 & 6), unless the sata cable is cheap one. SATA 3Gb/s vs. 6Gb/s Cable Performance
Anyway, these are the some areas you have to check for problems:
Mother Board interface (SATA III)
BIOS (IF possible update bios)
Write Cache (Some ssd comes with cache, if its so then disabling write cache greatly improves write speed)
I'm using the SATA III connection on the system board. I checked for BIOS updates, there are some, but none of them address the SATA III. The SATA cable shouldn't matter, according to the article you referenced. Not sure what else to check. But Tom's Hardware clearly achieved about twice as high write (and read) bandwidth on this exact drive under windows as I am under linux. So something is definitely wrong.
The SSD is connected to the SATA 6.0 Gb/s connector on the system board.
Not all SATA controllers are created equal. Many of the addon SATA controllers found on motherobrds use junk marvel (etc.) controllers.....which often run very badly even with windows. With linux they run far worse. Even if labeled 'SATA6' or 'SATAIII' can be limited to SATAII as well, I've seen reports of that even with windows.
You might want to write a short script that does the dd with a timestamp at the start and timestamp at the end and calculate the write speed yourself. It could just be reporting an incorrect value. Also bear in mind that writing files to a filesystem has more overhead than writing data to a whole disk.
I'm using an Asus Sabertooth X58. It has a Marvell SATA III controller. When I boot, the boot message lists that Marvell SATA controller and it lists it as 6 Gb/sec.
Quote:
You might want to write a short script that does the dd with a timestamp at the start and timestamp at the end and calculate the write speed yourself.
Yes, I did that originally. That is where the 240 MB/sec numbers come from.
Quote:
BIOS > On-Chip SATA Type > AHCI. (Previously only booted on 'Native IDE')
I did something similar. In the BIOS, I then changed the Marvell controller from IDE to AHCI. It didn't make any difference in the speed tests.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.