-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Improve start-up time by not loading unused modules #9389
Comments
Thanks for opening this issue!
|
I'm closing this as it does not seem to be bug report or a feature request.
|
I thought it would be a nice feature to communicate about. |
Was this indeed a feature request? Could you please edit your initial post by using the template provided when opening an issue to help clarify what specific feature you are requesting? Then we can re-open this. |
I would like to try and do it myself, but I'm on Windows and it doesn't look like it's supported. |
Thanks for editing the post and using the template. It sounds like you'd suggesting to speed up the start time of Parse Server. A start-up time that is fast enough for you may not be fast enough for someone else, so in order to keep this open as a feature request, we'd need to specify an objective goal or metric by which the issue can be considered closed. For example, we already have open feature requests to move Postgres, GraphQL and other adapters out of the Parse Server code base. Or is there a quicker approach you are suggesting to implement in the meantime? Could Parse Server be optimized by just not loading certain modules in code if they are not configured in Parse Server? That would make sense I guess and probably shouldn't be too difficult to implement? @Moumouls has experience with Parse Server running on serverless, maybe he has some input here? |
New Feature / Enhancement Checklist
Current Limitation
Because parse-server is compiling a lot of unused dependencies (Live Queries, Postgres, redis, ...), the startup is slow.
It prevents us from using Parse in cheap configurations of serverless hosting solutions, like Google Cloud Run with min-instances=0 .
Feature / Enhancement Description
Feature request : a fast startup,
prevent those unused dependencies from compiling, maybe by putting the imports inside conditions. For instance :
Example Use Case
You're starting a new project. With a fast startup, you can have a nice server (4 Go and 2 CPUs) for almost nothing.
On Cloud Run, the CPU is turned off between requests, you only pay for the RAM, and after 15 minutes, the instance is unmounted. Add to this the fact that, in a month, 60 CPU-hours are free and 125 Go-hours are free.
But for this, you need to be able to have a fast startup. In my current project, a cold restart takes approximately 12 seconds. I think we could reach a few seconds.
Alternatives / Workarounds
I can put the min-instances to 1. When a second or third instance is started, Cloud Run waits before sending requests.
And between requests, when there's no CPU, you only pay for RAM and a special fee for "inactive instances".
Details
Here's a startup profile with all the unnecessary compiled code in red (at least 70% of all the compiled code).
It's on my big local machine. On the server, all time are multiplied by 4, at least.
There might be another problem : all the schemas are loaded at once to build the cache, but let's stick with the compilation issue for now :)
thx
The text was updated successfully, but these errors were encountered: