dram

- decentralized remotely accessed memory
git clone git://git.acid.vegas/dram.git
Log | Files | Refs | Archive | README

README.md (2453B)

      1 # Decentralized Remotely Accessed Memory
      2 
      3 Ever joked about [downloading more RAM](https://downloadmoreram.com/)? 🤣 WELL NOW YOU CAN MOTHER FUCKER!
      4 
      5 **Here's the deal:** we use a [tmpfs](https://en.wikipedia.org/wiki/Tmpfs) on the donor machine to pretend a chunk of its RAM is a hard drive. Then, we get fancy with [NFS](https://en.wikipedia.org/wiki/Network_File_System) to share this faux-drive over the network 🌐. On the recipient's side, we mount this networked RAM-drive and set up a swap file.
      6 
      7 Go insane with it & donate RAM from multiple machines...decentralize the RAM of a single server all over the planet! Latency is the devil 😈 LOL
      8 
      9 ## The make-it-happen Magic
     10 #### Setup RAM Donator
     11 1. Create an entry in `/etc/fstab` to create the RAM partition:
     12 
     13 `tmpfs /mnt/ramote_send tmpfs nodev,nosuid,noexec,nodiratime,size=1G 0 0`
     14 
     15 **Note:** Change `1G` to the amount of RAM you want to donate.
     16 
     17 2. Create the RAM partition directory & mount it:
     18 
     19 ```bash
     20 mkdir -p /mnt/ramote_send
     21 mount /mnt/ramote_send
     22 ```
     23 
     24 3. Download & install an NFS server daemon of your choice:
     25 
     26 ```bash
     27 apt-get install nfs-kernel-server
     28 ```
     29 
     30 4. Configure & start the NFS server:
     31 - Edit your `/etc/exports` file:
     32 
     33 `/mnt/ramote_send <client-ip>(rw,sync,no_root_squash,no_subtree_check)`
     34 
     35 - Start & enable the service:
     36 
     37 ```bash
     38 systemctl start nfs-kernel-server
     39 systemctl enable nfs-kernel-server
     40 ```
     41 
     42 ---
     43 
     44 #### Setup RAM Receiver
     45 1. Create a directory & mount the NFS:
     46 
     47 ```bash
     48 mkdir -p /mnt/ramote_recv
     49 mount <nfs-server-ip>:/mnt/ramote_send /mnt/ramote_recv
     50 ```
     51 
     52 2. Create & enable a swap file inside the NFS directory:
     53 ```bash
     54 dd if=/dev/zero of=/mnt/ramote_recv/swapfile bs=1M count=1024
     55 chmod 600 /mnt/ramote_recv/swapfile
     56 mkswap /mnt/ramote_recv/swapfile
     57 swapon /mnt/ramote_recv/swapfile
     58 ```
     59 
     60 **Note:** Change the swap file size according to what you allocated on the donator.
     61 
     62 3. Create an entry in `/etc/fstab` to for the NFS mount & the swap file:
     63 
     64 ```
     65 <nfs-server-ip>:/mnt/ramote_send /mnt/ramote_recv nfs defaults 0 0
     66 /mnt/ramote_recv/swapfile swap swap defaults 0 0
     67 ```
     68 
     69 You can do this across various machines & use multiple swap files for decentralize even more.
     70 
     71 ___
     72 
     73 ###### Mirrors for this repository: [acid.vegas](https://git.acid.vegas/dram) • [SuperNETs](https://git.supernets.org/acidvegas/dram) • [GitHub](https://github.com/acidvegas/dram) • [GitLab](https://gitlab.com/acidvegas/dram) • [Codeberg](https://codeberg.org/acidvegas/dram)