Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server performance degrades as more concurrent users hit an SSR-ed Vue app #10383

Closed
prashantpalikhe opened this issue Feb 23, 2024 · 7 comments

Comments

@prashantpalikhe
Copy link

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

@prashantpalikhe
Copy link
Author

CleanShot 2024-02-23 at 11 38 05@2x

@Shyam-Chen
Copy link
Contributor

Shyam-Chen commented Feb 23, 2024

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

@prashantpalikhe
Copy link
Author

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

@prashantpalikhe
Copy link
Author

@Shyam-Chen Same with fastify-vite as well

@prashantpalikhe
Copy link
Author

prashantpalikhe commented Feb 23, 2024

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.

@yyx990803
Copy link
Member

Tested with the recent commits (4bc9f39, 6af733d, ca84316) 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.

@prashantpalikhe
Copy link
Author

That is absolutely amazing @yyx990803

Thank you so much!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants