3

We are running Ubuntu version on AWS EC2 instance for one of our production server. Issues is Memory is getting utilized fully and our website which is hosted in this server is freezing. When i checked its CPU utilization, It is so normal at below 40% but when i SSHed in to the instance and checked free -h

total       used       free     shared    buffers     cached
Mem:          3.9G       3.2G       640M        64M       394M       1.4G
-/+ buffers/cache:       1.4G       2.4G
Swap:           0B         0B         0B

As soon as i run echo 3 > /proc/sys/vm/drop_caches my site will come up fine but i have to run this command every hour to keep my site live. I can set up a cron for doing this but i want to know what is the issue and how we can resolve it?

0

By dropping cache you decrease performance, caching data in RAM makes system faster (RAM is faster than HDD/SSD). But if any application needs more RAM, then cache is automatically released. Check this: http://www.linuxatemyram.com/

Look at -/+ buffers/cache: you have free 1.4GB in RAM

  • Thanks for the link. I want to understand why my free ram is getting to 18 - 20 some time that time i need to drop the cache for my site to work. Also can you let me know where exactly / How can i see the cached pages? – dee flor Apr 3 '17 at 7:25
  • You have to look at -/+ buffers/cache for free ram, free column gives you a value with cache, but cache is released if needed. To be honest I dont know how can you see cached pages. But you can try this linuxatemyram.com/play.html there is program in C and if you run it, you will see that cache will be released and program will allocate more RAM. So is your page really slow if you have RAM full of cache? – tomsk Apr 3 '17 at 7:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.