Linux speed up by moving files to ramdisk at start












3














I have more than enough ram in my computer (8GB), which hardly gets used. In the most cases my desktop and apps use up in 2-3GBs out of it, on the other hand I do not have an SSD.



My system is 64bit Debian Wheezy.



I wonder if there is any framework which copy regularly used files like thunderbird, firefox, openoffice, vlc, pidgin to a ramdisk at every start to speed up access.



This is obviously doable by with an init shellscript after each boot then have symlinks setup for those files later on but maybe there is a complete solution to do this already...



Question2:



Are there any optimizations for the linux kernel (3.14) which can take advantage of large amount of memory better than a stock kernel? If so what are those?



Question3:



In this case disabling swap partition completely is a good idea right?



Thanks










share|improve this question













migrated from serverfault.com Oct 3 '14 at 12:10


This question came from our site for system and network administrators.















  • Buying an SSD is much easier. And they're pretty cheap now.
    – Michael Hampton
    Oct 3 '14 at 15:41
















3














I have more than enough ram in my computer (8GB), which hardly gets used. In the most cases my desktop and apps use up in 2-3GBs out of it, on the other hand I do not have an SSD.



My system is 64bit Debian Wheezy.



I wonder if there is any framework which copy regularly used files like thunderbird, firefox, openoffice, vlc, pidgin to a ramdisk at every start to speed up access.



This is obviously doable by with an init shellscript after each boot then have symlinks setup for those files later on but maybe there is a complete solution to do this already...



Question2:



Are there any optimizations for the linux kernel (3.14) which can take advantage of large amount of memory better than a stock kernel? If so what are those?



Question3:



In this case disabling swap partition completely is a good idea right?



Thanks










share|improve this question













migrated from serverfault.com Oct 3 '14 at 12:10


This question came from our site for system and network administrators.















  • Buying an SSD is much easier. And they're pretty cheap now.
    – Michael Hampton
    Oct 3 '14 at 15:41














3












3








3







I have more than enough ram in my computer (8GB), which hardly gets used. In the most cases my desktop and apps use up in 2-3GBs out of it, on the other hand I do not have an SSD.



My system is 64bit Debian Wheezy.



I wonder if there is any framework which copy regularly used files like thunderbird, firefox, openoffice, vlc, pidgin to a ramdisk at every start to speed up access.



This is obviously doable by with an init shellscript after each boot then have symlinks setup for those files later on but maybe there is a complete solution to do this already...



Question2:



Are there any optimizations for the linux kernel (3.14) which can take advantage of large amount of memory better than a stock kernel? If so what are those?



Question3:



In this case disabling swap partition completely is a good idea right?



Thanks










share|improve this question













I have more than enough ram in my computer (8GB), which hardly gets used. In the most cases my desktop and apps use up in 2-3GBs out of it, on the other hand I do not have an SSD.



My system is 64bit Debian Wheezy.



I wonder if there is any framework which copy regularly used files like thunderbird, firefox, openoffice, vlc, pidgin to a ramdisk at every start to speed up access.



This is obviously doable by with an init shellscript after each boot then have symlinks setup for those files later on but maybe there is a complete solution to do this already...



Question2:



Are there any optimizations for the linux kernel (3.14) which can take advantage of large amount of memory better than a stock kernel? If so what are those?



Question3:



In this case disabling swap partition completely is a good idea right?



Thanks







linux debian ramdisk






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 3 '14 at 10:49







naturelle











migrated from serverfault.com Oct 3 '14 at 12:10


This question came from our site for system and network administrators.






migrated from serverfault.com Oct 3 '14 at 12:10


This question came from our site for system and network administrators.














  • Buying an SSD is much easier. And they're pretty cheap now.
    – Michael Hampton
    Oct 3 '14 at 15:41


















  • Buying an SSD is much easier. And they're pretty cheap now.
    – Michael Hampton
    Oct 3 '14 at 15:41
















Buying an SSD is much easier. And they're pretty cheap now.
– Michael Hampton
Oct 3 '14 at 15:41




Buying an SSD is much easier. And they're pretty cheap now.
– Michael Hampton
Oct 3 '14 at 15:41










