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

Clarify usage of jvm.options in its comments #61456

Merged

Conversation

DaveCTurner
Copy link
Contributor

Since #51882 we recommend not editing the jvm.options file, preferring
instead to override its contents with additional files in
jvm.options.d. However the inline comments in this file do not point
users in that direction. This commit adjusts these inline comments.

Since elastic#51882 we recommend not editing the `jvm.options` file, preferring
instead to override its contents with additional files in
`jvm.options.d`. However the inline comments in this file do not point
users in that direction. This commit adjusts these inline comments.
@DaveCTurner DaveCTurner added >enhancement :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v8.0.0 v7.10.0 labels Aug 24, 2020
@DaveCTurner DaveCTurner requested a review from jasontedor August 24, 2020 08:13
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Packaging)

@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Aug 24, 2020
DaveCTurner referenced this pull request Aug 24, 2020
This commit moves JVM options that we are setting on behalf of the user
that we do not expect them to fiddle with out of the jvm.options
configuration file and into the JVM options parser. In this way, we
discourage fiddling with these settings, but more importantly, we ensure
that as we evolve or add to these settings that a user would pick these
pick instead of being left behind if they have a modified jvm.options
file and do not pick any new that come with the distribution.
Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too, just one suggestion

## All settings below here are considered expert settings. Do
## not tamper with them unless you understand what you are
## doing. If you want to adjust any of these settings then do
## not do so by editing this file; instead, create a new file in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording here is a bit confusing (when I first read it, I think it is do so, my mind accidentally skipped over the first "do not"). Could we simplify the first clause to simply If you want to adjust any of these settings then do not edit this file;?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, the line break ended up in a bad place there. I tried a few ideas and ended up copying the wording from the earlier section, see cd1b171.

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments.

## should create one or more files in the jvm.options.d
## directory containing your adjustments.
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/jvm-options.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to avoid a link here, since it could easily break in the future. It also will link users to the wrong version for their version. For example, linking to current would redirect a user to 8.0.0 when that's released, but maybe they're on 7.9 and we've made breaking changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too worried about breaking this link, the docs team put quite some effort into avoiding broken links to current docs in future versions since it's so harmful to the searchability of our docs. Note that there's prior art: we already include a link to the current heap size docs further down this file.

I couldn't see a simple way to link to the correct version of these docs today, although this would be a nice feature to have.

Copy link
Contributor Author

@DaveCTurner DaveCTurner Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the spirit of progress over perfection I merged this PR and opened #65808 regarding this comment.

(edit: fixed link)

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
# Xms represents the initial size of the JVM heap
# Xmx represents the maximum size of the JVM heap

-Xms${heap.min}
-Xmx${heap.max}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should take this further and remove this from this file. The way I envision this working is that in JvmOptionsParser, we'd emit a -Xms1g and/or -Xmx1g if Xms (MinHeapSize) or Xmx (MaxHeapSize) are not set respectively.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes; does the same reasoning apply to all the other settings in this file too?

However I don't have the capacity to take this work on myself at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can pick this up - I'll raise a new issue to move the default heap settings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I raised #61514.

@andreidan andreidan added v7.11.0 and removed v7.10.0 labels Oct 7, 2020
@mark-vieira mark-vieira added Team:Delivery Meta label for Delivery team and removed Team:Core/Infra Meta label for core/infra team labels Nov 11, 2020
@DaveCTurner DaveCTurner merged commit 1a3fefb into elastic:master Dec 3, 2020
@DaveCTurner DaveCTurner deleted the 2020-08-24-jvm-options-comments branch December 3, 2020 10:56
DaveCTurner added a commit that referenced this pull request Dec 3, 2020
Since #51882 we recommend not editing the `jvm.options` file, preferring
instead to override its contents with additional files in
`jvm.options.d`. However the inline comments in this file do not point
users in that direction. This commit adjusts these inline comments.
@pugnascotia pugnascotia changed the title Clarify usage of jvm.options in its comments Clarify usage of jvm.options in its comments Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts >enhancement Team:Delivery Meta label for Delivery team v7.11.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants