Jump to content

Can cache be run from ram?


Recommended Posts

  • 2 weeks later...

firt i would copy all file to some place, make a ram disk and copy files back, i would also copy/sync files to a disk periodically
for the ram disk in cache dir i would use a bind mount..

however im still wondering how useful is this, SO fs cache should take care of this files

Link to comment
Share on other sites

well i dont think this can be a good idea, but here you go:

$ sudo mount -t tmpfs -o size=123m none /mnt/boot-sav/
$ mount
none on /mnt/boot-sav type tmpfs (rw,size=123m)

$ dd bs=1M count=100 if=/dev/zero of=/mnt/boot-sav/test conv=fdatasync
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.126435 s, 829 MB/s

$ dd bs=1M count=100 if=/dev/zero of=/home/user/test conv=fdatasync
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 2.07991 s, 50.4 MB/s

then i would COPY this directory and bind mount it in ramdisk, after that, rsync files from cacheInDisk to cache (ramdisk)
afterwards this should be done in the opposite way periodically to not loose anything and survive reboots without human intervention, and (not sure how) have the board survive with/without cache mounted in ram

also someone already took care of most of this, check: https://github.com/graysky2/anything-sync-daemon
Link to comment
Share on other sites

It would be better/more sane to just use APC and up the SHM size a bit.

Also, when you have so much memory available, it's not all just sitting there unused.

Your free memory is used for disk caching. Meaning, files that are frequently used are already likely loaded into RAM.

So a ramdisk can actually give you no benefit while just introducing a risk of data loss.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...