Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ton of process open to check pidusage #146

Closed
r-rajaneesh opened this issue Apr 15, 2022 · 1 comment
Closed

Ton of process open to check pidusage #146

r-rajaneesh opened this issue Apr 15, 2022 · 1 comment

Comments

@r-rajaneesh
Copy link

r-rajaneesh commented Apr 15, 2022

API Platform version(s) affected: Windows 10

Description

Running the code in a setInterval causes a ton of process to be create and cause lag

How to reproduce

import pidusage from "pidusage";
setInterval(() => {
  pidusage(process.pid, (error, stats) => {
    console.log(stats.cpu);
  });
}, 1000);

Just run this above code

Possible Solution

Just run one process all the time and check the usage and send the usage back, instead of creating multiple process to check usage.

Additional Context

Cannot provide, causes a lot of lag by creating a ton of processes in a matter of few seconds.

@soyuka
Copy link
Owner

soyuka commented Oct 25, 2022

yes its documented also don't hesitate to try #143

@soyuka soyuka closed this as completed Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants