Home Lab access is much faster over VPN than through local network and I ran out of ideas

Hi, I have an unusual problem - accessing my docker-hosted services is much faster (instant) when I’m connected over VPN than when I’m on my local network and I don’t know what may be causing this.

My setup is as follows:

  • I have a Synology NAS that I host all my services on (dashy, gitea, etc.)
  • I use Synology DNS to resolve my private domain
  • I have Wireguard set up on my Mikrotik router
  • The Wireguard configs on my devices point to the Synology NAS as a DNS server, so do my Mikrotik’s networks

Everything works just fine, except when I connect to anything on my NAS over my local network, it’s super slow to first load some page hosted on my NAS (~10s). After I load any page, the subsequent connections to any sevice are instant. When I don’t load anything from the NAS for a while (~a few minutes) the next load is supe slow again (again, the first load takes ~10s).

Over VPN the first connection is instant, even if I didn’t access my NAS for a few days.

A few other things that I noticed:

  • My internet connection other than to my NAS is fast, no slowdowns there
  • When I log in to DSM in my browser and keep the tab open, all the load times are instant, but when I open an ‘incognito’ window, it is again slow to load my services
  • After the DSM portal is loaded, it works very smoothly, no issues, just the initial load time is slow
  • This happens for all connections to my NAS, including opening the DSM portal
  • I don’t think it’s the DNS setup, because it also takes the same amount of time when I connect to my NAS over its ip address
  • It doesn’t seem that it’s docker reacting slowly, because over VPN there is literally no delay (when I’m saying VPN, I mean accessing it from outside my network, sometimes from another city)
  • Every time I want to push or fetch from my gitea server, I experience the same issue, except when I connect through VPN - with VPN it’s instant and the upload is fast (I have a symmetrical Gigabit). Github is always instant
  • nslookup resolves the ip of my nas instantly
  • This issue concerns all my devices - mobile phone, laptop, tablet

I’m really lost here, has anyone experienced something like this in the past? What can be causing it? I’m out of ideas what to check, and no google search helped so far. I hope my description has all the necessary details, but I’m more than happy to provide more!

Hi, I managed to solve this issue. It was not related at all to my homelab services or NAS setup as I expected, but to the inter-vlan routing. I shuffled the devices across the networks a little bit and now I have my NAS connected to the same VLAN my most used devices are in. This makes the connections instant and I can finally use my gitea server without waiting ages for any operation, and load any page right away too. Quality of life is much improved.

I am still looking for my inter-vlan routing setup to find the root cause, but until now I’ll live with this new setup as a workaround.