[v11] Javascript taking too long to Load the pages. Possibly due to Chat Rooms and Chat Enabled

Hi,
Off late I have been facing a peculiar issue with what I suspect is an issue for loading of javascript at the backend. The issue is that when I open a new erpnext page on one particular Database it take ages to open the first time for example:

  1. Open a user page in a new tab would load the page half way as below in 2~3 sec but the full data takes around 60~90 sec to load, please note that we have 2 more databases running on the same server but there this problem is not happening so I am assuming that this issue is related to the Database instead of frappe or something.

  1. Similar to the above issue if we open a report in a new tab, then again the page opens up in 2~3 seconds but the actual report take like 60~90 sec to load. Also note if we try to open another report on an already opened web page then the report loads in 2~3 seconds.

I am unable to debug what is the issue with my database instance that is causing this kind of slowness on the new tabs only but not on existing tabs. How can I debug such issues? Need help in resolving it as now the delay is getting too large for comfort.

The video below is showing how long it takes to load same report on an already open tab and then on a new tab the same report takes 95 sec whereas on the old tab where I am presuming that the javascripts were loaded took just 14 sec.

Any one here who can guide me how to debug this issue with my server or instance of install

@adityaduggal if you have the slow query mode enabled into the databases you can solve this just applying the properly indexes for the slow queries.

I had a similar issue that was dramatically reduced by this.

Also some hooks can be afecting the system, that was my case also

To enable the slow query, check this

How to enable the slow query log in MySQL

1 Like

Hi Max,
Well I don’t think its related to mariadb or mysql and it more like feels like a javascript issue (my gut feeling says that) seeing the response of my server.

Also note that if I run the same database on my test environment (on my notebook) it does not show any lag of that sorts.

Also there are 2 or 3 more instances (small DB) on my production server and none of them show this kind of behaviour even though all of them are running on the same bench.

So I don’t think its really because of the slow mysql queries.

@adityaduggal The unique thing I have perceived in v11 is, after the introduction of Vue, the initialization of the pages takes more time!

And you can view this, using the browser developer tools, especially in Chrome you can take an loading snapshot. The unique thing I saw, is that after Vue, UI time is bigger, compared with the old style components of Frappe and ERPnext.

Hi,

Just an update on the issue, I have found out that this javascript loading which is taking too long is possibly due to Chat being enabled. Once I disabled the chat then the loading became super fast as expected.

Now possible reason could be that there are too many chat rooms in my account as shown below:

SELECT COUNT(*) FROM `tabChat Room`;
+----------+
| COUNT(*) |
+----------+
|     5897 |
+----------+
1 row in set (0.01 sec)

Also if I try to see the chat rooms inside from ERPNext I cannot see a single room.


Anyone here who can help me resolve this issue with Chat enabled?