monkeytype icon indicating copy to clipboard operation
monkeytype copied to clipboard

Significant cpu usage after typing for +2 hours

Open Valgerice opened this issue 7 months ago • 8 comments

Did you clear cache before opening an issue?

  • [x] I have cleared my cache

Is there an existing issue for this?

  • [x] I have searched the existing issues

Does the issue happen when logged in?

N/A

Does the issue happen when logged out?

Yes

Does the issue happen in incognito mode when logged in?

N/A

Does the issue happen in incognito mode when logged out?

Yes

Account name

Valger

Account config

No response

Current Behavior

After typing for +2 hours a task related with the monkeytype tab started using all cpu resources available to it. I do not know if it is reproduce able simply since it took one hour before i noticed a slight input lag and chalked ti up to slow internet. After 2hours I noticed severe input lag and high cpu usage. I kept doing tests for 2 hours and swamped between tabs from time to time

Expected Behavior

No response

Steps To Reproduce

the current know steps is to do consecutive tests for +1h

Environment

  • OS: Ubuntu 24.10
  • Browser: waterfox
  • Browser Version: 6.5.7

Anything else?

No response

Valgerice avatar May 22 '25 22:05 Valgerice

Happens in 2 hour tests right? What if you type shorter tests for 2 hours without refreshing?

Miodec avatar May 26 '25 14:05 Miodec

sorry if it wasn't clear. I was typing short tests without refreshing, about 100 consecutive 25 word test.

Valgerice avatar May 27 '25 22:05 Valgerice

Can you check now? We made some changes that hopefully will improve performance.

Miodec avatar May 29 '25 10:05 Miodec

Can you check now? We made some changes that hopefully will improve performance.

Hi @Miodec ,

A day ago I managed to reproduce the issue, but in a slightly different way. I was logged and it happens only in login and kept switching between the User Stats page and other pages like Settings and Leaderboards. After a few times (4-5 times), the site would slow down, CPU would spike, and memory jumped from ~200MB to 6.6GB before the page froze.

Just wanted to say that I tried it again now, and I can confirm the issue isn't happening anymore— so everything seems stable on my side. Looks like it's all good now!

byseif21 avatar May 29 '25 19:05 byseif21

I have now reproduced the issue. I used the site for an hour not logged in and logged in and experienced the issue again, logging in does not appear to be the cause as it appears to be a gradual reduction. There is no significant increase in memory, the page only draws 90% CPU from a single core.

I will monitor the CPU more closely and attempt to reproduce it.

Valgerice avatar May 29 '25 20:05 Valgerice

Can you check now? We made some changes that hopefully will improve performance.

Hi @Miodec ,

A day ago I managed to reproduce the issue, but in a slightly different way. I was logged and it happens only in login and kept switching between the User Stats page and other pages like Settings and Leaderboards. After a few times (4-5 times), the site would slow down, CPU would spike, and memory jumped from ~200MB to 6.6GB before the page froze.

Just wanted to say that I tried it again now, and I can confirm the issue isn't happening anymore— so everything seems stable on my side. Looks like it's all good now!

Yeah thats what we fixed today.

I have now reproduced the issue. I used the site for an hour not logged in and logged in and experienced the issue again, logging in does not appear to be the cause as it appears to be a gradual reduction. There is no significant increase in memory, the page only draws 90% CPU from a single core.

I will monitor the CPU more closely and attempt to reproduce it.

As for this issue im not sure whats going on yet.

Miodec avatar May 29 '25 21:05 Miodec

It is indeed a gradual growing issue. Im starting to get abnormal CPU spikes. I can not test for longer so this is all i can confirm for now

Valgerice avatar May 29 '25 23:05 Valgerice

When you tested in incognito, did you make sure all extensions are disabled?

Miodec avatar Jun 04 '25 08:06 Miodec