Author Topic: What should i do with this RAM usage?  (Read 9211 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
What should i do with this RAM usage?
« on: July 30, 2019, 05:05:38 AM »
I have high RAM usage is that ok? and if the Memory RAM becomes 100%, does the server will be down?

Offline
*
Re: What should i do with this RAM usage?
« Reply #1 on: July 30, 2019, 03:53:22 PM »
Maybe time to upgrade the server?

Offline
*
Re: What should i do with this RAM usage?
« Reply #2 on: July 30, 2019, 05:24:53 PM »
Maybe time to upgrade the server?
I need more RAM?

Offline
*
Re: What should i do with this RAM usage?
« Reply #3 on: July 31, 2019, 03:54:49 AM »
ok first ssh onto the server console and type slabtop to look to see how much memory dentry is using.

Active / Total Objects (% used)    : 21729664 / 22216467 (97.8%)
 Active / Total Slabs (% used)      : 1123731 / 1123757 (100.0%)
 Active / Total Caches (% used)     : 102 / 185 (55.1%)
 Active / Total Size (% used)       : 4164789.59K / 4233279.36K (98.4%)
 Minimum / Average / Maximum Object : 0.02K / 0.19K / 4096.00K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
19754140 19754049  99%    0.19K 987707       20   3950828K dentry

1900764 1472678  77%    0.10K  51372      37    205488K buffer_head

254788 254745  99%    0.98K  63697        4    254788K ext4_inode_cache
 89621  88583  98%    0.06K   1519    59    6076K size-64
 81753  41708  51%    0.55K  11679        7     46716K radix_tree_node
 21056  20715  98%    0.03K    188   112     752K size-32
 14256  14236  99%    0.14K    528    27    2112K sysfs_dir_cache
 13053  10906  83%    0.20K    687    19    2748K vm_area_struct
 12782   9658  75%    0.05K    166    77     664K anon_vma_chain
 11720  11601  98%    0.19K    586    20    2344K size-192
  8321   8052  96%    0.07K    157    53     628K selinux_inode_security
  7370   5386  73%    0.05K    110    67     440K anon_vma
  5760   4352  75%    0.12K    192    30     768K size-128
  5325   3901  73%    0.25K    355    15    1420K filp

whoah! dentry, go home you're drunk!
To clear that do:

# service nginx stop
Stopping nginx:                                            [  OK  ]
# service mysqld stop
Stopping mysqld:                                           [  OK  ]
# sync && echo 2 > /proc/sys/vm/drop_caches
# service mysqld start
Starting mysqld:                                           [  OK  ]
# service nginx start
Starting nginx:                                            [  OK  ]

You don't want to run this with mysql active as it can corrupt databases but this command basically drops dentry cache. I shut down my web server too. If you use a different web server you should probably stop that too. Basically kill all the disk writes you can while this is running. I have 48GB of RAM and I'll run this around 35GB used and it takes a couple min. Ya might also want to adjust the swapiness of your system cause ideally servers shouldn't swap.

Offline
*
Re: What should i do with this RAM usage?
« Reply #4 on: July 31, 2019, 04:56:48 AM »
ok first ssh onto the server console and type slabtop to look to see how much memory dentry is using.

Active / Total Objects (% used)    : 21729664 / 22216467 (97.8%)
 Active / Total Slabs (% used)      : 1123731 / 1123757 (100.0%)
 Active / Total Caches (% used)     : 102 / 185 (55.1%)
 Active / Total Size (% used)       : 4164789.59K / 4233279.36K (98.4%)
 Minimum / Average / Maximum Object : 0.02K / 0.19K / 4096.00K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME                   
19754140 19754049  99%    0.19K 987707       20   3950828K dentry

1900764 1472678  77%    0.10K  51372      37    205488K buffer_head

254788 254745  99%    0.98K  63697        4    254788K ext4_inode_cache
 89621  88583  98%    0.06K   1519    59    6076K size-64
 81753  41708  51%    0.55K  11679        7     46716K radix_tree_node
 21056  20715  98%    0.03K    188   112     752K size-32
 14256  14236  99%    0.14K    528    27    2112K sysfs_dir_cache
 13053  10906  83%    0.20K    687    19    2748K vm_area_struct
 12782   9658  75%    0.05K    166    77     664K anon_vma_chain
 11720  11601  98%    0.19K    586    20    2344K size-192
  8321   8052  96%    0.07K    157    53     628K selinux_inode_security
  7370   5386  73%    0.05K    110    67     440K anon_vma
  5760   4352  75%    0.12K    192    30     768K size-128
  5325   3901  73%    0.25K    355    15    1420K filp

whoah! dentry, go home you're drunk!
To clear that do:

# service nginx stop
Stopping nginx:                                            [  OK  ]
# service mysqld stop
Stopping mysqld:                                           [  OK  ]
# sync && echo 2 > /proc/sys/vm/drop_caches
# service mysqld start
Starting mysqld:                                           [  OK  ]
# service nginx start
Starting nginx:                                            [  OK  ]

You don't want to run this with mysql active as it can corrupt databases but this command basically drops dentry cache. I shut down my web server too. If you use a different web server you should probably stop that too. Basically kill all the disk writes you can while this is running. I have 48GB of RAM and I'll run this around 35GB used and it takes a couple min. Ya might also want to adjust the swapiness of your system cause ideally servers shouldn't swap.

Ok this is result slabtop :

Code: [Select]
Active / Total Objects (% used)    : 1003516 / 1666731 (60.2%)
 Active / Total Slabs (% used)      : 51947 / 51947 (100.0%)
 Active / Total Caches (% used)     : 75 / 101 (74.3%)
 Active / Total Size (% used)       : 320712.64K / 426219.86K (75.2%)
 Minimum / Average / Maximum Object : 0.01K / 0.25K / 12.75K

  OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME
358428 353041  98%    0.19K  17068       21     68272K dentry
131040 129786  99%    0.64K   5460       24     87360K proc_inode_cache
104997  69872  66%    1.01K   3387       31    108384K ext4_inode_cache
 73871  55105  74%    0.57K   2639       28     42224K radix_tree_node
510861  53736  10%    0.10K  13099       39     52396K buffer_head
146368  48873  33%    0.06K   2287       64      9148K kmalloc-64
 30566  30566 100%    0.12K    899       34      3596K kernfs_node_cache
 60945  28552  46%    0.05K    717       85      2868K shared_policy_node
 28665  27783  96%    0.19K   1365       21      5460K kmalloc-192
 32640  26226  80%    0.04K    320      102      1280K ext4_extent_statusrity
 18666  18666 100%    0.04K    183      102       732K selinux_inode_security
 18796  18657  99%    0.21K    508       37      4064K vm_area_struct
 14940  14940 100%    0.13K    498       30      1992K sharegroupinfo_4k
 14364  13690  95       58K    53        27      8512K inode_cache
 13104  12736  97%    0.07K    234       56       936K avc_node
 10200   9442  92%    0.08K    200       51       800K anon_vma
  8448   8448 100%    0.02K     33      256       132K kmalloc-16
  8192   8192 100%    0.01K     16      512        64K kmalloc-8
  6336   6336 100%    0.06K     99       64       396K ext4_free_data
  5275   4894  92%    0.31K    211       25      1688K nf_conntrack_ffffffff95511640
  7616   4862  63%    0.12K    238       32       952K kmalloc-128
  6048   4651  76%    0.25K    189       32      1512K kmalloc-256
  4592   4592 100%    0.07K     82       56       328K ext4_io_end
  4242   4085  96%    0.09K    101       42       404K kmalloc-96
  3780   3780 100%    0.11K    105       36       420K task_delay_info
  3200   3200 100%    0.03K     25      128       100K kmalloc-32
  3488   3157  90%    1.00K    109       32      3488K kmalloc-1024
  2944   2944 100%    0.03K     23      128        92K jbd2_revoke_record_s
  2916   2515  86%    0.11K     81       36       324K jbd2_journal_head

And what if i reboot my server isn't better?
Thank you