I've noticed that when I'm streaming videos over my wireless network that after a short period of time watching, and/or after transferring a large file from my hda, that the transfers slow significantly (ie., slow transfers or stalled video streaming).
One thing that seems to solve the problem is clearing the cache from my ram using the following:
Code: Select all
sync; echo 3 > /proc/sys/vm/drop_caches
This seems to speed the system right back up, so I don't think it's a network issue. Got the code from here :
http://www.scottklarr.com/topic/134/lin ... om-memory/
MY QUESTION IS:
Does anyone know how to insert this into a bash script that would clear the cache when it reaches a certain percentage of ram usage (eg.,50%)? That way I could insert the script at startup and keep my speed all spiffy and shiny like new!!!
Example equation (logic):
Code: Select all
#! /bin/bash
IF="% of cache using ram >/=50%" THEN="sync; echo 3 > /proc/sys/vm/drop_caches"
I know the code is nowhere near correct
but the logic is simple enough.
P.S. I've got plenty of ram (4x1gb) so I'm certain I'm not the only one (at least I think...) that experiences this, plenty of other Amahi users would benefit greatly from a solution to this!!
Headless HDA: Fedora 12, AMDx2 3800+, 4gb DDR 3200, 40gb HDD (Boot & 8.4gb Swap, mounted at "/boot"), 2x1tb 7200rpm HDD SoftwareRaid-0 (mounted at "/"). Linksys WRT54G v.5, 100mbit LAN to HDA. WLAN clients: Macbook 2,1 OSX 10.6.2; Windows XP SP3. Comcast 15mbit.