Improve instance start time - k8s only
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 149
Description
### Description
The main overhead in starting a new NR instance is running `npm install` to get the modules installed. Due to the CPU/Memory limits applied to the instance, npm is throttled.
The proposal here is to update the k8s driver to use an [Init Container](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) to run the initialisation of the instance. This container can have a larger CPU/memory allocation to allow npm to complete faster.
The will require an update to `nr-launcher` to add a flag so it only runs the initialisation phase (get settings from platform, run npm install), as well as a flag to skip the initialisation phase (as it assumes the init container has run and setup the filesystem properly).
**Out of scope**: this only addresses the `npm install` run at startup. It will not improve performance of npm install in a running instance as that will be under the existing cpu/memory constraints.
Contributor guide
Assessment
This issue has not been assessed yet.