码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Linux下使用lookbusy加载cpu负载


    Lookbusy 是一个用于在 Linux 系统上生成合成负载的简单应用程序。它可以在 CPU 上生成固定的、可预测的负载,保持选定数量的内存处于活动状态,并生成您需要的任意数量的磁盘流量。

    官方地址:lookbusy -- a synthetic load generator

    编译

    arm编译

    1. ./configure --host=arm-linux-gnueabihf LDFLAGS=-static  # --host指定gcc版本,LDFLAGS指定静态编译
    2. make
    3. make install

    x86编译

    1. ./configure
    2. make
    3. make install

    使用

    官方指令

    1. usage: lookbusy [ -h ] [ options ]
    2. General options:
    3. -h, --help Commandline help (you're reading it)
    4. -v, --verbose Verbose output (may be repeated)
    5. -q, --quiet Be quiet, produce output on errors only
    6. CPU usage options:
    7. -c, --cpu-util=PCT, Desired utilization of each CPU, in percent (default
    8. --cpu-util=RANGE 50%). If 'curve' CPU usage mode is chosen, a range
    9. of the form MIN-MAX should be given.
    10. -n, --ncpus=NUM Number of CPUs to keep busy (default: autodetected)
    11. -r, --cpu-mode=MODE Utilization mode ('fixed' or 'curve', see lookbusy(1))
    12. -p, --cpu-curve-peak=TIME
    13. Offset of peak utilization within curve period, in
    14. seconds (append 'm', 'h', 'd' for other units)
    15. -P, --cpu-curve-period=TIME
    16. Duration of utilization curve period, in seconds (append
    17. 'm', 'h', 'd' for other units)
    18. Memory usage options:
    19. -m, --mem-util=SIZE Amount of memory to use (in bytes, followed by KB, MB,
    20. or GB for other units; see lookbusy(1))
    21. -M, --mem-sleep=TIME Time to sleep between iterations, in usec (default 1000)
    22. Disk usage options:
    23. -d, --disk-util=SIZE Size of files to use for disk churn (in bytes,
    24. followed by KB, MB, GB or TB for other units)
    25. -b, --disk-block-size=SIZE
    26. Size of blocks to use for I/O (in bytes, followed
    27. by KB, MB or GB)
    28. -D, --disk-sleep=TIME
    29. Time to sleep between iterations, in msec (default 100)
    30. -f, --disk-path=PATH Path to a file/directory to use as a buffer (default
    31. /tmp); specify multiple times for additional paths
    1. lookbusy -c 60 # 占用所有 CPU 核心各 60%
    2. lookbusy -c 50 -n 2 # 占用两个 CPU 核心各 50%
    3. lookbusy -c 50-80 -r curve # 占用所有 CPU 核心在 50%-80% 左右浮动
    4. l

    效果

  • 相关阅读:
    qt C++中指针自动释放内存及程序中的内存操作、管理
    scala语言_第二章笔记
    基于51单片机+DS1302时钟模块+4位数码管显示
    华纳云:租用的服务器连接超时怎么办?
    spring 注解: 更加简单的存储 Bean
    iOS开发Swift-4-IBAction,group,音乐播放器-木琴App
    new Object()到底占用几个字节
    2023计算机毕业设计SSM最新选题之java儿童成长记录与分享系统cc35g
    UTONMOS利用区块链技术,帮助数字藏品实现“确权”与“溯源”
    python-文件和异常
  • 原文地址:https://blog.csdn.net/misterdo/article/details/132827186
  • 最新文章
  • 【JVM】编译执行与解释执行的区别是什么?JVM 使用哪种方式?
    用 Hashids 优雅解决 C 端自增 ID 暴露问题
    V8引擎 精品漫游指南--Ignition篇(上) 指令 栈帧 槽位 调用约定 内存布局 基础内容
    LLVM Pass快速入门(四):代码插桩
    milkup:桌面端 markdown AI续写和即时渲染
    基于项目工程构建SBOM(软件物料清单)的研究
    鸿蒙应用开发UI基础第二节:鸿蒙应用程序框架核心解析与实操
    .NET 中如何快速实现 List 集合去重?
    扣子Coze实战:从0到1打造抖音+小红书热点监控智能体
    浅谈数据访问层
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号