-
-
Notifications
You must be signed in to change notification settings - Fork 5k
ssr: memory and cpu problem #1706
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
Comments
@xsbchen @tangyue0924 https://ssr.vuejs.org/en/api.html#runinnewcontext Without it. VueRouter's Mixin was added to Vue multiple times! |
@Mart-Bogdan it seems that newest version had fixed this problm |
@xsbchen I was at 3.0.1 |
@Mart-Bogdan how to reproduce? |
in case of SSR
I'm not user if it would reproduce on heackenews https://github.com/vuejs/vue-hackernews-2.0/ Perhaps bug of SSR team. Just letting this info here, in case someone would have same bug, and find this post in Google. Perhaps add some mention to disable context in readme, don't know :-) |
A boiled down repro instead of a whole app would help to identify the problem, thanks |
I got the same issue, and no idea......... |
@ryouaki |
no,this way chould fix this problem? but,in my app ,i have a lot of request in one time from client side。if run in new context it will cost more cpu。 |
@posva I think thie issue should be reopen. I got the reason of this issue. This issue will appear only on ssr application. In my project ,I got this issue. I add beforeRouteEnter fouction on my Vue component which render on server side . and got Infinite loop with function poll. |
if you have an infinite loop, it's probably |
@posva You could do the change as above xsbchen did. Before you open the page on your browser , you should disable your network first ,and then open the link http://localhost:8080/top, and then enable the network. You will get infinite loop. |
@ryouaki sorry for late reply. I've disabled new context and all started working fine. I dunno if that's your case of issue. |
my config in server.js function createCustomRenderer (bundle, template) {
// https://github.com/vuejs/vue/blob/dev/packages/vue-server-renderer/README.md#why-use-bundlerenderer
return require('vue-server-renderer').createBundleRenderer(bundle, {
runInNewContext: false, // recommended
template,
cache: require('lru-cache')({
max: 1000,
maxAge: 1000 * 60 * 15
})
})
} |
@Mart-Bogdan currently, I had set runInNewContext to false before....... (T_T) |
I have got the reason of this issues, The poll will exit until beforeRouteEnter finished, but on nodejs, if the socket connect does not response ,and the library did not resolve or reject the error which socket hang on. the nodejs will still wait for that. so we should stop wait response when socket hang up and code ECONNRESET and the poll will not be stop..... I post a blog on juejin.im how to fixed this issue. but only chinese. |
Hi @posva. long time no see. Could we break out the poll if the loading is failed? |
@posva I'm not 100% sure but they look very similar 🙋🏻♂️. Seems the fix should be kind of simple, but maybe we need care about about the behavior after the breakout |
what do you mean with breakout? |
because this below: The poll will exit until beforeRouteEnter finished, but on nodejs, if the socket connect does not response ,and the library did not resolve or reject the error which socket hang on. the nodejs will still wait for that. so we should stop wait response when socket hang up and code ECONNRESET |
"stops the poll"😂 |
I do not think stop the poll can fix this issue, But it is true ,we should stop it at right time. |
Version
2.7.0
Reproduction link
https://github.com/vuejs/vue-hackernews-2.0
Steps to reproduce
beforeRouteEnter
event tosrc/views/CreateListView.js
:console.log
tovue-router.common.js
line2058
:http://127.0.0.1:8080/
What is expected?
memory can be gc collected
What is actually happening?
memory and cpu grow up, and it keeps printing
vue-router poll
The text was updated successfully, but these errors were encountered: