Announcement

Collapse
No announcement yet.

Aspire One SSD Optimisation

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Aspire One SSD Optimisation

    Hi

    Looking to try and optimise my wifes aspire one netbook running ubuntu 11.04:

    1gb RAM - I believe it can take 1.5 (there appears to be a housing underneath) but with the extra 512mb I suspect I wouldn't see much difference

    Disks

    1x8GB SSD. 1 Gb swap and 7 Gb root
    1x8GB SDHC card in L/H card slot, home.
    Both filesystems are ext4.

    I have read that I would see an improvement in performance if I turn off journalling. Can anyone confirm this to be the case? I have seen this:

    http://ubuntuforums.org/archive/inde...t-1109698.html

    tbh I'm struggling to make sense of the advice here. Would I just issue the following command

    Code:
    sudo tune2fs -o journal_data_writeback /dev/whatever
    to turn off journalling? Would I also be right in assuming that I should only turn it off on the root partition?

    Thoughts are welcome please.

    Ian





    #2
    Re: Aspire One SSD Optimisation

    You don't need to turn journalling totally off, and you probably don't want to. You can use the "commit=nn" mount option, where "nn" is the number of seconds between journal flushes to the SSD, default value being 5. I have settled upon 120 seconds (once every two minutes) as a reasonable compromise between data security and SSD wear. Also, you have the /var/log and /var/tmp and /var/spool files that are very frequently written out to the SSD. So, you can mount them, in /etc/fstab, as temporary filesystems in memory. The consequence of this, of course, is you will lose the log history between reboots. Here is my /etc/fstab file from my Toshiba netbook:

    Code:
    root@tosh205:/home/don# cat /etc/fstab
    UUID=42e0cce2-17f9-4452-ab24-f40d79e18ebc   /          ext4    defaults,noatime,errors=remount-ro,barrier=0,discard,commit=120 0 1
    UUID=64097124-3a9a-45e1-a051-d470805bab1d   none         swap    sw 0 0
    UUID=57281ba2-b8a0-4c5c-ae4f-a1048408752c   /home        ext4    defaults,noatime,errors=remount-ro,barrier=0,discard,commit=120 0 2
    none                     /tmp         tmpfs   defaults,noatime,mode=1777 0 0
    none                     /var/tmp       tmpfs   defaults,noatime 0 0
    none                     /var/log       tmpfs   defaults,noatime 0 0
    none                     /var/spool      tmpfs   defaults,noatime 0 0
    Note that the "barrier=0" option is redundant, since the barrier default value is 0. I just haven't gotten around to removing it.

    A further performance and durability enhancement that you may wish to consider is to align the partition(s) to the write block size, typically 512K. Here is more on that topic:

    http://www.ocztechnologyforum.com/fo...l=1#post373226

    So, here is the 512K-aligned configuration of the 40GB SSD in the same Toshiba netbook:

    Code:
    root@tosh205:/home/don# fdisk -lu
    
    Disk /dev/sda: 40.0 GB, 40018599936 bytes
    32 heads, 32 sectors/track, 76329 cylinders, total 78161328 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00042576
    
      Device Boot   Start     End   Blocks  Id System
    /dev/sda1      1024   9438207   4718592  83 Linux
    /dev/sda2     9438208  13630463   2096128  82 Linux swap / Solaris
    /dev/sda3    13630464  78160895  32265216  83 Linux

    Comment


      #3
      Re: Aspire One SSD Optimisation

      Interesting thanks dibl

      I'll take a look at it when I get home.

      I note from your fstab you have done it on your /home partition as well.

      I also note there is an option on there - "discard" - is that in any way connected to the "commit" option?

      On the tmpfs options, the netbook doesn't do any heavy lifting so I imagine it should be okay, but if it were to fill up the RAM would it just write to swap as normal?

      Would I be right in assuming that the alignment is something that should be done when setting up the partitions?

      edit: Is there also any benefit to be derived in using these settings in a system with a hard drive?

      Thanks

      Comment


        #4
        Re: Aspire One SSD Optimisation

        Originally posted by The Liquidator

        I note from your fstab you have done it on your /home partition as well.
        Yes, same principle applies -- ext4 will write the journal every 5 seconds unless you force it to do otherwise.


        I also note there is an option on there - "discard" - is that in any way connected to the "commit" option?
        No, "discard" implements the SSD's "trim" capability. You can google "ssd trim" to learn all about that.


        On the tmpfs options, the netbook doesn't do any heavy lifting so I imagine it should be okay, but if it were to fill up the RAM would it just write to swap as normal?
        Honestly, I don't know. I would suppose it would start swapping the journal writes. But you'd have to have it running a long time, or else get RAM busy with other tasks.


        Would I be right in assuming that the alignment is something that should be done when setting up the partitions?
        Yes. Moreover, gparted alone won't do it for you. That's why I pointed you to that somewhat-elaborate use of good old fdisk to get it done. However, I'm pretty sure that if you merely changed the LBA geometry with fdisk (changed it to 32 heads and 32 sectors per cylinder), then you could use gparted and choose "align to cylinders" and you would end up with an aligned drive. Or so I theorize -- I haven't tried that, I just used fdisk all the way through.


        edit: Is there also any benefit to be derived in using these settings in a system with a hard drive?
        Not much. On my desktop system that is powered via an external UPS, I have also set commit=120 to slow down the journalling, but the benefits of that are tiny indeed -- probably more theoretical than practical.

        There are a couple of other tweaks that you can do, in the virtual memory (vm) domain, if you want, to complement that slowdown of ext4 journalling. They are shown here, in the paragraph that discusses "laptop mode": http://www.cyrius.com/debian/nslu2/linux-on-flash.html

        But check and see what the present values for those settings are, before you change anything. If your Asus is already using "laptop mode" features, you may not be able to improve upon it.

        Comment


          #5
          Re: Aspire One SSD Optimisation

          Originally posted by dibl

          No, "discard" implements the SSD's "trim" capability. You can google "ssd trim" to learn all about that.
          Thanks for that, I've looked it up. It's very interesting, as I have noticed the SSD does seem to get slower as time goes by. Software updates are spectacular in their slowness. It seems to be simply a question of simply putting the "discard" option in fstab. Would that be a safe assumption?

          Thanks

          Ian

          Comment


            #6
            Re: Aspire One SSD Optimisation

            Originally posted by The Liquidator
            Thanks for that, I've looked it up. It's very interesting, as I have noticed the SSD does seem to get slower as time goes by. Software updates are spectacular in their slowness. It seems to be simply a question of simply putting the "discard" option in fstab. Would that be a safe assumption?
            Only if the SSD supports trim and it's a safe assumption that the one in your netbook does not, I'm afraid.
            we see things not as they are, but as we are.
            -- anais nin

            Comment


              #7
              Re: Aspire One SSD Optimisation

              Right, you'd have to research the exact model of the SSD (that is embedded in that netbook ....). Older SSDs didn't do trim. On the other had, as far as I know the "discard" option is harmless in /etc/fstab even if the device can't use it. dmesg might show some indication of whether it is accepted by the device or not.

              Comment


                #8
                Re: Aspire One SSD Optimisation

                Thanks

                Given the netbook is a 12/2008 build with a cr*ppy 8GB SSD card I'm inclined to agree that it won't support TRIM so I've left that alone.

                I have set up both the netbook and my laptop (a 5 year-old Dell inspiron 630m) with commit=60 (to reflect my paranoia). I have also set up the netbook to use tmpfs as you have shown, dibl. I didn't set up the laptop in this way as temp files are often created when I use it for CD creation and (can you believe) video editing.

                On both machines I had previously added noatime to each partition. However (and I don't know how important this is) between each option my fstab had gaps whereas you have put commas. Would I be right to ask that the commas are rather important (ie without them the options won't be recognised)?

                Anyway, after adjustment I rebooted both machines and a filesystem check was done on each one. This did not happen when I had previously put in the noatime options (which is why I wonder whether the non-use of commas meant the earlier changes never took effect).

                After the change both seem to be a little snappier - thanks

                Comment


                  #9
                  Re: Aspire One SSD Optimisation

                  Originally posted by The Liquidator
                  On both machines I had previously added noatime to each partition. However (and I don't know how important this is) between each option my fstab had gaps whereas you have put commas. Would I be right to ask that the commas are rather important (ie without them the options won't be recognised)?
                  Spaces delimit sections, commas delimit options within a section. The commas are important

                  Check this -

                  # / was on /dev/sda1 during installation
                  UUID=690541da-1388-4814-bba2-7e78ec22d06d / ext4 errors=remount-ro,noatime,discard,commit=120 0 1
                  we see things not as they are, but as we are.
                  -- anais nin

                  Comment


                    #10
                    Re: Aspire One SSD Optimisation

                    Sorry for digging up this topic, but today I got a Gskil SSD drive, and I'm going to install on it a fresh system with Kubuntu 11.10.

                    What considerations should I do to get the best optimization for it?
                    About Trim, etc??
                    Thanks

                    Comment


                      #11
                      Re: Aspire One SSD Optimisation

                      The advice here is still relevant.

                      You can determine whether your drive supports TRIM with the command:

                      Code:
                      sudo hdparm -I /dev/sda
                      Where you might have to replace "sda" with whatever drive you're checking. Here's the output of mine, truncated to show only the relevant parts:

                      Code:
                      sriley@SRiley-T410:~$ sudo hdparm -I /dev/sda
                      /dev/sda:
                      
                      ATA device, with non-removable media
                        <snip>
                      Commands/features:
                        <snip>
                          Enabled Supported:
                            *  Data Set Management TRIM supported (limit 8 blocks)
                            *  Deterministic read ZEROs after TRIM
                        <snip>
                      And here's my /etc/fstab:

                      Code:
                      sriley@SRiley-T410:~$ cat /etc/fstab
                      # <file system> <mount point>  <type> <options>    <dump> <pass>
                      proc      /proc      proc  nodev,noexec,nosuid 0    0
                      # / was on /dev/sda1 during installation
                      UUID=3175f1e1-f320-496d-b32e-7c43d466c7f1 /        ext4  noatime,discard,errors=remount-ro 0    1
                      # swap was on /dev/sda2 during installation
                      UUID=25a3c459-8fb3-4c3a-89ae-55f6bbe13934 none      swap  sw       0    0
                      #
                      tmpfs /tmp   tmpfs noatime,mode=1777 0 0
                      tmpfs /var/tmp tmpfs noatime,mode=1777 0 0
                      I've moved only /tmp and /var/tmp to tmpfs. Probably should move /var/spool too, just haven't gotten around to it. I didn't move /var/log because I prefer my logs to survive reboots. And I've also allowed commit to remain at its 5-second default.

                      Comment


                        #12
                        Re: Aspire One SSD Optimisation

                        I rolled commit back to the default too - but it'd be wise to read an article on partition alignment as well and decide if you want to do that. Makes a small but measurable difference and it's only gotta be set up once.

                        Mine looks like this now -

                        proc /proc proc nodev,noexec,nosuid 0 0
                        # / was on /dev/sda1 during installation
                        UUID=690541da-1388-4814-bba2-7e78ec22d06d / ext4 errors=remount-ro,noatime,discard 0 1
                        # /home was on /dev/sda3 during installation
                        UUID=2f1807ca-8990-40ca-bcc1-d3fb6375e2eb /home ext4 noatime,discard 0 2
                        # swap was on /dev/sda2 during installation
                        UUID=91347c22-f774-4630-a642-95a10592838c none swap sw 0 0
                        # /tmp on tmpfs
                        tmpfs /tmp tmpfs noatime,mode=1777 0 0

                        Root partition here is aligned - you can get everything you need from this, but a readme might be a little easier -

                        wizard@wizard-netbook:~$ sudo fdisk -l
                        [sudo] password for wizard:

                        Disk /dev/sda: 60.0 GB, 60022480896 bytes
                        32 heads, 32 sectors/track, 114483 cylinders, total 117231408 sectors
                        Units = sectors of 1 * 512 = 512 bytes
                        Sector size (logical/physical): 512 bytes / 512 bytes
                        I/O size (minimum/optimal): 512 bytes / 512 bytes
                        Disk identifier: 0x000ceb19

                        Device Boot Start End Blocks Id System
                        /dev/sda1 * 1024 41945087 20972032 83 Linux
                        /dev/sda2 41945088 46402559 2228736 82 Linux swap / Solaris
                        /dev/sda3 46402560 117230591 35414016 83 Linux
                        wizard@wizard-netbook:~$
                        we see things not as they are, but as we are.
                        -- anais nin

                        Comment


                          #13
                          Re: Aspire One SSD Optimisation

                          Originally posted by wizard10000
                          but it'd be wise to read an article on partition alignment as well and decide if you want to do that. Makes a small but measurable difference and it's only gotta be set up once.
                          Yup, also did that. I've never run a comparison, though -- how much difference does it make?

                          Comment


                            #14
                            Re: Aspire One SSD Optimisation

                            Originally posted by SteveRiley
                            Yup, also did that. I've never run a comparison, though -- how much difference does it make?
                            I think it depends on how the drive is used but in my tests it's been way less than 10%. On my netbook the difference is zero, because the stupid netbook will only do SATA 1.0 and I suspect this might be the way a lot of laptops work also.

                            Grrr.

                            Also - while I'm on the subject of @#$% laptop hardware, HP whitelists internal WLAN cards on their netbooks. I switched from a Broadcom 4312 to an Intel 6200 because I wanted 802.11n and the netbook refused to boot - BIOS complained of an unrecognized networking device. I had to find a hacked BIOS to get the Intel card to work.

                            But I digress.

                            we see things not as they are, but as we are.
                            -- anais nin

                            Comment


                              #15
                              Re: Aspire One SSD Optimisation

                              Originally posted by wizard10000
                              Also - while I'm on the subject of @#$% laptop hardware, HP whitelists internal WLAN cards on their netbooks. I switched from a Broadcom 4312 to an Intel 6200 because I wanted 802.11n and the netbook refused to boot - BIOS complained of an unrecognized networking device. I had to find a hacked BIOS to get the Intel card to work.
                              Yeah, teh Googlez shows this is a popular mod. How did it go for you? I'm tempted to try it on my Mini 2140. Me hates Broadcom.

                              Comment

                              Working...
                              X