3 Answers
3






active

oldest

votes


















2















any framework which copy regularly used files




Simply cat'ing them into /dev/null will populate the VFS cache. But this degrades even in the absence of any further I/O or memory demand. If it were me, I might consider creating a tmpfs then creating a unionfs with the storage device filesystem containing the content to cache - rather than messing around with symlinks (but you still need to populate it.



A much simpler solution would be to use the tmpfs as a bcache device. (but make sure you destroy and rebuild the bcache during the startup sequence).



Question 2: there are things you can do to tune the VFS, but I suspect they won't have much impact.



Qusetion 3: Absolutely not - you'll get best usage out of any caching if you preserve it between power cycles - i.e. using hibernate-to-disk rather than a shutdown/restart - and this (normally) uses swap.






share|improve this answer































    1














    There are different readahead programs for Linux, which pre-fetch disk memory.
    They are called e.g. readahead-fedora and preload.



    The was also systemd-readahead for systemd-based init systems, but it was removed again in more recent versions.






    share|improve this answer























    • The above link is dead. I assume it's because systemd's readahead implementation has been removed.
      – Eric Seastrand
      12 hours ago



















    0















    In this case disabling swap partition completely is a good idea right?




    Yes, you may move your swap from HDD/SDD to RAM. The latest Linux kernels include ZRAM module inside, so you may use your swap in RAM. That will give you much better speed of swapping operations, but will in some times increase CPU load.



    You may read about it on https://wiki.debian.org/ZRam






    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f159048%2flinux-speed-up-by-moving-files-to-ramdisk-at-start%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown
























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2















      any framework which copy regularly used files




      Simply cat'ing them into /dev/null will populate the VFS cache. But this degrades even in the absence of any further I/O or memory demand. If it were me, I might consider creating a tmpfs then creating a unionfs with the storage device filesystem containing the content to cache - rather than messing around with symlinks (but you still need to populate it.



      A much simpler solution would be to use the tmpfs as a bcache device. (but make sure you destroy and rebuild the bcache during the startup sequence).



      Question 2: there are things you can do to tune the VFS, but I suspect they won't have much impact.



      Qusetion 3: Absolutely not - you'll get best usage out of any caching if you preserve it between power cycles - i.e. using hibernate-to-disk rather than a shutdown/restart - and this (normally) uses swap.






      share|improve this answer




























        2















        any framework which copy regularly used files




        Simply cat'ing them into /dev/null will populate the VFS cache. But this degrades even in the absence of any further I/O or memory demand. If it were me, I might consider creating a tmpfs then creating a unionfs with the storage device filesystem containing the content to cache - rather than messing around with symlinks (but you still need to populate it.



        A much simpler solution would be to use the tmpfs as a bcache device. (but make sure you destroy and rebuild the bcache during the startup sequence).



        Question 2: there are things you can do to tune the VFS, but I suspect they won't have much impact.



        Qusetion 3: Absolutely not - you'll get best usage out of any caching if you preserve it between power cycles - i.e. using hibernate-to-disk rather than a shutdown/restart - and this (normally) uses swap.






        share|improve this answer


























          2












          2








          2







          any framework which copy regularly used files




          Simply cat'ing them into /dev/null will populate the VFS cache. But this degrades even in the absence of any further I/O or memory demand. If it were me, I might consider creating a tmpfs then creating a unionfs with the storage device filesystem containing the content to cache - rather than messing around with symlinks (but you still need to populate it.



          A much simpler solution would be to use the tmpfs as a bcache device. (but make sure you destroy and rebuild the bcache during the startup sequence).



          Question 2: there are things you can do to tune the VFS, but I suspect they won't have much impact.



          Qusetion 3: Absolutely not - you'll get best usage out of any caching if you preserve it between power cycles - i.e. using hibernate-to-disk rather than a shutdown/restart - and this (normally) uses swap.






          share|improve this answer















          any framework which copy regularly used files




          Simply cat'ing them into /dev/null will populate the VFS cache. But this degrades even in the absence of any further I/O or memory demand. If it were me, I might consider creating a tmpfs then creating a unionfs with the storage device filesystem containing the content to cache - rather than messing around with symlinks (but you still need to populate it.



          A much simpler solution would be to use the tmpfs as a bcache device. (but make sure you destroy and rebuild the bcache during the startup sequence).



          Question 2: there are things you can do to tune the VFS, but I suspect they won't have much impact.



          Qusetion 3: Absolutely not - you'll get best usage out of any caching if you preserve it between power cycles - i.e. using hibernate-to-disk rather than a shutdown/restart - and this (normally) uses swap.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 6 '14 at 8:43

























          answered Oct 3 '14 at 12:35









          symcbean

          2,27911121




          2,27911121

























              1














              There are different readahead programs for Linux, which pre-fetch disk memory.
              They are called e.g. readahead-fedora and preload.



              The was also systemd-readahead for systemd-based init systems, but it was removed again in more recent versions.






              share|improve this answer























              • The above link is dead. I assume it's because systemd's readahead implementation has been removed.
                – Eric Seastrand
                12 hours ago
















              1














              There are different readahead programs for Linux, which pre-fetch disk memory.
              They are called e.g. readahead-fedora and preload.



              The was also systemd-readahead for systemd-based init systems, but it was removed again in more recent versions.






              share|improve this answer























              • The above link is dead. I assume it's because systemd's readahead implementation has been removed.
                – Eric Seastrand
                12 hours ago














              1












              1








              1






              There are different readahead programs for Linux, which pre-fetch disk memory.
              They are called e.g. readahead-fedora and preload.



              The was also systemd-readahead for systemd-based init systems, but it was removed again in more recent versions.






              share|improve this answer














              There are different readahead programs for Linux, which pre-fetch disk memory.
              They are called e.g. readahead-fedora and preload.



              The was also systemd-readahead for systemd-based init systems, but it was removed again in more recent versions.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited 9 mins ago

























              answered Oct 6 '14 at 9:22









              jofel

              20.1k34780




              20.1k34780












              • The above link is dead. I assume it's because systemd's readahead implementation has been removed.
                – Eric Seastrand
                12 hours ago


















              • The above link is dead. I assume it's because systemd's readahead implementation has been removed.
                – Eric Seastrand
                12 hours ago
















              The above link is dead. I assume it's because systemd's readahead implementation has been removed.
              – Eric Seastrand
              12 hours ago




              The above link is dead. I assume it's because systemd's readahead implementation has been removed.
              – Eric Seastrand
              12 hours ago











              0















              In this case disabling swap partition completely is a good idea right?




              Yes, you may move your swap from HDD/SDD to RAM. The latest Linux kernels include ZRAM module inside, so you may use your swap in RAM. That will give you much better speed of swapping operations, but will in some times increase CPU load.



              You may read about it on https://wiki.debian.org/ZRam






              share|improve this answer


























                0















                In this case disabling swap partition completely is a good idea right?




                Yes, you may move your swap from HDD/SDD to RAM. The latest Linux kernels include ZRAM module inside, so you may use your swap in RAM. That will give you much better speed of swapping operations, but will in some times increase CPU load.



                You may read about it on https://wiki.debian.org/ZRam






                share|improve this answer
























                  0












                  0








                  0







                  In this case disabling swap partition completely is a good idea right?




                  Yes, you may move your swap from HDD/SDD to RAM. The latest Linux kernels include ZRAM module inside, so you may use your swap in RAM. That will give you much better speed of swapping operations, but will in some times increase CPU load.



                  You may read about it on https://wiki.debian.org/ZRam






                  share|improve this answer













                  In this case disabling swap partition completely is a good idea right?




                  Yes, you may move your swap from HDD/SDD to RAM. The latest Linux kernels include ZRAM module inside, so you may use your swap in RAM. That will give you much better speed of swapping operations, but will in some times increase CPU load.



                  You may read about it on https://wiki.debian.org/ZRam







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 3 '14 at 16:26









                  ihor_dvoretskyi

                  1,713913




                  1,713913






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f159048%2flinux-speed-up-by-moving-files-to-ramdisk-at-start%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      サソリ

                      広島県道265号伴広島線

                      Setup Asymptote in Texstudio