Connectivity Issue when remote

This is a interesting problem that I have had and not sure what to try next. Any time im connected remotely either over vpn, or with port forwarding. If im trying to edit a history stat helper. I loose connectivity for a few min. While this is happening If I connect to a pc on the same lan I can still access and do everything when remote connectivity is not running. I have also tried this with different routers and internet connections and the same issue persists so I dont think this is a issue related to the router / isp settings. I thinks something with homeassistant websocket is having a issue when not on the same lan but not sure how to troubleshoot this futher. Or if this a known issue currently.

@Antasp3136 Propably when you save/edit a history_stats helper, HA does some heavy DB operation. So if (i do not know where you run it) HA runs on a RPi with the database on SD card it does not have time to answer the websocket ping/pong heartbeat in time so the connection drops, and reconnect is slow because the server is busy doing that same recompute for few minutes liek you said

That makes sense. Im running it in a vm on unraid. i7 13700k with the vm disk on a nvme ssd. Ive been on this config for a few years now. I think when i originally setup homeassistant it was HAOS v9.4 so its been through many updates. Wonder if its time to spin up a clean instance and start setting things up from scratch. Ive removed alot of stuff but not sure how many things stay in the DB. This is what the disk metrics of the system looks like.

It looks good, but you probably should clean some backups (keep some of the oldest ones and some of the newest ones)