Wednesday, November 18, 2015

Linux: Why to drop caches and how? Host or virtual machine

Excerpt from stackoverflow: "The reason to drop caches like this is for benchmarking disk performance, and is the only reason it exists. When running an I/O-intensive benchmark, you want to be sure that the various settings you try are all actually doing disk I/O, so Linux allows you to drop caches rather than do a full reboot."

How to drop caches on the host?

sync; echo 3 > /proc/sys/vm/drop_caches

How to drop caches on a virtual machine and measure the difference in RAM?
user90> free -mt
              total        used        free      shared  buff/cache   available
Mem:           3002         440        1908           9         652        2375
Swap:          2047           0        2047
Total:         5050         440        3956
user90> sudo  sync
user90> free -mt               total        used        free      shared  buff/cache   available
Mem:           3002         440        1905           9         655        2375
Swap:          2047           0        2047
Total:         5050         440        3953
user90> sudo sysctl -w vm.drop_caches=3
vm.drop_caches = 3
user90> free -mt
              total        used        free      shared  buff/cache   available
Mem:           3002         440        2385           9         176        2394
Swap:          2047           0        2047
Total:         5050         440        4433
user90> 
Other than for benchmarking freeing up RAM is not a very useful exercise.

6 comments:

Mayweather McGregor said...

Floyd Mayweather Jr. vs Conor McGregor, also known as "The Money Fight", is an upcoming professional boxing bout between undefeated eleven-time five-division professional boxing world champion Floyd Mayweather Jr. and the current UFC Lightweight Champion Conor McGregor. It will take place at the T-Mobile Arena in Paradise, Nevada on August 26, 2017

Mayweather vs McGregor
McGregor vs Mayweather
Mayweather vs McGregor Live
Mayweather vs McGregor Live Stream
Mayweather vs McGregor Fight
McGregor vs Mayweather Live
McGregor vs Mayweather Live Stream
McGregor vs Mayweather Fight
Watch Mayweather vs McGregor
Watch McGregor vs Mayweather
Mayweather vs McGregor PPV
McGregor vs Mayweather PPV
Floyd Mayweather vs Conor McGregor

Super Bowl 2018 said...

Watch Super Bowl 2018 Live Stream HD Online Here:

Super Bowl 2018
Super Bowl 2018 Tickets
Super Bowl Tickets
Super Bowl 2018 Live
Super Bowl 2018 Live Stream
Super Bowl 52
Super Bowl 52 Tickets
Super Bowl 52 Live
Super Bowl 52 Live Stream
Super Bowl LII
Super Bowl LII Tickets
Super Bowl LII Live
Super Bowl LII Live Stream

Winter Olympics said...

Watch Winter Olympics 2018 Live Stream HD Online Here:

Winter Olympics 2018
Winter Olympics 2018 Live
Winter Olympics 2018 Live Stream

Elton John Tour 2018 said...

Buy Elton John Tour 2018 Best Tickets Here:

Elton John Tour
Elton John Tour 2018
Elton John Tour Tickets
Elton John Tour 2018 Tickets

Khan Roni said...

Watch Daytona 500 Live Stream HD Online Here:

Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500

D2 Bet said...

The reason to drop caches like this is for benchmarking disk performance, and is the only reason it exists.


สมัคร D2BET

Post a Comment