Page 1 of 1

THIS WILL HELP EVERYONE

PostPosted: Fri Nov 28, 2008 9:08 pm
by rajiv_kuin
Now i was about to sleep but feel guilty asking so many questions and giving nothing back to community... here is my contribution

My server used to consume like 3 GB of RAM in one hours calling and i was surprised, what possibly can be wrong as the number of agent and calls remain the same... but its caching that used most of the stuff... so i used this as a cron job to run every 20 minutes... i never use more than 7000 MB of RAM even with 30 Agents now.... I did not find any adverse effect of the same on my system... i face problems but none is new one... they are same i faced before i started to use this scripts... so i am sure this will benefit all...

#### Flush cache after every 20 minutes
29,59 * * * 1,2,3,4,5,6,7 sync; echo 3 > /proc/sys/vm/drop_caches

Works on CentOS 5 if does not work on other distros get soemthing similar.. idea is to flush the cache on a fixed time period....

PostPosted: Sat Nov 29, 2008 8:18 am
by mflorell
Thanks for posting this, although I've never had an issue with using all RAM because all of the apps usually can handle that with no problem, although I have heard it can sometimes be an issue with CentOS(which I recomment NOT using).

PostPosted: Sat Nov 29, 2008 1:49 pm
by williamconley
also, if you ever get into sql, believe it or not it tries to eat memory. it marks it as usable but will cache it so it can easily re-access it to save time in case it needs to access that particular part of a record set again. over time it will consume most of the memory available, but will release it upon request. so what looks like memory hog is actually sql optimization. i'm not sure if mysql does this as well, but i was very surprised to find out that a poorly operating MSSQL install was SUPPOSED to eat memory, and the ultimate reason it was operating poorly was a dying mirror drive entirely unrelated to lack of memory available. after replacing the drive (well, actually i just turned off mirroring to test the theory) the system was acting quite normal, and ate its memory over a period of a couple days with no adverse effect. it always released enough cache to allow the system to operate, but kept pieces of the database in cache to speed up database operations. forcing it to release the cache early probably won't have much of an effect except to de-optimize database operations with repeated calls to the same data set.

Re: THIS WILL HELP EVERYONE

PostPosted: Mon Dec 01, 2008 1:59 am
by gardo
What's the output of "free -m" before you run the flush cache command? Unless you have a "rogue" application hogging the memory, it's Linux's efficient memory management you're seeing working. Linux cache's unused memory so that it can easily be retrieved. You can check this link for more information:

http://www.linuxhowtos.org/System/Linux ... gement.htm

rajiv_kuin wrote:Now i was about to sleep but feel guilty asking so many questions and giving nothing back to community... here is my contribution

My server used to consume like 3 GB of RAM in one hours calling and i was surprised, what possibly can be wrong as the number of agent and calls remain the same... but its caching that used most of the stuff... so i used this as a cron job to run every 20 minutes... i never use more than 7000 MB of RAM even with 30 Agents now.... I did not find any adverse effect of the same on my system... i face problems but none is new one... they are same i faced before i started to use this scripts... so i am sure this will benefit all...

#### Flush cache after every 20 minutes
29,59 * * * 1,2,3,4,5,6,7 sync; echo 3 > /proc/sys/vm/drop_caches

Works on CentOS 5 if does not work on other distros get soemthing similar.. idea is to flush the cache on a fixed time period....