4

I am facing an issue with my Rails 5 app (running on AWS, Apache server) where one of our coworkers started experiencing freezing of browser (Google Chrome on Windows 10) when pressing a submit button at a form. When he presses the submit button, the browser freezes for 3 minutes and then reloads with new (updated) values in the form.

This started a few weeks ago and it happens only in Google Chrome (tried to upgrade it to its newest version, reinstall it, but it didn't help); in Mozilla or Internet Explorer it works on his laptop smoothly. This behavior appeared on 2 people's laptops in the company, the other 15 people are fine (mix of Macbooks and Windows laptops) - including me.

I connected to this person's laptop via TeamViewer and inspected the laptop's behavior. When the form's submit button is pressed, Google Chrome freezes (Not responding), the CPU usage jumps from 10% to 70%. Then, after 3 minutes when Google Chrome "unblocks" itself, the CPU usage drops again to 10% and Google Chrome is possible to use again.

enter image description here I thought that on the laptop might be running different processes, but that doesn't seem to be the case: enter image description here

The model that gets updated has 30 associations (belongs_to or has_many) - not all of them get updated when the form is sent. There are 2 nested attributes. Also, on this model is used the paper_tail gem.

I am struggling to debug this issue as I've never faced it and also, we have 15 laptops with Win 10 and Google Chrome and only on 2 of them is this issue.

I'd be very grateful for any advice.

EDIT: I forgot to mention that after sending the form, the Rails app runs some Sidekiq jobs.

EDIT 2:

Ubuntu 14.04.5 LTS
Rails 5.1.3
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
Sidekiq v5.0.4

EDIT 3: On the machine are only Google Docs-related extensions and AdBlock. However, for debugging, I have removed them all to see if this is the issue - still the same. The problematic behavior is still there.

EDIT 4: The number of tabs doesn't matter. Even with only 1 opened tab is the issue here. Also tried to empty cache & cookies, as well as to restore Google Chrome to its default setting.

EDIT 5: After another run of debugging - server logs look normal (there's nothing special), front-end loading times as well. Then, I tried to use the app in Chrome's incognito tab - and it worked smoothly! Then, I tried to use Chrome in the guest's tab - and again, it worked smoothly as well! But if the app is running in a tab where a user is logged in (or even logged out - but NOT incognito/guest), then the app is freezing when the form is submitted. I am wondering what can be installed/added under the user profile except for extensions. I've tried to remove/disable all of these, but the app was still freezing: enter image description here I tried to reset Chrome to its default settings - didn't help. A colleague that is facing this issue said that he tried to reinstall Google Chrome, everything was working fine for a few weeks, but then the freezing started again.

EDIT 6: It looks that I finally found the reason why Chrome is freezing on certain laptops - it seems to be the capacity of the autofill feature that Chrome has. The limit here is 1,000 saved user data information per profile. When I checked the users data on the problematic laptops (through DB Browser for SQLite), I found that on both of them is this limit hit. When I tried to create a new Chrome profile or use Chrome in the incognito/guest mode, the freezing (and Not Responding status) is gone and everything works smoothly.

Now, because we need the autofill feature and it makes our life way easier - we're looking into Chrome extensions (that could ideally utilize the existing autofill data and allow us to save new ones - more than 1k). Or, potentially, looking after Firefox and its limit for autofill user data. Any ideas about how to extend the autofill user data limit in Chrome?

user984621
  • 46,344
  • 73
  • 224
  • 412
  • If it only happens on some user's machines, is it possible they have some extensions which could cause a problem? Are they running many other tabs with other things going on? Can it be reproduced after a fresh restart of Chrome after clearing cookies/cache/ local storage etc? – lacostenycoder May 01 '19 at 18:19
  • Do the request look different in the logs? How do they look like? – spickermann May 01 '19 at 18:20
  • @lacostenycoder added answers under **EDIT 3+4**. Fresh restart of Chrome (or even whole Windows 10) doesn't matter, it still freezes. I originally thought that the problem will be related to the high usage of RAM memory, as many people on the Internet face the memory issue in the combinantion with Chrome, but RAM is surprisingly calm, contrary to the CPU. I found https://www.drivereasy.com/knowledge/chrome-high-cpu-usage-solved/ - I'm going to try this yet and slowly running out of ideas. This is a "work" laptop, so there's a minimum of programs installed. – user984621 May 01 '19 at 18:54
  • @spickermann I am analyzing the Apache logs now and will post it here, however, I cannot think of what could possibly be there different (in params etc) compared to other laptops. – user984621 May 01 '19 at 18:56
  • Are you sure you're running the sidekiq jobs async? (e.g. perform_later) Also, can you share any of the code? Can you expose the chrome tools & view the networking tab & console tabs (via trying this twice) – Jay Dorsey May 01 '19 at 20:13
  • How long do these requests take in your rails log? I'd guess that this issue is client side, but just to be safe. – thesecretmaster May 02 '19 at 16:55
  • @JayDorsey just double checked that, every single Sidekiq job is run as async. Due to complexity, I am afraid it would not be beneficial. As of the Chrome tools, I tried to do it, but when the freeze comes, nothing is shown in Chrome Dev Tools – user984621 May 02 '19 at 17:47
  • Is hardware accelaration in chrome off/on? Can you try turning it off? Also, an you open the Google Chrome task manager (not windows) when you click and see if any extensions spike memory/CPU/network? – Jay Dorsey May 02 '19 at 18:10
  • Also, antivirus running on any/all computers? And do you ahve Adobe Reader DC on any/all of the computers? – Jay Dorsey May 02 '19 at 18:12
  • Hello all, thank you for tips and comments. We found that the problem is most likely in Chrome's autofill limit for saved users data. I summarized it under the point **EDIT 6**. Now, I am looking in Chrome's setup to see if there's a workaround for being able to save more than 1,000 user autofill data. – user984621 May 08 '19 at 10:18

0 Answers0