0

Management decided to downscale prod server.

Current size:   Standard B16ms (16 vcpus, 64 GiB memory)
Desired size:   Standard B8ms  (8 vcpus, 32 GiB memory)

CPU is mostly idle (output is from sar -u)

10:20:01        CPU     %user     %nice   %system   %iowait    %steal     %idle
10:30:01        all     15.46      0.00      4.24      0.19      0.00     80.11
10:40:01        all     17.11      0.04      4.21      0.18      0.00     78.47
10:50:01        all     19.29      0.00      4.76      0.52      0.00     75.43

What I'm concerned by, it's the memory:

root@precious-server:~# free -h
              total        used        free      shared  buff/cache   available
Mem:            62G        7.9G         26G        510M         28G         53G
Swap:           0B          0B          0B

It seems I have 53GB available, however free value is only 26GB.

Sar reports 53%-57% is used(%memused field), out of which only ~15%-18% is being committed (%commit field):

10:20:01    kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty
10:30:01        28.9G     55.2G     33.9G     53.9%      2.6G     19.8G      9.7G     15.4%     24.1G      3.7G     11.5M
10:40:01        27.0G     53.3G     35.8G     57.0%      2.6G     19.8G     11.6G     18.5%     26.0G      3.7G      1.7M
10:50:01        26.8G     53.1G     36.0G     57.3%      2.6G     19.8G     11.8G     18.7%     26.2G      3.7G      4.3M

Grafana, reports only 15% of memory is being used: enter image description here

So, you see my confusion? free command says I have 53GB available, sar says memory used is 52%, while Grafana says 15% used. I'm not sure I can do the downscale :)

What are your considerations gentlemen?

catalin
  • 115
  • 1
  • 9
  • I really like the table "You would call it.." vs "Linux calls it..." (and other explanations) on https://www.linuxatemyram.com/ - But since you have Grafana you probably also have long term trends and if those trends are consistent with the numbers you posted, then indeed your system appears to be oversized compared to actual memory requirements of your application load. – Rob Apr 04 '22 at 14:22
  • yes, I do have history for last month, and for most of the time, the metrics are the same. Thanks for the URL provided :) Seems like I can indeed do the downscale. – catalin Apr 04 '22 at 15:17
  • at the current stage, 16-24gb would be enough but you didn't tell what is the business related question or issue – djdomi Apr 04 '22 at 16:48
  • 3
    Does this answer your question? [Can you help me with my capacity planning?](https://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning) – djdomi Apr 04 '22 at 16:48
  • @djdomi Well it seems the application code had some issues in the past, somehow it consumed a lot of IOPS and RAM, and since there wasn't someone(dev) to patch it quickly, they just upscaled the machine. Then, they fixed the code, and now we're looking at downscaling it back to how it used to be. But I just wanted to be sure about the RAM :) About the URL provided, it helps a lot, but it doesn't answer to my question. I am confused about different output from free command, sar and grafana. Seems like they all say different things.. – catalin Apr 05 '22 at 09:02
  • shortly said, try to to reduce by 50% of ram and look what happens the next weeks. – djdomi Apr 05 '22 at 10:12

0 Answers0