Linux内存会分为一些zone, 每个zone都有一个min/low/high的阈值, 当可用内存低于low时, kswapd被唤醒,...
print_help()#cpu满载defdeadloop():whileTrue:pass#根据传参来指定占满几个核defcpu(): arg= sys.argv[2]iflen(sys.argv) == 3elsesys.argv[3] cpu_num=cpu_count() cores=int(arg)ifnotisinstance(cores,int):print("bad args not int")returnifcores >cpu_num:print("Invalid CPU Num(cpu_cou...
4.重启apache也没用,因为我之前设置了crantab 每半小时重启一次apache,但故障出现之后,过一两个小时也一直是cpu和内存被占满的状况。
Linux内存会分为一些zone, 每个zone都有一个min/low/high的阈值, 当可用内存低于low时,kswapd被唤醒, ...
//指定Mem占用,使用time.sleep()硬代码1天时间 python3 test_mem.py m 1GB //CPU满载 python3 test_mem.py c 2 //CPU 2核满载,并且指定Mem占用2GB python3 test_mem.py mc 2GB 2 Linux命令查看 //查看内存 $ free -h //查看CPU,每秒采集一次,共5次 $ sar -u 1 5 原文地址:https://blog.csd...