guysoft / FullPageOS

A raspberrypi distro to display a full page browser on boot
GNU General Public License v3.0
3.89k stars 241 forks source link

Write chromium cache to ramdisk to protect sd card #121

Open monotek opened 7 years ago

monotek commented 7 years ago

Imho the chromium cache should be written to a small ramdisk.

Depending on the website you're opening chromium can destroy you sd card really fast because of excessive caching and therefore a lot of reads / writes.

Imho there are 3 options:

1.) Use command line option for cache dir in cache size in bytes: mkdir /run/user/1000/chromium chromium-brwoser --disk-cache-dir=/run/user/1000/chromium --disk-cache-size=50000000

2.) User some kind of overlay fs ramdisk for /hom/pi or at least /home/pi/cache

Optionally logging syslogs to /var/log could be disabled too.

3.) Run raspbian in readonly mode and put all stuff which needs to write to a ramdisk like described in: https://hallard.me/raspberry-pi-read-only/

frafrichile commented 7 years ago

is this what you are referring to ? Why do I see so many chromium lines? chromium

guysoft commented 7 years ago

@monotek 1) You could do that, would consider a pull request as long as it does not break anything else 2) That is non-standard behavior if users want to change stuff in the OS, you are welcome to build a variant. 3) Same as 2

@frafrichile That is normal, see: https://askubuntu.com/questions/19881/why-does-chrome-have-so-many-processes-on-my-machine "Having multiple processes is a normal behavior of Chrome/Chromium. futex_wait_queue_me or poll_schedule_timeout status for those processes seems okay."

SManAT commented 7 years ago

I did the following with firefox (chromium the same)

#/etc/fstab
tmpfs   /home/pi/.cache/mozilla tmpfs   defaults,noatime,nosuid,mode=0755,size=60m      0 0

Cache is then stored to RAM .... sry dont work had to work over it .... greetz

esaruoho commented 7 years ago

@monotek how do i check if the SD card is about to break? we run a dashboard running 24/7, just fiddled a reboot into the crontab and hopefully it'll reboot at midnight from now on - the display seemed to crash every few days, got tired of rebooting the raspi just to get fullpageos back to work(and i can't be doing that since i'm away on vacation for 2 weeks)

guysoft commented 7 years ago

@esaruoho That is a different issue. Some pages crash after a time. Yon can try disabling the graphical acceleration, that helps sometimes.

Also, changing the images to read only and ramdisk stuff might be easier to code now since FullPageOS uses CustomPiOS, and changes could be done there.