-
Notifications
You must be signed in to change notification settings - Fork 81
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
[Doc] add memory suggestion #454
[Doc] add memory suggestion #454
Conversation
docs/index.asciidoc
Outdated
This plugin uses direct memory which is not included in the heap memory. | ||
By default, it is the same as the heap size (Xmx), for example, setting 10GB Xmx means setting 10GB of direct memory. | ||
Make sure heap and direct memory does not exceed the total size of the server. You can set the amount of direct memory with -XX:MaxDirectMemorySize. |
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.
This plugin uses direct memory which is not included in the heap memory. | |
By default, it is the same as the heap size (Xmx), for example, setting 10GB Xmx means setting 10GB of direct memory. | |
Make sure heap and direct memory does not exceed the total size of the server. You can set the amount of direct memory with -XX:MaxDirectMemorySize. | |
This plugin uses direct memory (bypassing the CPU) to improve performance. | |
Direct memory and heap size (Xmx) allocations are separate, but are the same by default. | |
For example, setting 10GB Xmx sets direct memory to 10GB. | |
You can change the amount of direct memory with -XX:MaxDirectMemorySize. | |
NOTE: Be sure that heap and direct memory total allocation does not exceed the total size of the server. |
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.
Left some suggestions inline for consideration.
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.
I would like for this doc (and/or for the suggested doc addition in LS-core) to cover the consequences of having direct memory limit too low or too high. From my understanding, setting it too high will cause a runtime failure to allocate the direct memory, but if we set it too low do we merely not buffer as much from the inbound connections?
docs/index.asciidoc
Outdated
===== Memory usage | ||
|
||
This plugin uses direct memory which is not included in the heap memory. | ||
By default, it is the same as the heap size (Xmx), for example, setting 10GB Xmx means setting 10GB of direct memory. |
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.
By default, it is the same as the heap size (Xmx), for example, setting 10GB Xmx means setting 10GB of direct memory. | |
By default, a JVM's off-heap direct memory limit is the same as the heap size. | |
For example, setting a heap size of 10GB without setting the direct memory limit will result in the direct limit _also_ being 10GB for a total of 20GB. |
docs/index.asciidoc
Outdated
|
||
This plugin uses direct memory which is not included in the heap memory. | ||
By default, it is the same as the heap size (Xmx), for example, setting 10GB Xmx means setting 10GB of direct memory. | ||
Make sure heap and direct memory does not exceed the total size of the server. You can set the amount of direct memory with -XX:MaxDirectMemorySize. |
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.
Make sure heap and direct memory does not exceed the total size of the server. You can set the amount of direct memory with -XX:MaxDirectMemorySize. | |
Make sure heap and direct memory combined does not exceed the total memory available on the server. | |
You can set the amount of direct memory with `-XX:MaxDirectMemorySize` in {logstash-ref}/jvm-settings.html[Logstash's JVM Settings]. |
We should also add an off-heap section to Logstash's JVM Settings.
docs/index.asciidoc
Outdated
[id="plugins-{type}s-{plugin}-memory"] | ||
===== Memory usage | ||
|
||
This plugin uses direct memory which is not included in the heap memory. |
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.
since direct memory has historically also been called "off-heap", including that phrasing will help people find and/or understand this doc.
This plugin uses direct memory which is not included in the heap memory. | |
This plugin uses "off-heap" direct memory _in addition to_ heap memory. |
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.
Couple of suggestions, but final approval should go to @karenzone or @kilfoyle
docs/index.asciidoc
Outdated
|
||
This plugin uses direct memory which is not included in the heap memory. | ||
By default, it is the same as the heap size (Xmx), for example, setting 10GB Xmx means setting 10GB of direct memory. | ||
Make sure heap and direct memory does not exceed the total size of the server. You can set the amount of direct memory with -XX:MaxDirectMemorySize. |
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.
Maybe add a link to the jvm settings doc in logstash core?
We should also update that document too, along the lines of this issue
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.
Adding a link sounds good. Users mostly come across direct memory with beats-input. I will update the JVM settings page. Thanks for the pointer
docs/index.asciidoc
Outdated
This plugin uses direct memory which is not included in the heap memory. | ||
By default, it is the same as the heap size (Xmx), for example, setting 10GB Xmx means setting 10GB of direct memory. |
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.
This plugin uses direct memory which is not included in the heap memory. | |
By default, it is the same as the heap size (Xmx), for example, setting 10GB Xmx means setting 10GB of direct memory. | |
This plugin uses direct memory which is allocated in addition to that allocated to the heap. | |
By default, this is set to the same value as allocated to the heap via the `Xmx` flags. For example, setting `-Xmx10G` will allocate `10GB` for heap and an additional `10GB` for direct memory, for a total of `20GB` allocated. |
@yaauie Logstash can start with |
Co-authored-by: Karen Metts <[email protected]> Co-authored-by: Rob Bavey <[email protected]> Co-authored-by: Ry Biesemeyer <[email protected]>
@karenzone Thanks for the suggestion. I have combined everyone's ideas into one. Also, I update the JVM session in logstash core elastic/logstash#14431 Please review both PRs. |
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.
Left some minor suggestions inline. Otherwise, LGTM
docs/index.asciidoc
Outdated
For example, setting `-Xmx10G` without setting the direct memory limit will allocate `10GB` for heap and an additional `10GB` for direct memory, for a total of `20GB` allocated. | ||
You can set the amount of direct memory with `-XX:MaxDirectMemorySize` in {logstash-ref}/jvm-settings.html[Logstash's JVM Settings]. Consider setting it to half of the heap size. Setting too low direct memory decreases the performance of ingestion. | ||
|
||
NOTE: Be sure that heap and direct memory combined does not exceed the total memory available on the server to avoid OutOfDirectMemoryError |
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.
What about "... to avoid an OutOfDirectMemoryError." (singular) or "... to avoid errors." (plural)
Co-authored-by: Karen Metts <[email protected]>
Many users come across
java.lang.OutOfMemoryError: Direct buffer memory
This commit adds a memory session to set the expectation of how much memory the plugin could use.