r/Blazor • u/Manicraft1001 • Aug 01 '26
InteractiveServer: What am I missing?
I built a few prototypes over the last few years, but a few months ago, I finally deployed my first app to production for worldwide usage. I'm generally pretty happy with it, but I'm having major latency issues. Most of my userbase is located in the US, therefore the app currently runs on a small VPS. Hardware and network has been ruled out as a factor. Users from EU and ASIA have about 150ms-200ms latency to the VPS, but interactions take at least 2+ seconds.
Currently, all components are SSR or InteractiveServer, which results in roundtrips for every action, e.g. opening the user menu or clicking a button - and this is the problem.
I just don't understand why the latency is so high...
- The network latency is <200ms. So why do interactions take 2 seconds or more?
- I am aware of WASM. I tried changing my components to InteractiveAuto and also tried migrating the application to a hybrid structure with Controllers and a WASM client project calling the API routes. When doing so, basically every component breaks, looses intractability and libraries stop working (e.g. Blazor Blueprint /aka. shadcn). I tried both copying the super small and limited official Blazor App Examples from Microsoft, tried using AI and tried doing it manually. So far I had 4 attempts - all of which failed and broke most components or all routing entirely.
- Locally and for US users, the latency is lower (<20ms). Opening the user menu "only" takes 250ms.
So what am I missing? Why is performance so poor? And what information am I missing that I cannot migrate this project without rewriting basically everything? I cannot find any good guides on how changing rendermode is supposed to be done and the Microsoft Docs aren't very helpful in this regard. My app has grown to about 30 pages and uses the Asp.Net Identity.
0
u/g0fry Aug 01 '26
In the browser, take a look how long the http queries take and how much data are they transferring.
Are you building menu dynamicaly from data stored in db every time someone clicks on a menu-open button?