OT: Raspberry Pi - problem s cached

Jiří Nesvačil nesvacil na posys.eu
Čtvrtek Říjen 20 10:58:03 CEST 2016


Zdravim,

cache a jeji optimalizace je radost sama pro sebe, zacnete par prikazy na zjisteni okdud to pochazi, pote muzete optimalizovat ...
viz priklady nize, muj notes s cache ...

cat /proc/swaps

apt-get install install sysstat

#pro zobrazeni symbolu vmstat -s
vmstat -d
iostat -d

apt-get install install iotop
iotop -ob


#seznam otevrenych souboru k zapisu
lsof | grep -e "[[:digit:]]\+w"

#seznam operaci, ktere se s diskem provadi
fatrace


#trace co program vola
strace ls ci jiny program


#nebo jednoduse zmeny
find / -xdev -mmin -600000 -ls

--------------------------- swap
#Avoid heavy use of Swap Space

#/etc/sysctl.conf

#Reduce logging writes
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0


#Mount even more directories with heavy I/O to tmpfs
#For example mount the WordPress cache directory from disk to tmpfs:
tmpfs /full/path/to/wp-content/cache tmpfs defaults, size=1G 0 0

#Disable journaling on an ext4 filesystem. Na unmount systemu
tune4fs -O ^has_journal /dev/sdXY
e4fsck –f /dev/sdXY
sudo reboot

#I/O Scheduler
#Consider switching from the CFQ to NOOP or Deadline. Both offer better performance on SSDs and SD cards.
#Check which scheduler you are using with the following command (replace sdX):
cat /sys/block/sdX/queue/scheduler


#TRIM allows Linux to inform the SSD which blocks of data are no longer considered in use. Therefore, when you delete a file, your SSD is now able to write data to blocks as if it they were brand new without having to perform the cumbersome deletion 
process. In essence, TRIM makes sure that your SSD’s performance doesn’t degrade too much with use.
#Check if your SSD or SD card supports TRIM:
sudo hdparm -I /dev/sda | grep "TRIM supported"
#If it does, then add TRIM as a daily cron job:
echo -e "#\x21/bin/sh\\nfstrim -v /" | sudo tee /etc/cron.daily/trim


Jirka
Dne 20. 10. 2016 v 9:35 Milos Sula napsal(a):
> Zdravim,
>
> zprovoznil jsem na Pi motion s kamerou , ale po 24 hodinach to zacina pouzivat i swap cemuz se chci vyhnout. Zda se mi ze cached je zbytecne neumerne velka ( 264MB ) vuci volne pameti ( 25MB ).
> Nevite jak to nastavit ? Myslel jsem si ze s ubyvajici volnou pameti system automaticky zmensi cached a uvolni tak pamet.
>
> pi na raspberrypi:~ $ free
>             total      used        free        shared buffers cached
> Mem:        380136     355096      25040       4368 27932 264620
> -/+ buffers/cache:      62544     317592
> Swap:       102396         56     102340
>
> Milos
>
> _______________________________________________
> HW-list mailing list  -  sponsored by www.HW.cz
> Hw-list na list.hw.cz
> http://list.hw.cz/mailman/listinfo/hw-list



Další informace o konferenci Hw-list