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.

1 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

Post a Comment