LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-25-2014, 01:01 PM   #1
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Rep: Reputation: Disabled
sync; echo 3 > /proc/sys/vm/drop_caches?


I'm pretty sure we all know that this is a bad idea on a production server as it would only cause the cpu load to go up looking for data on disk rather than in the cache and because cached memory frees itself up as applications need it, but at a current job I just started, the senior linux admin(23 years exp) seems to think it's necessary because our application doesn't free up the cache. I was under the impression that this was a kernel function rather than something that a java application has control of so I just need to hear from other experienced individuals if they've ever seen situations outside of benchmarking where dropping caches on a production server was necessary.

And I'm not talking about a situation where somebody decided to set vfs_cache_pressure to 0. I'm just trying to understand whether or not a java application or even a database taking up 80% of memory can cause cache memory to not free itself.

Last edited by wstewart90; 05-25-2014 at 01:06 PM.
 
Old 05-25-2014, 08:38 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,873

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
without much more info then you have provided are you hitting swap memory issues or performance issues? if either of those are NO, then id not stress over dropping cache, but it could also be a situation were swappy is not properly set for the server.

ive seen poorly designed applications not release memory even when the kernel is attempting to do so thus causing both performance and swap issues, see above.

in fact my last contract job was to support a very old out of date unsupported database combined with a modern DB that used a Java front end for the newer DB and some old hacked together version of display for the older one. On larger data bases (systems with more then 5000 records) the system could become unstable and a manual release of the cache was required or the customer were would just hard reset the locked system as they were in to much of a hurry to fill their next order *grins* either way it can happen.
 
Old 05-25-2014, 08:52 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,591

Rep: Reputation: 3508Reputation: 3508Reputation: 3508Reputation: 3508Reputation: 3508Reputation: 3508Reputation: 3508Reputation: 3508Reputation: 3508Reputation: 3508Reputation: 3508
When drop_caches was first introduced, there were situations where it did help - say after the nightly updatedb before it was made inotify aware. There have also been situations where there has been a leak in the buddy allocator that caused some of the caches (*not* page-cache that shows up under "cached" in free) to grow and never be released. Any reasonably current kernel should have been fixed.

So maybe it's historical - it helped (once ?) "back in the day", and nobody is going to risk not running it now.

As a general principle, it shouldn't be needed on a regular basis - and yes, it (page-cache usage) is not something user-space can directly affect.
 
1 members found this post helpful.
Old 05-25-2014, 10:35 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,873

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
syg00, good updated info. thank you.
 
Old 05-26-2014, 09:09 AM   #5
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Original Poster
Rep: Reputation: Disabled
We've got a few systems running fedora core 8 so maybe those are the situations where it's necessary. I believe fedora 8 is running the 2.6.23 kernel though which should have inotify built in.
 
Old 05-26-2014, 01:59 PM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,873

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
um fedora 8 is so old and out of date it needs to be replaced and should never have been used as a server.

https://en.wikipedia.org/wiki/Fedora_(operating_system)

Quote:
8 Werewolf 2007-11-08 2009-01-07 2.6.23
so yes it is running 2.6.23, but its life cycle ended over 5 years ago.
 
Old 06-01-2014, 11:45 AM   #7
wstewart90
Member
 
Registered: May 2013
Distribution: Arch Linux
Posts: 86

Original Poster
Rep: Reputation: Disabled
I completely agree with you. This is the second place I've worked at running fedora 8. I guess it was new when they had the brilliant idea of designing their software to run on linux. I'm leaving this place for a better opportunity either way. I just wanted to know if there were any scenarios where dropping cached memory would make sense. Thanks for the responses.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
echo 3 > /proc/sys/vm/drop_caches takes forever rmm Linux - General 1 12-11-2013 02:32 AM
echo 0 /proc/sys/kernel/hung_task_timeout finsh Linux - Server 3 07-18-2013 07:01 AM
/proc/sys/vm/drop_caches sulekha Ubuntu 4 12-06-2008 03:38 AM
echo '214748364' > /proc/sys/kernel/shmmax rubendarioportillo SUSE / openSUSE 1 11-03-2005 06:05 PM
echo '214748364' > /proc/sys/kernel/shmmax SwannAnderson Linux - General 2 11-03-2005 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration