Jump to content

Can cache be run from ram?


Recommended Posts

Posted

Wondering how to do that.. well i have 32GB RAM server and could put 1GB for xcache... hack it would be a lot faster... But question is how to..

  • 2 weeks later...
Posted

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

Posted

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
Posted

I'll read up on that, thanks.

not committing to any particular setup yet, want to really study the setups and how to recover if anything goes bad.

Posted

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.

Archived

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

  • Recently Browsing   0 members

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