Linux: How to put a load on system memory?

后端 未结 12 1983
清酒与你
清酒与你 2021-02-10 07:54

I\'m working on a small function, that gives my users a picture of how occupied the CPU is.

I\'m using cat /proc/loadavg, which returns the well known 3 num

12条回答
  •  有刺的猬
    2021-02-10 08:29

    you can stress utility, as it is a workload generator tool designed to subject your system to a configurable measure of CPU, memory, I/O and disk stress.

    To run 1 vm stressor using 1GB of virtual memory for 60s, enter:

    stress --vm 1 --vm-bytes 1G --vm-keep -t 60s

提交回复
热议问题