To Swap, Or Not To Swap - That Is The Question

Discussion in 'Linux' started by Andysan, Nov 22, 2008.

  1. Andysan

    Andysan

    Joined:
    Jul 9, 2008
    Messages:
    272
    Likes Received:
    0
    OK, so i am aware that looking at the title, this is more of a general AAO question, but i've posted in this forum for a good reason so please bear with me.

    I've installed Ubuntu Intrepid onto my 8GB SSD model with 512MB RAM without a swap partition to try and reduce wear and tear on the SSD. The system is generally pretty snappy, but then it will slow down and hang at certain points which is of concern and annoyance. I am curious as to whether this is because i am not using a swap partition? Can anyone a) post what sort of lifespan reduction i can expect if i use a swap partition and b) can you post if your system ever grinds to a halt and if so are you using a swap partition or not please? Is the trade off of the SSD wear worth the increasse in speed and stability?

    For example, i have compiz enabled, and whilst browsing Firefox i opened the Update Manager and everything froze up for over 10 minutes! :( :eek:

    Will the swap partition ever be used in circumstances like this whereby i run out of RAM, or will the OS constantly be writing stuff back and forth to the SSD?

    Any other tweaks to increase performance would be appreciated.

    Many thanks!
     
    Andysan, Nov 22, 2008
    #1
  2. Andysan

    Andysan

    Joined:
    Jul 9, 2008
    Messages:
    272
    Likes Received:
    0
    I hate myself for this, but "bump" :idea:
     
    Andysan, Nov 24, 2008
    #2
  3. Andysan

    mh-

    Joined:
    Sep 22, 2008
    Messages:
    39
    Likes Received:
    0
    It's not the lack of a swap partition that's causing it. The write-speed on the SSD is somewhat low. Also, if you're using the noop IO-scheduler (recommended in the guides) it may make things even worse since IO-requests are simply handled on a FIFO basis. I'm using deadline - the system still gets laggy when there's lots of writing going on but it doesn't lock up on me ;).

    If you don't actually *need* more than 512mb, adding swap (partition or file) will do nothing to improve performance. If anything it'll make things worse since the swap lives on the (slow writespeed) SSD :p.
     
    mh-, Nov 24, 2008
    #3
  4. Andysan

    lotus49

    Joined:
    Jun 29, 2008
    Messages:
    343
    Likes Received:
    0
    Location:
    Yorkshire
    This has been done to death on this forum (and others), but the short answer is that you shouldn't worry about it. Any SSD with wear-levelling will last longer than you are likely to want to use your One for.

    Whether you use a swap partition or not is a matter of choice, but Linux (and indeed all Unices) are designed to use a swap partition. If you have plenty of memory, it's not likely to make much difference most of the time but there are some circumstances where it might improve performance slightly. For example, having one will allow the OS to swap processes to disk, freeing space for disk buffers. In addition, Linux hibernates to the swap partition so if you want to use hibernate you must have a swap partition.

    For these reasons, I have chosen to use a swap partition but I know lots of people here have chosen not to and have had no problems.

    PS mh- is probably correct about the slowdowns, they are likely to be the result of the SSD's slow write speed rather than the lack of swap. However, 10 minutes is an awfully long time, mine never stops for more than a minute and even that is unusual.
     
    lotus49, Nov 24, 2008
    #4
  5. Andysan

    Andysan

    Joined:
    Jul 9, 2008
    Messages:
    272
    Likes Received:
    0
    Cheers for the replies ladies and gents, i'd tweaked the OS in various ways but missed out the IO Scheduler - thanks!
     
    Andysan, Nov 25, 2008
    #5
  6. Andysan

    SlCKB0Y

    Joined:
    Sep 13, 2008
    Messages:
    165
    Likes Received:
    0
    Location:
    Sydney, Australia
    Is it just me, or is this missing the point of having a netbook?
     
    SlCKB0Y, Nov 25, 2008
    #6
  7. Andysan

    JimK

    Joined:
    Aug 14, 2008
    Messages:
    218
    Likes Received:
    0
    Well, who determines the point of having a netbook? The manufacturers and their marketers, or the customers who buy and use them? I would say the purpose of having a netbook is whatever the user wants it to be, whether it's a no-nonsense Internet appliance or a mini-version of a desktop with lots of video candy.
     
    JimK, Nov 25, 2008
    #7
  8. Andysan

    lotus49

    Joined:
    Jun 29, 2008
    Messages:
    343
    Likes Received:
    0
    Location:
    Yorkshire
    Not at all. I want my laptot to do all the non-computationally intensive stuff my main laptop does and I want it to look pretty if it stays usable. I'm never going to be able to edit video on it, but it is surprising just what it can do. I also run Compiz and it works fine.

    I have read a lot of comments suggesting that netbooks/laptots/etc are only fit for web browsing and email but that really is not true. The One is amazingly capable for such an "under-powered" machine and since I bought mine, I have used it more than my desktop (running Ubuntu) or my MacBook Pro. My MBP is a very nice machine, but I have three young children and two kittens and I am just too paranoid to leave it lying around. If my One got damaged, I wouldn't be happy but it wouldn't be the end or the world either.

    Laptots FTW.
     
    lotus49, Nov 25, 2008
    #8
  9. Andysan

    Andysan

    Joined:
    Jul 9, 2008
    Messages:
    272
    Likes Received:
    0
    Yeah, IMHO i don't see why Netbooks have to run Win 3.1 either...



    ;)
     
    Andysan, Nov 25, 2008
    #9
  10. Andysan

    Andysan

    Joined:
    Jul 9, 2008
    Messages:
    272
    Likes Received:
    0
    I've made the change as suggested, but my One is still playing me up. Most of the time it is very snappy, but every so often it will freeze and the windows turn to monotone. This can happen when the system is seemingly under no stress. It did it the other day when using Rhythmbox, and i only had Firefox open also (GNOMEDO and AWN in the background) and hadn't run out of RAM.

    Everything stops, even the clock - all i can do is nudge the mouse but its very unresponsive. The SSD light is also going crazy, but it doesn't happen when i would expect it to, when writing lots to the SSD for example - i don't understand why using Rhythmbox to play an MP3 would make it freeze up for 10 minutes. Surely i am not the only one suffering from this?

    I am going to knock Compiz down a notch and see if that makes a difference. :(
     
    Andysan, Nov 27, 2008
    #10
  11. Andysan

    blackest_knight

    Joined:
    Nov 13, 2008
    Messages:
    14
    Likes Received:
    0
    The dog slow SSD doesn't help, and 512 ram will at times be too small to hold all your running. Add the system monitor to your system and or run top in the shell to get an idea whats going on. generally when the system gets unresponsive its because the cpu is maxed out. It is probably best to increase the ram on the aspireone to 1 or 1.5 gb 1.5gb usually avoids any writes to the swap partition. Still won't stop the CPU getting maxed out but its still better than waiting for it paging ram in and out.
     
    blackest_knight, Nov 29, 2008
    #11
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.