Incredibly high CPU load during test running #2852
Replies: 7 comments 3 replies
-
To try and get more info about what's going on, I just tried a few different levels of concurrency:
This suggests first that ava might be spawning too many processes: perhaps the number of logical rather than physical cores, while the workload does not spread well over SMT cores. However, even that wouldn't fully explain such high load figures: the jump from 1 at ava is by far my favourite testing library and I'd love to carry on using & recommending it! For now I have disabled concurrency on this test suite. |
Beta Was this translation helpful? Give feedback.
-
We use |
Beta Was this translation helpful? Give feedback.
-
Thanks @novemberborn. Thanks again, I'll see if I can get some figures on |
Beta Was this translation helpful? Give feedback.
-
No, that looks pretty bad. For I/O heavy tests, using all (hyper-threaded) cores can work well. But if the tests are extremely CPU heavy that might backfire. I suspect that's relatively rare though. (I'm closing this issue for housekeeping purposes, but let's keep the conversation going.) |
Beta Was this translation helpful? Give feedback.
-
I'm also hitting what I think is the same issue, I noticed it on xojs/xo#606 (comment). Basically whatever value of concurrency bigger than 1 spawns too many processes making the system unresponsive... I'm using a VM with 4 threads, but even if I use |
Beta Was this translation helpful? Give feedback.
-
That's very curious. Re my original issue, I do often see CPU load of around 100; though I see this with a lot of node/npm related tasks, such as parcel builds, |
Beta Was this translation helpful? Give feedback.
-
No, this is clearly due to ava. I only ran ava when I took the screenshot. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm encountering some strange behaviour. I'm using an (I think) fairly standard ava + enzyme + babel setup.
I initially noticed my machine was running poorly — almost totally locked up — while ava tests were running. Investigating, I was astonished to find that CPU load was continuously over 100 during test running. The machine is so intensely locked up that Activity Monitor won't refresh any of its CPU or memory info until ava has finished running the tests. That 100 figure isn't a percentage, that's the actual CPU load figure, as a % it would be 10,000% CPU load. I thought I must be dreaming it, but it really is true.
My first thought was to try without concurrency (
-c 1
), and that results in CPU load around 1 (100%) as expected. Test running takes ~40s with-c 1
and CPU load of about 1, compare with ~30s without-c
and CPU load of about 100, system all but unusable.Thinking about this, and 3 things seem possible explanations:
Or it could be something else. As I've never seen anything quite like this before, I'd really appreciate anyone's thoughts if they have further ideas.
Code: link to repo
npm run t
is simplyava src/test/*
The machine is a MacBook Air, 1.3GHz, 2 real cores and SMT.
Beta Was this translation helpful? Give feedback.
All reactions