-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Enable heap snapshots for POSIX distributables #182082
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
Conversation
|
Pinging @elastic/kibana-core (Team:Core) |
| NODE_OPTIONS="--no-warnings --max-http-header-size=65536 $KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli/dist" "${@}" | ||
| # Enable capturing heap snapshots. See https://nodejs.org/api/cli.html#--heapsnapshot-signalsignal | ||
| # For now only on POSIX platforms, term signals work differently on Windows. | ||
| NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="--heapsnapshot-signal=SIGUSR2 --diagnostic-dir=./data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On deb and rpm package this isn't going to work. The kibana user will not have write access to anything in /usr/share/kibana. The data directory is at /var/lib/kibana.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For tar.gz it should be something like this to support starting Kibana from outside the root directory:
| NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="--heapsnapshot-signal=SIGUSR2 --diagnostic-dir=./data" | |
| NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="--heapsnapshot-signal=SIGUSR2 --diagnostic-dir=${DIR}/data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="--heapsnapshot-signal=SIGUSR2 --diagnostic-dir=/var/lib/kibana"
and then in bin/kibana:
NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT="${NODE_OPTIONS_HEAPSNAPSHOT_DEFAULT:---heapsnapshot-signal=SIGUSR2 --diagnostic-dir=${DIR}/data}"
Mind if we add the ci:build-all-platforms and ci:build-os-packages labels after to test if we go this route?
jloleysens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also tested submitting a heap snapshot workflow on serverless
💚 Build Succeeded
The CI Stats report is too large to be displayed here, check out the CI build annotation for this information. History
To update your PR or re-run it, just comment with: cc @jloleysens |
Summary
See #181363
Changed the approach to only enable this by default for POSIX platforms (added defaults to the
bin/kibana.shscript). Can be tested in the same way as the previous PR but only available on Linux/macOS.