国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

榨干CPU

2019-11-08 03:12:01
字體:
來源:轉載
供稿:網友
目的:測試服務器的CPU性能,讓四個CPU滿載。1)自啟動腳本testcpu:#!/bin/bash  # chkconfig: 2345 98 5  # description: script to start/stop testcpu case $1 in      start)              cd /work/app              taskset -c 0 ./testcpu &             taskset -c 1 ./testcpu &            taskset -c 2 ./testcpu &            taskset -c 3 ./testcpu &            ;;      stop)              pkill testcpu            ;;        *)              echo "Usage: $0 (start|stop)"              exit 1              ;;  esacexit 0第二行中要先查看系統中是否有98,沒有就不用改,只要與系統中已存在的不重復即可??稍?etc/rc.d/rc0.d/里面查看。taskset為指定CPU執行某段程序。2)升級腳本update.shrooter=""mkdir -p -m 777  $rooter/work/appcp  -f ./cfg/testcpu    $rooter/etc/init.d/cp  -f ./testcpu            $rooter/work/app/chmod   777  -R   $rooter/work/chkconfig iptables offsetenforce  0  chkconfig --level  235  testcpu onecho "System will reboot in 5 seconds..."sleep 5reboot說明:update.sh、testcpu可執行程序在同一級目錄,testcpu自啟腳本在同級目錄cfg文件夾下。3)c程序testcpu.cint i = 0;while(1){    for(i=0; i<1000000000; i++)    {        if(i == 1000000) i = 0;    }}編譯:gcc testcpu.c -o testcpu執行update.sh即可讓程序開機自啟且四個CPU滿載。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 米林县| 阿图什市| 抚宁县| 当阳市| 文山县| 杭锦旗| 五常市| 平远县| 临清市| 巴塘县| 肇东市| 绥阳县| 蒲江县| 澄城县| 建宁县| 荆门市| 静海县| 确山县| 蓬溪县| 五寨县| 大城县| 万宁市| 新郑市| 乌兰县| 公安县| 云浮市| 阿城市| 菏泽市| 故城县| 曲沃县| 怀化市| 长泰县| 当阳市| 泰顺县| 抚顺市| 蒙山县| 建始县| 广丰县| 博乐市| 射阳县| 乐至县|