如何在python中模拟cpu和内存压力 [英] how can I simulate cpu and memory stress in python

查看:458
本文介绍了如何在python中模拟cpu和内存压力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人在python中编写了模拟cpu和内存压力的代码。
我看到了加载cpus的代码,但是如何强制它们使用90%的使用率?

I would like to know if anyone wrote a code in python that simulates a cpu and memory stress. I saw a code loading the cpus, but how can I force them to work on 90% usage?

推荐答案

以下链接回答了CPU压力。
https://github.com/GaetanoCarlucci/CPULoadGenerator

The below link answers the cpu stress. https://github.com/GaetanoCarlucci/CPULoadGenerator

它出现在该会话中:
https://superuser.com/questions/396501/how-can-i-produce-high-cpu-load-on-windows/734782#734782?newreg=bec18b2f032a444187a8be7540ec6083

这篇关于如何在python中模拟cpu和内存压力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