core
core copied to clipboard
Server performance degrades as more concurrent users hit an SSR-ed Vue app
Vue version
3.4.19
Link to minimal reproduction
https://github.com/prashantpalikhe/vue-ssr-perf-showcase
Steps to reproduce
In the reproduction repo
What is expected?
Server response time should stay as close to the app render time when the number of concurrent users increases.
What is actually happening?
App render time stays low. But the server response time increases dramatically as the number of concurrent users increases.
System Info
System:
OS: macOS 14.3.1
CPU: (10) arm64 Apple M1 Max
Memory: 16.82 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.5.1 - ~/.nvm/versions/node/v20.5.1/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 9.8.0 - ~/.nvm/versions/node/v20.5.1/bin/npm
pnpm: 8.10.2 - ~/.nvm/versions/node/v20.5.1/bin/pnpm
bun: 1.0.22 - ~/.bun/bin/bun
Browsers:
Chrome: 122.0.6261.57
Chrome Canary: 124.0.6315.0
Safari: 17.3.1
npmPackages:
vue: ^3.4.19 => 3.4.19
Any additional comments?
No response
Give @fastify/vite
a try, referencing the example at @fastify/vue
.
$ pnpm dlx degit fastify/fastify-vite/starters/vue-base vue-fastify-ssr
$ cd vue-fastify-ssr
$ pnpm install
$ pnpm build
$ pnpm start
I will give it a try, but I have noticed the same with Nuxt where H3 is used. So I don't think, in this case, it's a server-type issue
@Shyam-Chen Same with fastify-vite as well
Also tried the same test (as much as I could) with Fastify Vite Vanilla React as well. There the problem is far lesser compared with Vue.
Tested with the recent commits (4bc9f39f028af7313e5cf24c16915a1985d27bf8, 6af733d68eb400a3d2c5ef5f465fff32b72a324e, ca84316bfb3410efe21333670a6ad5cd21857396) on your repo, they did improve things significantly. On my machine the curl response time stays consistent within the 0.006 to 0.02s range throughout the k6 run.
There are still room for improvements but I believe this can be considered solved for now.
That is absolutely amazing @yyx990803
Thank you so much!