zoukankan      html  css  js  c++  java
  • Linux stress CPU的测试方法

    一、stress工具安装:
    1、获取stress源码安装包(stress-1.0.4.tar.gz)
    3、解压并安装

    [root@localhost /]#cd /tmp/
    [root@localhost tmp]#tar –zxvf stress-1.0.4.tar.gz

    4、进入stress-1.0.4文件夹下,编译并安装stress

    [root@localhost tmp]#cd /tmp/stress-1.0.4/
    [root@localhost stress-1.0.4]#./configure
    [root@localhost stress-1.0.4]# make
    [root@localhost stress-1.0.4]#make install

    默认安装在:/usr/local/bin/stress
    二、stress工具使用:
    命令:taskset –c 逻辑CPU索引号 stress --timeout 持续时间 --cpu 1
    参数说明:
    -c 服务器逻辑CPU的索引号
    --timeout 对CPU施加压力的持续时间
    --cpu stress进程数,若值为2,每个stress进程所有消耗的逻辑CPU资源平分
    如:对索引为0的逻辑cpu施加压力, 持续30秒

    taskset -c 0 stress --timeout 30 --cpu 1

    通过top 1可以查看到索引为0的CPU的利用率

  • 相关阅读:
    lufylegend:图形变形3
    javascript: Math.sin() cos() 用法
    lufylegend:图形变形2
    lufylegend:图形变形1
    lufylegend:图片的加载和显示
    lufylegend基础知识1
    canvas使用3
    canvas使用2
    canvas使用1
    javascript:addEventListener
  • 原文地址:https://www.cnblogs.com/bugutian/p/6653076.html
Copyright © 2011-2022 走看看