# Dashboard load times \> 30 sec with more than 250 connections to website

**URL:** https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [10 October 2024 21:24 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305 "2024-10-10T21:24:35Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [11 October 2024 15:14 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/21 "2024-10-11T15:14:24Z")

</div>

Polling shouldn't be a problem, if you look a one line lower down the list there is a websocket version that is connected.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 October 2024 15:23 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/22 "2024-10-11T15:23:45Z")

</div>

Agreed. But, there was 10+sec worth of polling before the WS established.

the first took a few hundred ms, the highlighted one took 10+ secs to return, then the WS was established.

---

<div class="post-metadata">

### Author: ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)
#### Post date: [11 October 2024 15:23 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/23 "2024-10-11T15:23:53Z")

</div>

Ahhhh. So all these errors are from an issue with the websocket?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/c/fc6887240200fb2c3a11484be732a9503e81d1e4.jpeg)

This is normal?  
They are not errors, just normal system handshakes?

---

<div class="post-metadata">

### Author: ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)
#### Post date: [11 October 2024 15:26 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/24 "2024-10-11T15:26:21Z")

</div>

> [@TotallyInformation](#):
>
> Quite possibly the result of an unconfigured proxy? If the Caddy proxy is live, it needs to be configured for websockets.

It seems that Caddy proxies websockets out of the box.  
Some Google results are saying that you only need to tweak the config file if the websockets are on a different port: [How to correctly setup Caddy proxy to work with websocket? · Issue #363 · mattermost/mattermost-docker · GitHub](https://github.com/mattermost/mattermost-docker/issues/363)

EDIT: Caddy auto setup confirmed here: [Caddy Websocket Configuration - Technical assistance - Zammad - Community](https://community.zammad.org/t/caddy-websocket-configuration/13414)

Does Node-RED dash2 use a different port for websocket data?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 October 2024 15:31 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/25 "2024-10-11T15:31:39Z")

</div>

> [@thebaldgeek](#):
>
> Does Node-RED dash2 use a different port for websocket data?

That depends how you have configured things. By default, node-red runs on 1880. web typically on 80 (or 443)

So that _might_ be a contributing factor

> [@thebaldgeek](#):
>
> This is normal?  
> They are not errors, just normal system handshakes?

there are lots of reasons for the timeouts:

1. Network Latency or Unstable Connection
2. Misconfigured `pingTimeout` and `pingInterval`
3. Server Overload or High CPU Usage
4. Proxies, Firewalls, or Load Balancers
5. Client-Side Disconnects
6. WebSocket Version Mismatch or Bugs
7. Mobile and Battery Saving Modes

Take your pick.

No 4 ties up with the default port thing you mentioned.  
No 2 is something we might need to look at  
No 5, 6 and 7 are really out of your control so can be mostly dismissed for now

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [11 October 2024 15:33 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/26 "2024-10-11T15:33:04Z")

</div>

> [@thebaldgeek](#):
>
> Does Node-RED dash2 use a different port for websocket data?

Not a different port to Node-RED itself.

---

<div class="post-metadata">

### Author: ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)
#### Post date: [11 October 2024 15:35 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/27 "2024-10-11T15:35:30Z")

</div>

> [@Steve-Mcl](#):
>
> No 2 is something we might need to look at

I've been wondering if there is a nodejs (or something similar in my control) setting somewhere I've missed form the default Node-RED install.  
Where do I find the `pingTimeout` and `pingInterval` settings?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [11 October 2024 15:38 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/28 "2024-10-11T15:38:33Z")

</div>

> [@Steve-Mcl](#):
>
> Misconfigured `pingTimeout` and `pingInterval`

Certainly getting a lot of ping timeouts. Though that is usually due to heavy traffic I think.

Having looked more closely at the site, I can see that it does carry a MASSIVE amount of live data and some of the messages are quite large - like 25k

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/63b9cb43266ec8ad6c1908678b93423d04fe967d.png)

I think with that amount of live data, when you hit some critical number of users, it is simply hitting throughput issues. And once the backlog starts to build, you get a cascade effect that rapidly multiplies the issue.

The best approach is almost certainly - assuming you want to continue using D2 - to split into Multiple Node-RED instances so that you can split the data displays between multiple dashboards.

* * *

Unless, that is, someone can think of a way to stop D2 sending data for all "pages" all the time for every connected client.

Is there a way to stop Node-RED sending messages for content that isn't actually visible/active for a connected client?

---

<div class="post-metadata">

### Author: ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)
#### Post date: [11 October 2024 15:52 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/29 "2024-10-11T15:52:27Z")

</div>

> [@TotallyInformation](#):
>
> some of the messages are quite large - like 25k

Any tips on how I find those?  
I just now looked at Firefox and Chrome web tools to try and match your screenshot and cant find it.  
I'd love to know what ones are the big messages and see if I can do anything about them.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 October 2024 15:52 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/30 "2024-10-11T15:52:58Z")

</div>

select the WS in the network list, then look at messages tab

You might need to refresh the page while devtools is open

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [11 October 2024 15:53 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/31 "2024-10-11T15:53:27Z")

</div>

> [@thebaldgeek](#):
>
> Any tips on how I find those?

Go to the network tab, you may need to reload the page. Then look for the entry with the code `101` and click on it, then go to the messages tab.

You will see that the client continuously receives messages for "pages" that are not actually active.

I put the word pages into quotes because D2 is actually a single-page app and its apparent pages are not, they are loaded/unloaded Vue components.

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [11 October 2024 15:57 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/32 "2024-10-11T15:57:00Z")

</div>

I think those massive messages are related to the page with the maps and fly traffic on them. Still can't say if the data contains only necessary stuff. You need to figure out that by yourself.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [11 October 2024 15:57 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/33 "2024-10-11T15:57:55Z")

</div>

> [@hotNipi](#):
>
> I think those massive messages are related to the page with the maps and fly traffic on them

At least one of the ones I looked at seems to contain a complete dataset for a specific aircraft.

---

<div class="post-metadata">

### Author: ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)
#### Post date: [11 October 2024 16:02 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/34 "2024-10-11T16:02:33Z")

</div>

> [@TotallyInformation](#):
>
> Then look for the entry with the code `101` and click on it, then go to the messages tab.

I found the 101 in FF and Chrome, but cant see the messages tab?

Firefox

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f6b1f43f018d36d01832897d3dac92ae5107b3bf.png)

Chrome

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f20a39ad3a1a2e020bba043953b53ca2bb51d302.png)

Why do my 101 area (after reload) show zero bytes, but you have a lot more?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [11 October 2024 16:03 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/35 "2024-10-11T16:03:50Z")

</div>

> [@thebaldgeek](#):
>
> Why do my 101 area (after reload) show zero bytes, but you have a lot more?

That's because of how websockets works - that overview line doesn't show you much. Let me fire up firefox to find the right data there.

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [11 October 2024 16:08 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/36 "2024-10-11T16:08:33Z")

</div>

Network tab and select websockets

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/4999848c698299dceb2654db4b0fe663c5ab5ebe.png)

Then click on socket url and choose tab messages

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/4/5433336f869f3a181e984635a70eea1fab3a0a81.png)

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [11 October 2024 16:09 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/37 "2024-10-11T16:09:20Z")

</div>

> [@TotallyInformation](#):
>
> Let me fire up firefox to find the right data there.

The messages are shown on the Response tab in firefox.

---

<div class="post-metadata">

### Author: ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)
#### Post date: [11 October 2024 16:15 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/38 "2024-10-11T16:15:59Z")

</div>

Ok I see a zillion messages scrolling now.  
No way to tell the size, so its impossible for me to figure if I can reduce the size of any of them.  
I cant even tell where any of them are coming from in the code, they all look like family walking past me, they all belong and I know each of them from the first few characters, but hard to say much more at the speed they are scrolling up the page.

Interesting I see the socket IDs  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/7/8782717170388342e30b1aadaa59182effcc816b.png)

I guess these are the ones I am seeing timeout in the PM2 log. Thats starting to join the dots a bit for me now.

@TotallyInformation Where did you get this from?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/0/80f090511119793781a87472038014c58e1d1c59.png)

This seems a LOT more useful in tracking down the bigger message sources.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 October 2024 16:16 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/39 "2024-10-11T16:16:55Z")

</div>

> [@thebaldgeek](#):
>
> Where did you get this from?

Chrome - as per @hotNipi screenshots

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [11 October 2024 16:27 UTC](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305/40 "2024-10-11T16:27:30Z")

</div>

Maybe I was wrong about the page...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b1dabdea3693800821353a58df11b620b62c3b61.png)

Still, every item in array contains `Raw` parameter which seems again dead payload.

[Previous page](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305.md?page=1)

[Next page](https://discourse.nodered.org/t/dashboard-load-times-30-sec-with-more-than-250-connections-to-website/92305.md?page=3)
