Announcement

Collapse
No announcement yet.

SSD seems slow

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Could you run the same test with an HDD? I bet its the disk controller ... or more precisely, the driver that drives it. FreeBSD prints out the read/write speed of each disk on dmesg. Can you check this on Linux somewhere?

    EDIT:
    Oh you did. Yeah it's the controller. Try to find out what the reported read/write speed is.
    Last edited by nslay; 20 September 2014, 02:24 PM.

    Comment


    • #12
      One possibility is that the drive's internal datastructures are somehow garbled and it's GC is not working right. I had this problem with a brand new Samsung EVO SSD; it had awful performance out of the box presumably because I never formatted it: all I did was add it to an MD RAID mirror

      I fixed the issue by issuing a discard for the entire drive with the blkdiscard command, so that the internal controller knows all blocks are free. Speeds went from 20-30MB/s to near 500MB/s, even with just the simple hdparm test.

      Do note using blkdiscard on a drive or partition will instantly destroy all data on it, no questions asked, so try it as a last resort after having backed up your data.

      EDIT: If the drive is formatted and the filesystem has mostly free space, try running the fstrim command first.
      Last edited by Chousuke; 20 September 2014, 04:03 PM.

      Comment


      • #13
        Originally posted by TheSoulz View Post
        Also make sure you dont use EXT4 on a SSD try BTRFS or something newer that supports SSD's.
        EXT4 supports SSDs just fine. In my experience, it has fewer issues than btrfs even. btrfs seems to have CPU usage issues crop up over time with SSDs, even with discards enabled.

        Comment


        • #14
          Originally posted by Chousuke View Post
          One possibility is that the drive's internal datastructures are somehow garbled and it's GC is not working right. I had this problem with a brand new Samsung EVO SSD; it had awful performance out of the box presumably because I never formatted it: all I did was add it to an MD RAID mirror

          I fixed the issue by issuing a discard for the entire drive with the blkdiscard command, so that the internal controller knows all blocks are free. Speeds went from 20-30MB/s to near 500MB/s, even with just the simple hdparm test.

          Do note using blkdiscard on a drive or partition will instantly destroy all data on it, no questions asked, so try it as a last resort after having backed up your data.

          EDIT: If the drive is formatted and the filesystem has mostly free space, try running the fstrim command first.
          If that's really true, SSD technology sucks (or at least that particular drive). The original poster also showed a benchmark of an HDD which points to problems elsewhere (very likely the disk controller, some of them are buggy like Promise controllers).

          Comment


          • #15
            Originally posted by nslay View Post
            If that's really true, SSD technology sucks (or at least that particular drive). The original poster also showed a benchmark of an HDD which points to problems elsewhere (very likely the disk controller, some of them are buggy like Promise controllers).
            Just a quick Internet search for Promise controllers (this is an example, not necessarily the original poster's problem):
            I am running a PDC40718 Promise SATA controller on a fresh install of Hardy. I replaced the IDE drive for SATA because I needed more storage. What I lost was performance. It's tough to be sure, but my nice Hardy seems to lock up more now as well. From what I can tell though, hdparm seems to show a fairly fast drive but it does not seem to have access to things like DMA because of the "Inappropriate ioctl for device". Device Info:lspci| grep -i 'promise' 02:0d.0 Mass storage


            I've also seen them mentioned a lot on FreeBSD mailing lists.

            Comment


            • #16
              Originally posted by nslay View Post
              If that's really true, SSD technology sucks (or at least that particular drive). The original poster also showed a benchmark of an HDD which points to problems elsewhere (very likely the disk controller, some of them are buggy like Promise controllers).
              It's not really fair to say that SSD technology sucks; In general regular spinning HDDs can't even come close in performance to any SSD that isn't utter garbage.

              The drive has an internal controller which maps logical blocks into actual physical data blocks in order to accomplish wear leveling (among other things). With certain types of usage patterns, it accumulates inefficiency because even though from the operating system's perspective, data on the disk is "free", the controller doesn't necessarily know that and has to work harder for each request, lowering performance.

              What happened in my case likely is that the internal state of the controller "out of the box" was somehow garbled, and while usually a drive format issues a discard (aka TRIM) request for the entire drive, essentially resetting the drive's internal state, merely adding it to my RAID array didn't do that, so the drive thought it was "full" and was working harder than necessary when data was being overwritten.


              Code:
              /dev/sdc:
               Timing cached reads:   28198 MB in  2.00 seconds = 14117.52 MB/sec
               Timing buffered disk reads: 1552 MB in  3.00 seconds = 517.11 MB/sec
              
              /dev/sdb:
               Timing cached reads:   27438 MB in  2.00 seconds = 13736.96 MB/sec
               Timing buffered disk reads: 1540 MB in  3.00 seconds = 512.79 MB/sec
              Show me a HDD that can do these numbers

              Comment


              • #17
                Originally posted by Chousuke View Post
                It's not really fair to say that SSD technology sucks; In general regular spinning HDDs can't even come close in performance to any SSD that isn't utter garbage.

                The drive has an internal controller which maps logical blocks into actual physical data blocks in order to accomplish wear leveling (among other things). With certain types of usage patterns, it accumulates inefficiency because even though from the operating system's perspective, data on the disk is "free", the controller doesn't necessarily know that and has to work harder for each request, lowering performance.

                What happened in my case likely is that the internal state of the controller "out of the box" was somehow garbled, and while usually a drive format issues a discard (aka TRIM) request for the entire drive, essentially resetting the drive's internal state, merely adding it to my RAID array didn't do that, so the drive thought it was "full" and was working harder than necessary when data was being overwritten.


                Code:
                /dev/sdc:
                 Timing cached reads:   28198 MB in  2.00 seconds = 14117.52 MB/sec
                 Timing buffered disk reads: 1552 MB in  3.00 seconds = 517.11 MB/sec
                
                /dev/sdb:
                 Timing cached reads:   27438 MB in  2.00 seconds = 13736.96 MB/sec
                 Timing buffered disk reads: 1540 MB in  3.00 seconds = 512.79 MB/sec
                Show me a HDD that can do these numbers
                That's not what I meant. If you have to format your brand new SSD so that it performs within spec as you suggest, then that's what sucks about the technology (or your drive). Since any HDD will work the same whether it's formatted or not, it's reasonable to expect the same of SSD. Especially when you suggest that not formatting results in 20MB/s performance. That's really really stupid.

                Comment


                • #18
                  Originally posted by nslay View Post
                  That's not what I meant. If you have to format your brand new SSD so that it performs within spec as you suggest, then that's what sucks about the technology (or your drive). Since any HDD will work the same whether it's formatted or not, it's reasonable to expect the same of SSD. Especially when you suggest that not formatting results in 20MB/s performance. That's really really stupid.
                  SSDs have nothing in common with HDDs besides the fact that they store bits. It's not reasonable to expect them to have the same behaviour in corner case situations.

                  I suppose they could format the drives in the factory, but that seems kind of redundant, since the user should format the drive anyway. In my case, MD apparently doesn't issue discards to new devices added to an array, which I suspect to have caused the problem.

                  Comment


                  • #19
                    Changing the read ahead size might help

                    I had some slowness with my SSD, changing the read ahead helped.

                    open /etc/rc.local and add the following. you may need adjust the sizes a little.


                    Add the following lines before “exit 0“.
                    echo 1024 > /sys/block/sda/queue/read_ahead_kb
                    echo 256 > /sys/block/sda/queue/nr_requests

                    Good luck

                    Comment


                    • #20
                      Originally posted by Chousuke View Post
                      SSDs have nothing in common with HDDs besides the fact that they store bits. It's not reasonable to expect them to have the same behaviour in corner case situations.

                      I suppose they could format the drives in the factory, but that seems kind of redundant, since the user should format the drive anyway. In my case, MD apparently doesn't issue discards to new devices added to an array, which I suspect to have caused the problem.
                      I don't care. I don't even care how it works. It's a black box like any other SATA storage device. Any HDD I connect works without me having to do anything special and I have this reasonable expectation of any other SATA storage device (regardless of SDD). And on top of that, having to format GBs (maybe even TBs) to get that performance is a waste of time. And to expect a typical computer user to know that is preposterous. It's really stupid. Either your drive sucks or SDD technology is lacking (gee, maybe the vendor can pre-format it?).

                      Comment

                      Working...
                      X