-
Notifications
You must be signed in to change notification settings - Fork 1.3k
packaging: enable Parallel Collector GC for management server #4407
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
The default GC algorithm G1 that is enabled by default with Java11 serves well on multiprocessor machines with large amount of memory where GC is probablistic with low pauses, where response time is more important than throughput and GC is kept shorter. The CloudStack management server is largely a multi-threaded server application that handles and orchestrates several network requests, and has the default max. heap size of only 2G that can be considered a small/medium application from a heap size perspective. Perhaps a more aggresive GC algorithm such as ParallelGC as used in Java8 and before (that is previous CloudStack releases) would serve better for throughput and cause more aggresive GC. Reference: https://docs.oracle.com/en/java/javase/11/gctuning/available-collectors.html#GUID-13943556-F521-4287-AAAA-AE5DE68777CD Signed-off-by: Rohit Yadav <[email protected]>
|
@blueorangutan package |
|
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2182 |
|
Smoketests against vmware kicked |
|
@rhtyd Good to see change in the GC for management server process. Even though Parallel GC is the fastest, there are some side effects of using Parallel GC.
[1] http://openjdk.java.net/jeps/248 I think, it is better to control such pause times using option "-XX:MaxGCPauseMillis", when we opt for Parallel GC. |
|
Trillian test result (tid-2957)
|
|
@sureshanaparti okay I'll add that and do some tests, however, the max. heap size is very small (2G) the pauses would affect memory-heavy application such as databases or some sort of application that have huge heaps (10-100s of GBs). I think given CloudStack is largely a network application with small heap of 2G (default) even the pauses won't affect it (or its threads) much. |
Signed-off-by: Rohit Yadav <[email protected]>
|
@sureshanaparti can you check the changes now? I've added the @blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2185 |
|
@blueorangutan test centos7 vmware-67u3 |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests |
|
Let's do one KVM too |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
DaanHoogland
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.
I'm ok, it seems that users/operators can tweak this however they wish so I don't think we are hurting anybody.
|
Trillian test result (tid-2968)
|
|
Trillian test result (tid-2967)
|
Pearl1594
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.
LGTM
nvazquez
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.
LGTM
harikrishna-patnala
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.
I've been keeping an eye on a setup with these changes and MS is stable. So LGTM.


Types of changes
The default GC algorithm G1 that is enabled by default with Java11
serves well on multiprocessor machines with a large amount of memory where
GC is probabilistic with low pauses, where response time is more
important than throughput and GC is kept shorter.
The CloudStack management server is largely a multi-threaded server
application that handles and orchestrates several network requests and
has the default max. heap size of only 2G that can be considered a
small/medium application from a heap size perspective. Perhaps a more
aggressive GC algorithm such as ParallelGC as used in Java8 and before
(that is previous CloudStack releases) would serve better for throughput
and cause more aggressive GC.
This PR proposes a change in the default GC algorithm to avoid OOM issues.
Reference: https://docs.oracle.com/en/java/javase/11/gctuning/available-collectors.html#GUID-13943556-F521-4287-AAAA-AE5DE68777CD
Types of changes
How this was tested
Heap activity for Java11 with G1 (default GC algorithm):

Heap activity seen after switching to ParallelGC:


... and over time with some constant load (listApis calls to simulate Primate logins every 1s, all GC/heap graphs look stable):
Heap, thread etc activities with the ParallelGC and max pause time setting (500ms):
