当前位置:网站首页>CDH存在隐患 : 该角色的进程使用的交换内存为xx兆字节。警告阈值:200字节
CDH存在隐患 : 该角色的进程使用的交换内存为xx兆字节。警告阈值:200字节
2022-07-02 09:42:00 【小基基o_O】
概述
CDH上某个服务的警告信息:
存在隐患 : 该角色的进程使用的交换内存为xx兆字节。警告阈值:200字节
例如:
ZooKeeper服务进程使用了交换内存,导致ZooKeeper服务变慢,影响了集群
个人对交换内存的理解
- 英文名称:swap space
- 译名:交换空间 or 交换内存
- 释义:
swap space是硬盘上的一块空间
当系统的物理内存不够时,一些长时间冇操作的程序的内存将被释放,释放的空间被临时保存到swap space
待到该程序要操作时,再从swap space恢复数据到内存 - 优点:使程序可以操纵大于实际物理内存的空间
- 缺点:swap space会产生硬盘IO,使程序会变慢
例如
Windows系统可同时运行多个程序,当切换到一个很长时间没有理会的程序时,会听到硬盘“哒哒”直响
交换内存相关操作
查看交换内存
free -h
swap space总大小8G,已用2.2G,剩余5.8G
启用交换内存
swapon -a
- 选项
-a, --all - 原文:
All devices marked asswapin/etc/fstabare made available, except for those with thenoautooption.
Devices that are already being used as swap are silently skipped. - 译文:
所有在/etc/fstab中标记为swap的设备都是可用的,除了带有noauto选项的设备。
已经被用作交换区的设备被静默地跳过。
禁用交换内存
swapoff -a
一个窗口执行
swapoff -a,另一个窗口执行swapon
可以看到,已用的交换空间在不断减少
CDH隐患解决方案
编写脚本,设置定时任务,定期清理已经使用的swap space
#!/bin/bash
# 禁用所有交换空间
swapoff -a
# 启用所有交换空间
swapon -a
# 清理完成提示
echo "清理完毕"
清理已经使用的swap space后
边栏推荐
- Thesis translation: 2022_ PACDNN: A phase-aware composite deep neural network for speech enhancement
- 【2022 ACTF-wp】
- Yygh-9-make an appointment to place an order
- Fabric. JS 3 APIs to set canvas width and height
- jenkins 凭证管理
- Seriation in R: How to Optimally Order Objects in a Data Matrice
- Leetcode739 daily temperature
- Small guide for rapid formation of manipulator (VII): description method of position and posture of manipulator
- YYGH-BUG-04
- JZ63 股票的最大利润
猜你喜欢

Deep understanding of NN in pytorch Embedding

Take you ten days to easily finish the finale of go micro services (distributed transactions)

【2022 ACTF-wp】

GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT

Mish shake the new successor of the deep learning relu activation function

XSS labs master shooting range environment construction and 1-6 problem solving ideas

Flesh-dect (media 2021) -- a viewpoint of material decomposition

Natural language processing series (III) -- LSTM

【C语言】十进制数转换成二进制数

Thesis translation: 2022_ PACDNN: A phase-aware composite deep neural network for speech enhancement
随机推荐
GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT
Lekao: contents of the provisions on the responsibility of units for fire safety in the fire protection law
[visual studio 2019] create MFC desktop program (install MFC development components | create MFC application | edit MFC application window | add click event for button | Modify button text | open appl
Data analysis - Matplotlib sample code
堆(优先级队列)
Fresh, 2022 advanced Android interview must know 100 questions (interview questions + answer analysis)
测试左移和右移
From scratch, develop a web office suite (3): mouse events
子线程获取Request
Small guide for rapid formation of manipulator (VII): description method of position and posture of manipulator
【C语言】十进制数转换成二进制数
ESP32 Arduino 引入LVGL 碰到的一些问题
This article takes you to understand the operation of vim
CMake交叉编译
Those logs in MySQL
YYGH-BUG-04
倍增 LCA(最近公共祖先)
jenkins 凭证管理
php 二维、多维 数组打乱顺序,PHP_php打乱数组二维数组多维数组的简单实例,php中的shuffle函数只能打乱一维
K-Means Clustering Visualization in R: Step By Step Guide



