How to delete cache to increase Free RAM for a VPS/Server?

mattnz

Member
Registered
Joined
Jul 16, 2016
Messages
48
Points
8
I heard that there is a place managing cache in Linux. If so, how to delete cache to increase Free RAM for my VPS or dedicated server?
 

MooseLucifer

Well-known member
Registered
Joined
May 20, 2016
Messages
149
Points
28
Every Linux System has three options to clear cache without interrupting any processes or services.

1. Clear PageCache only.

Code:
#sync; echo 1 > /proc/sys/vm/drop_caches
2. Clear dentries and inodes.

Code:
#sync; echo 2 > /proc/sys/vm/drop_caches
3. Clear PageCache, dentries and inodes.

Code:
#sync; echo 3 > /proc/sys/vm/drop_caches
Hope it helps!
 

mattnz

Member
Registered
Joined
Jul 16, 2016
Messages
48
Points
8
Thanks Moose! I will check it out.

and will let you know if it doesn't work :)
 

VirtuBox

Well-known member
Registered
Joined
May 3, 2016
Messages
1,622
Points
83
If deleting the cache will increase the RAM available, but remember a web server store the files in cache to deliver them faster than if there was stored on the disk.
So it could make your VPS slower than it was with the cache.

For example, with Plesk, I always have 80% of the ram used by the cache
 

Luxin Host

Well-known member
Registered
Joined
Jun 26, 2016
Messages
543
Points
43
As VirtuBox mentioned it is much better for you to use up your RAM for cache than free up RAM that you wont use.
if you are planning to delete cache because of a transfer, change of domain or any specific reason then that is understandable but in other cases, having more RAM but less cache will most likely slow you down.
 
Latest Threads
Recommended Threads
Replies
13
Views
12,847
Replies
6
Views
4,962
Replies
5
Views
4,427
Replies
3
Views
2,670

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top