January 23, 20251 yr 1 hour ago, VeixES said: Thank you for create script work and being source for really useful RAM-Disk for Docker logs. Would it be possible to extend(or separate script/plugin) this ram-disk support for the Plex dockers database folder. For me the remaining unneccesary writes to appdata are from plex mediaserver and they happen every 30 seconds constantly. It happens to specific file but ramdisking that whole folder would help. So far i havent figured out the root cause of those constant "modify" actions. all regular healtchecks and scheduled actions in plex are off. Thu Jan 23 19:14:48 2025 MODIFY /mnt/user/appdata/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/ com.plexapp.plugins.library.db-wal .... Thu Jan 23 19:16:18 2025 MODIFY /mnt/user/appdata/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/ com.plexapp.plugins.library.db-wal If its any similar to jellyfin, youre really out of luck . In jellyfin, as soon as a user is logged in(iirc correctly a firetv stick that tries to connect constantly also cause this, been a while since that device acted up), it constantly modifies the database. keeping tabs on on the user and playback and stuff like that. You could move your database in ram but while possible, its absolutely not recommended^^ Edit: if you *really* want to do this, well you would have to go with the manual modification from this thread and change the following lines PLEXPATH_HERE & DATABASE_PATH_HERE should be the plex folder, /mnt/user/appdata isnt needed to add, so just "/plex/database" /dev/shm/plexdb is just randomly chosen by me. All you would have to do is map the docker mapping for the database from /mnt/user/appdata/plex/database to /dev/shm/plexdb BUT BIG FAT BEWARE if your server goes off for any reason and is not properly shutdown, the database is gone. DO THIS AT YOUR OWN RISK # ------------------------------------------------- # RAM-Disk for Docker json/log files v1.6 for 7.0.0 # ------------------------------------------------- # check compatibility echo -e "5c359d63bcbd1e44299c8c9bafae7776 /etc/rc.d/rc.docker\n599b889ae544489329bfa813fd6e3765 /usr/local/emhttp/plugins/dynamix/scripts/monitor" | md5sum --check --status && compatible=1 if [[ $compatible ]]; then # create RAM-Disk on starting the docker service sed -i '/nohup/i \ # move json/logs to ram disk\ rsync -aH --delete /var/lib/docker/containers/ ${DOCKER_APP_CONFIG_PATH%/}/containers_backup\ mountpoint -q /var/lib/docker/containers || mount -t tmpfs tmpfs /var/lib/docker/containers || logger -t docker Error: RAM-Disk could not be mounted!\ rsync -aH --delete ${DOCKER_APP_CONFIG_PATH%/}/containers_backup/ /var/lib/docker/containers\ logger -t docker RAM-Disk created\ #PLEX-DB-Mod\ rsync -aH --delete ${DOCKER_APP_CONFIG_PATH%/}/PLEXPATH_HERE/DATABASE_PATH_HERE/ /dev/shm/plexdb\ logger -t Plex DB moved to RAM' /etc/rc.d/rc.docker # remove RAM-Disk on stopping the docker service sed -i '/tear down the bridge/i \ # backup json/logs and remove RAM-Disk\ rsync -aH --delete /var/lib/docker/containers/ ${DOCKER_APP_CONFIG_PATH%/}/containers_backup\ umount /var/lib/docker/containers || logger -t docker Error: RAM-Disk could not be unmounted!\ rsync -aH --delete ${DOCKER_APP_CONFIG_PATH%/}/containers_backup/ /var/lib/docker/containers\ logger -t docker RAM-Disk removed\ #PLEX-DB-Mod\ rsync -aH --delete /dev/shm/plexdb/ ${DOCKER_APP_CONFIG_PATH%/}/PLEXPATH_HERE/DATABASE_PATH_HERE\ logger -t Plex DB moved to Appdata' /etc/rc.d/rc.docker # Automatically backup Docker RAM-Disk sed -i '/^<?PHP$/a \ $sync_interval_minutes=30;\ if ( ! ((date("i") * date("H") * 60 + date("i")) % $sync_interval_minutes) && file_exists("/var/lib/docker/containers")) {\ exec("\ [[ ! -d /var/lib/docker_bind ]] && mkdir /var/lib/docker_bind\ if ! mountpoint -q /var/lib/docker_bind; then\ if ! mount --bind /var/lib/docker /var/lib/docker_bind; then\ logger -t docker Error: RAM-Disk bind mount failed!\ fi\ fi\ if mountpoint -q /var/lib/docker_bind; then\ rsync -aH --delete /var/lib/docker/containers/ /var/lib/docker_bind/containers && logger -t docker Success: Backup of RAM-Disk created.\ umount -l /var/lib/docker_bind\ else\ logger -t docker Error: RAM-Disk bind mount failed!\ fi\ ");\ }' /usr/local/emhttp/plugins/dynamix/scripts/monitor else logger -t docker "Error: RAM-Disk Mod found incompatible files: $(md5sum /etc/rc.d/rc.docker /usr/local/emhttp/plugins/dynamix/scripts/monitor | xargs)" fi Edited January 23, 20251 yr by Mainfrezzer
March 1, 20251 yr Can anyone confirm the script also works with 7.0.1? Edited March 1, 20251 yr by kennymc.c
March 1, 20251 yr I can already say that the script for 7/7.0.1 won't work with 7.1.0 when it comes out. The plugin will. Will edit this post with the 7.1.0 one when it comes out or at least the beta of it. # ------------------------------------------------- # RAM-Disk for Docker json/log files v1.6 for 7.1.0 # ------------------------------------------------- # check compatibility echo -e "c1b259ee25f4515c2bc9ad86139447aa /etc/rc.d/rc.docker\n599b889ae544489329bfa813fd6e3765 /usr/local/emhttp/plugins/dynamix/scripts/monitor" | md5sum --check --status && compatible=1 if [[ $compatible ]]; then # create RAM-Disk on starting the docker service sed -i '/nohup/i \ # move json/logs to ram disk\ rsync -aH --delete /var/lib/docker/containers/ ${DOCKER_APP_CONFIG_PATH%/}/containers_backup\ mountpoint -q /var/lib/docker/containers || mount -t tmpfs tmpfs /var/lib/docker/containers || logger -t docker Error: RAM-Disk could not be mounted!\ rsync -aH --delete ${DOCKER_APP_CONFIG_PATH%/}/containers_backup/ /var/lib/docker/containers\ logger -t docker RAM-Disk created' /etc/rc.d/rc.docker # remove RAM-Disk on stopping the docker service sed -i '/tear down the bridge/i \ # backup json/logs and remove RAM-Disk\ rsync -aH --delete /var/lib/docker/containers/ ${DOCKER_APP_CONFIG_PATH%/}/containers_backup\ umount /var/lib/docker/containers || logger -t docker Error: RAM-Disk could not be unmounted!\ rsync -aH --delete ${DOCKER_APP_CONFIG_PATH%/}/containers_backup/ /var/lib/docker/containers\ logger -t docker RAM-Disk removed' /etc/rc.d/rc.docker # Automatically backup Docker RAM-Disk sed -i '/^<?PHP$/a \ $sync_interval_minutes=30;\ if ( ! ((date("i") * date("H") * 60 + date("i")) % $sync_interval_minutes) && file_exists("/var/lib/docker/containers")) {\ exec("\ [[ ! -d /var/lib/docker_bind ]] && mkdir /var/lib/docker_bind\ if ! mountpoint -q /var/lib/docker_bind; then\ if ! mount --bind /var/lib/docker /var/lib/docker_bind; then\ logger -t docker Error: RAM-Disk bind mount failed!\ fi\ fi\ if mountpoint -q /var/lib/docker_bind; then\ rsync -aH --delete /var/lib/docker/containers/ /var/lib/docker_bind/containers && logger -t docker Success: Backup of RAM-Disk created.\ umount -l /var/lib/docker_bind\ else\ logger -t docker Error: RAM-Disk bind mount failed!\ fi\ ");\ }' /usr/local/emhttp/plugins/dynamix/scripts/monitor else logger -t docker "Error: RAM-Disk Mod found incompatible files: $(md5sum /etc/rc.d/rc.docker /usr/local/emhttp/plugins/dynamix/scripts/monitor | xargs)" fi Edited May 6, 20251 yr by Mainfrezzer 7.1 release
March 2, 20251 yr On 1/10/2025 at 7:38 AM, Mainfrezzer said: 7.0.0 # ------------------------------------------------- # RAM-Disk for Docker json/log files v1.6 for 7.0.0 # ------------------------------------------------- # check compatibility echo -e "5c359d63bcbd1e44299c8c9bafae7776 /etc/rc.d/rc.docker\n599b889ae544489329bfa813fd6e3765 /usr/local/emhttp/plugins/dynamix/scripts/monitor" | md5sum --check --status && compatible=1 if [[ $compatible ]]; then # create RAM-Disk on starting the docker service sed -i '/nohup/i \ # move json/logs to ram disk\ rsync -aH --delete /var/lib/docker/containers/ ${DOCKER_APP_CONFIG_PATH%/}/containers_backup\ mountpoint -q /var/lib/docker/containers || mount -t tmpfs tmpfs /var/lib/docker/containers || logger -t docker Error: RAM-Disk could not be mounted!\ rsync -aH --delete ${DOCKER_APP_CONFIG_PATH%/}/containers_backup/ /var/lib/docker/containers\ logger -t docker RAM-Disk created' /etc/rc.d/rc.docker # remove RAM-Disk on stopping the docker service sed -i '/tear down the bridge/i \ # backup json/logs and remove RAM-Disk\ rsync -aH --delete /var/lib/docker/containers/ ${DOCKER_APP_CONFIG_PATH%/}/containers_backup\ umount /var/lib/docker/containers || logger -t docker Error: RAM-Disk could not be unmounted!\ rsync -aH --delete ${DOCKER_APP_CONFIG_PATH%/}/containers_backup/ /var/lib/docker/containers\ logger -t docker RAM-Disk removed' /etc/rc.d/rc.docker # Automatically backup Docker RAM-Disk sed -i '/^<?PHP$/a \ $sync_interval_minutes=30;\ if ( ! ((date("i") * date("H") * 60 + date("i")) % $sync_interval_minutes) && file_exists("/var/lib/docker/containers")) {\ exec("\ [[ ! -d /var/lib/docker_bind ]] && mkdir /var/lib/docker_bind\ if ! mountpoint -q /var/lib/docker_bind; then\ if ! mount --bind /var/lib/docker /var/lib/docker_bind; then\ logger -t docker Error: RAM-Disk bind mount failed!\ fi\ fi\ if mountpoint -q /var/lib/docker_bind; then\ rsync -aH --delete /var/lib/docker/containers/ /var/lib/docker_bind/containers && logger -t docker Success: Backup of RAM-Disk created.\ umount -l /var/lib/docker_bind\ else\ logger -t docker Error: RAM-Disk bind mount failed!\ fi\ ");\ }' /usr/local/emhttp/plugins/dynamix/scripts/monitor else logger -t docker "Error: RAM-Disk Mod found incompatible files: $(md5sum /etc/rc.d/rc.docker /usr/local/emhttp/plugins/dynamix/scripts/monitor | xargs)" fi Nothing has changed since the beta 3 -> rc-2 script. Just reposting it as it supersedes the 6.12.14 one So are install instructions as follows -set up script in user scripts -run in background -stop docker -start docker -check logs for Ram Disk Created Is it any different if you're moving from 6.12->7.0.1, can you just paste the newer script into the existing userscript or should I delete it and start over?
May 6, 20251 yr 56 minutes ago, faxxe71 said: This script would need an update for 7.1.0 final try the plugin, this should work with 7.1.0 final.
June 19, 20251 yr 5 hours ago, faxxe71 said:I get an error with 7.1.4. 🤨 not compatible anymore?-thank you-faxxebetter using the plugin, this will work with 7.1.14 and get changes for newer version automaticly
June 26, 20251 yr For future people like me, who forgot about this completely and come back to this topic to read up on what's happened:This script is now "abandoned" and have instead been made into a plugin (Thank you Mainfrezzer!)Go to APPS, search for "ram-disk".Install "RAM-Disk for Docker logs" by Mainfrezzer.If you have the script from this thread in your go file. Go in there and delete it.If you have the script in your UserScripts. Go in there and either disable the schedule or delete the script.Reboot your server and go to SETTINGS / RAM-DISK for Docker logs. Here you can see if it is running as it should and you can edit the backup schedule.This is the new forum thread for the plugin: https://forums.unraid.net/topic/185193-plugin-ram-disk-for-docker-logs/And this is the GitHub for the plugin: https://github.com/Mainfrezzer/unRAID-RAM-Disk
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.