Results 1 to 6 of 6

Thread: i want to pre-cache every file ...

  1. #1
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,525
    Distro
    Xubuntu 18.04 Bionic Beaver

    i want to pre-cache every file ...

    i want to pre-cache every file in /etc and /usr into RAM, on systems with more than enough to do so (8GB and more), and lock it in to stay there. i can read every file and that will get them into cache, but a lot of I/O buffering activity can bump a lot of that out. another idea was to copy them to a ramdisk, but that is just duplication and using a file means 2 copies of it will be in RAM. the goal is to have all the content of all these files to be in RAM, with a valid backing store to reload from in the rare event that a page gets modified by one process (the kernel reads in a new copy for all the other processes that have it mapped). i also want to prevent these pages from being discarded (being unmodified makes them easy to "steal" since no swapout is required) when buffering demand gets high. any suggestions? a reserved block of RAM might do this if there is a way to load mapped pages into it and make use of them there.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  2. #2
    Join Date
    Aug 2007
    Location
    Canada
    Beans
    458
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: i want to pre-cache every file ...

    You may need to create the directories etc and usr in RAM every time you system run, then copy the files and mount them before the system boot.
    Best, Gnusci

    "Never make a calculation until you know the answer." -- Wheeler, Spacetime Physics, pg 60.

  3. #3
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,525
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: i want to pre-cache every file ...

    like i mentioned in my original post, that would be duplication. there would be the copy in ramdisk,and the active cache copy when it gets run.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    14,601
    Distro
    Kubuntu Development Release

    Re: i want to pre-cache every file ...

    I think this would be difficult for /etc since it has to be available in single-user mode during boot. You'd probably have to create a custom initrd image as well. /usr might be more manageable since it is only mounted when the system goes multi-user.

    I doubt you'd see enormous performance improvements over using an SSD drive.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Aug 2016
    Location
    Wandering
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: i want to pre-cache every file ...

    All though I have not used this for a long time no, vmtouch seems like a good tool for the job.
    Usage:
    Code:
    vmtouch -dl /whatever/directory/
    Last edited by 1fallen; 1 Week Ago at 07:56 PM.
    With realization of one's own potential and self-confidence in one's ability, one can build a better world.
    Dalai Lama>>
    Code Tags

  6. #6
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,525
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: i want to pre-cache every file ...

    vmtouch looks like a nice simple tool that will save one component of development.

    what i am making may be booted from external media that i want to be able to remove or detach, ranging from an SD card to an AWS EC2 EBS virtual storage device.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

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
  •