How to Clear CentOS cache data

BillEssley

Well-known member
Joined
Feb 19, 2013
Messages
234
Best answers
2
Ratings
21
Points
18
#1
I used CentOS so long on my current VPS and not change to another OS. I think there are some big cache files were created there and if that happened, I would like to Clear CentOS Cache Data to free up my storage for my VPS. What is the best way to clear CentOS cache data?
 
Joined
Feb 6, 2015
Messages
55
Best answers
0
Ratings
4
Points
8
#2
Hey Bill,

Linux systems create and cache datalots in disk and RAM at intervals depending on the usage patterns. This can create an impression of excessive resource usage on server resources after a certain amount of time and time. If we do not illustrate this with examples, we can compare it to providing browser history.

As you may know, crawlers keep a part of the data in their minds that you will visit the same site again and again with Cache's past visits. When you want to call the same site again, it tries to react more quickly. The Centos cache works on the same logic.

Now let's see how we can clean up these past caches.

If your server is a VPS or a dedicated server, you can use Putty or a different client program through SSH. In order to clear the cache memory of the page, we run the commands as below.

Code:
# sync; echo 3 > /proc/sys/vm/drop_caches
# sync; echo 2 > /proc/sys/vm/drop_caches
# sync; echo 1 > /proc/sys/vm/drop_caches
We will clean up the Centos cache with our commands. It will be useful for automatic caching of server performance and cache data at fixed intervals without the need to specify a cron.

The command I share below will create a scheduled task for automatic cleaning of cache data via SSH.

Code:
# crontab -l
0 * * *  * sync; echo 3 > /proc/sys/vm/drop_caches
Once you've completed the steps, you'll be able to provide the correctness.

You can run #free -m command and observe the output values.

Hope it helps~
 

24x7serverman

Well-known member
Joined
Jul 25, 2017
Messages
652
Best answers
1
Ratings
65 6
Points
28
#3

qbeststar

Well-known member
Joined
May 6, 2017
Messages
116
Best answers
0
Ratings
8
Points
18
#4
I used CentOS so long on my current VPS and not change to another OS. I think there are some big cache files were created there and if that happened, I would like to Clear CentOS Cache Data to free up my storage for my VPS. What is the best way to clear CentOS cache data?
Also you can check your log files here /var/log/
 

mobin

Well-known member
Joined
Jun 22, 2017
Messages
181
Best answers
1
Ratings
61 1
Points
28
#7
I did not get what exactly you want to achieve here. As far as I know, CentOS as an OPerating System itself is not creating any such cache files like you mentioned. There may some applications that is creating cache files/logs files and can fill in data. So you need any analyse the disk usage and understand which directory in the file system is using disk space and that will make things easy. Once you know the location which is exactly consuming most of your disk space, understand why its created and what it is using for, I think you can use with 'du -sch /*' command as the first step.
 
Latest Threads
Replies
1
Views
27
Replies
2
Views
10
  • Deleted
  • Deleted by Localnode
  • Reason: Outside of advertising forums
Replies
0
Views
5
Replies
0
Views
14
Replies
7
Views
50
Recommended Threads
Replies
1
Views
641
Replies
9
Views
1,395
Replies
7
Views
825
Replies
2
Views
563

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Top