Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: redirect cache to SSD swap

  1. #1
    Join Date
    Apr 2007
    Beans
    281
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question redirect cache to SSD swap

    hi, I'm planning to use a SSD(a cache drive) for swap purposes, storing the cache in a swap partition inside the SSD, but I cannot find any means of specifically redirecting the cache to swap, is there any way to do this?
    .:it's all about true or false, so be true to life:.
    linux community is the best
    ubuntu ftw <3

  2. #2
    Join Date
    Jul 2006
    Location
    Castrum, Germania Secunda
    Beans
    1,071

    Re: redirect cache to SSD swap

    I'm not sure what you aim to achieve by this.... An SSD is unfit for intensive swap usage. Maybe you'll find this complete how-to for SSD's useful:
    https://sites.google.com/site/easylinuxtipsproject/ssd

    Good luck!

  3. #3
    Join Date
    Apr 2007
    Beans
    281
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: redirect cache to SSD swap

    thanks Pjotr123, it might be best to just set the SSD partition as swap and forget about everything else, but just for the fun of it, I would like to say to the OS to use the SSD partition for cache, so the RAM has more space for the applicacions and system data, I know this is a weird one but I would like to do some testing and see if it helps somehow, thanks for the link I find it very useful, I already followed some of the advices here: http://vasilisc.com/speedup_ubuntu_eng they are also helpful
    .:it's all about true or false, so be true to life:.
    linux community is the best
    ubuntu ftw <3

  4. #4
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: redirect cache to SSD swap

    Quote Originally Posted by smo0th View Post
    it might be best to just set the SSD partition as swap and forget about everything else, but just for the fun of it, I would like to say to the OS to use the SSD partition for cache, so the RAM has more space for the applicacions and system data
    This 'cache' that you are talking about is swap. There is nothing more you can do than setting up swap on your SSD.
    Cheesemill

  5. #5
    Join Date
    Jul 2006
    Location
    Castrum, Germania Secunda
    Beans
    1,071

    Re: redirect cache to SSD swap

    As Cheesemill says. You might *increase* the swappiness, but that's rather perverse for an SSD, as it'll kill it long before it's normal life span has ended. And it probably even won't make your system any faster....

    Increasing the RAM amount makes much more sense. And it's quite safe.

    About acceleration tips in general: you nearly always pay a price. In reduced features, in worse looks or even in reduced stability or shortened life span. You should realize that.

    If you're smart, you'll only consider safe tweaks that will "merely" reduce features or looks. Speed increase at the price of reduced stability or shortened life span is "fools' gold".

    For your information: I've collected a couple of safe tweaks to increase speed: https://sites.google.com/site/easyli...sproject/speed

  6. #6
    Join Date
    Apr 2007
    Beans
    281
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: redirect cache to SSD swap

    thanks Pjotr123, your answer is quite reasonable, so far I have only done safe tweaks

    hi Cheesemill, sorry I didn'tmake clear enough, by cache I mean the memory portion allocated in RAM which is just that, if you use htop, there are 3 colors for the RAM, green is the one used by processes, blue is the one used for buffers and yellow is the one for cache, I have noticed that when the green and blue grow, the yellow just dissapears not being allocated in swap, this is why I would like to send all the cache to swap, as far as I know swap is a copy of what runs in the RAM, so eventually the cache being used would be transfered to RAM and run from there, read/write access time is far faster in a SSD than in a spinning mechanism, so I think that could help somehow in the overall performance
    .:it's all about true or false, so be true to life:.
    linux community is the best
    ubuntu ftw <3

  7. #7
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: redirect cache to SSD swap

    Quote Originally Posted by smo0th View Post
    hi, I'm planning to use a SSD(a cache drive) for swap purposes, storing the cache in a swap partition inside the SSD, but I cannot find any means of specifically redirecting the cache to swap, is there any way to do this?
    hi
    no good idea. this will slow down your box extreamly. but you can write a little shell script which runs - lets say all 10 minutes with following contens.

    sync
    # echo 3 > /proc/sys/vm/drop_caches
    # 1 --> free pagecaches, 2 --> free dentries and inodes,3 --> free all

    cheers
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  8. #8
    Join Date
    Apr 2007
    Beans
    281
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: redirect cache to SSD swap

    thanks rnerwein, that is indeed a good advice, thank you all for your answers on this thread, merry christmas!!
    .:it's all about true or false, so be true to life:.
    linux community is the best
    ubuntu ftw <3

  9. #9
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,510
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: redirect cache to SSD swap

    Quote Originally Posted by smo0th View Post
    hi Cheesemill, sorry I didn'tmake clear enough, by cache I mean the memory portion allocated in RAM which is just that, if you use htop, there are 3 colors for the RAM, green is the one used by processes, blue is the one used for buffers and yellow is the one for cache, I have noticed that when the green and blue grow, the yellow just dissapears not being allocated in swap, this is why I would like to send all the cache to swap, as far as I know swap is a copy of what runs in the RAM, so eventually the cache being used would be transfered to RAM and run from there, read/write access time is far faster in a SSD than in a spinning mechanism, so I think that could help somehow in the overall performance
    Why do people continually believe that they can manage system resources better than people who been specialising in this area for decades?

    The "cache" exists to utilise RAM that would otherwise be wasted doing nothing by speculatively retaining disk sectors *in case* they might be needed again, as other more important system components require RAM it is reallocated and disk data that may have been cached has to be transferred directly from the (slower) disk storage.

    It is pointless - and basically stupid - to dump cached disk blocks that may never be used to swap (or anywhere). Swap exists to store data that *must* exist in VM and is deemed more efficient to be in that location rather than main RAM.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  10. #10
    Join Date
    Apr 2007
    Beans
    281
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: redirect cache to SSD swap

    thanks David, that was a real good explanation on this subject, I understand your feelings about hordes of people thinking that they can do better, I fully and deeply respect linux contributors since Torvalds, this thread gives me a better picture of what I googled so far and this is why I love this forums, now I know what to do with my SSD, definitely not the idea I had thanks!
    .:it's all about true or false, so be true to life:.
    linux community is the best
    ubuntu ftw <3

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •