<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 20, 2017 at 11:43 AM, Hector Caballero <span dir="ltr"><<a href="mailto:hector.caballero@ericsson.com" target="_blank">hector.caballero@ericsson.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
We've been troubleshooting a big traffic application for some time now and have discovered GC times are impacting performance. Next paragraph just to give some context:<br>
<br>
We are using G1 GC with JDK 8u131 on a RHEL 6 server with latest patches and these JVM parameters:<br>
<br>
javaOptions = -Xms128g<br>
javaOptions = -Xmx128g<br>
javaOptions = -XX:MetaspaceSize=128m<br>
javaOptions = -XX:+UseG1GC<br>
javaOptions = -XX:InitiatingHeapOccupancyPer<wbr>cent=15<br>
javaOptions = -XX:MaxGCPauseMillis=200<br>
javaOptions = -XX:+ParallelRefProcEnabled<br>
javaOptions = -XX:SoftRefLRUPolicyMSPerMB=0<br>
javaOptions = -XX:ParallelGCThreads=24<br>
javaOptions = -XX:+PrintGCDetails<br>
javaOptions = -XX:+PrintGCDateStamps<br>
javaOptions = -XX:+PrintTenuringDistribution<br>
javaOptions = -XX:+PrintAdaptiveSizePolicy<br>
javaOptions = -XX:+PrintReferenceGC<br>
javaOptions = -XX:+UnlockDiagnosticVMOptions<br>
javaOptions = -XX:+G1SummarizeRSetStats<br>
javaOptions = -Xloggc:/opt/gerrit/review_sit<wbr>e/logs/jvm/jvm_gc-%t.log<br>
javaOptions = -XX:+UseGCLogFileRotation<br>
javaOptions = -XX:GCLogFileSize=40M<br>
javaOptions = -XX:NumberOfGCLogFiles=20<br>
javaOptions = -Djava.util.Arrays.useLegacyMe<wbr>rgeSort=true<br>
<br>
and the system was stable. Some precision: The IHOP value was reduced as a way to avoid having full GCs that were killing us and it worked well for this purpose. The only problem we saw with these parameters was a bit of impact on throughput but, as said, the system was still very usable.<br>
<br>
After upgrading the application to latest version, the memory pattern changed dramatically and full GCs went back making the application unusable. The main change we saw was a very fast increase in old generation (up to 115GB) while young generation kept low. As an urgent measure, the system memory was upgraded and the heap size put to 256GB with which there was a dramatic improvement in application performance but we're still seeing a big regression in some operations that are taking 3-4 times more. We understand we need to look at the code itself (this application is an open source one) to see how object creation has changed, but we have a lot of pressure of users and management to solve this right now so changes in code need to wait a bit. Our goal right now is to make the application as usable as possible tuning memory usage to give us a bit of room to start looking at the code.<br>
<br>
The increase in heap size led to very low throughput, around 70%. In order to try to improve it, we decided to relax pause goal to 300ms. Given doing this didn't affect much the application (at least it was not worse) and things improved a bit but not enough. Next we decided to try to start collecting a bit later to reduce the number of mixed collections so we increase IHOP to 18% (very modest modification). After that, looking at the GC logs we saw that, without having full GCs, there are young collections taking long time (up to a minute in a case). In some of those cases, the sys time was a lot higher than the user time, which is kind of strange and we haven't found much information about the causes of this but we see is affecting us a lot:<br>
<br>
Timestamp User Time (secs) Sys Time (secs) Real Time (secs)<br>
2017-10-20T14:19:41 1.68 9.5 0.48<br>
2017-10-20T14:19:59 2.26 9.56 0.56<br>
2017-10-20T14:34:45 12.26 14.01 1.23<br>
2017-10-20T15:26:33 9.82 31.73 2.39<br>
2017-10-20T15:26:37 15.68 46.47 3.19<br>
2017-10-20T15:26:41 10.11 39.64 2.44<br>
2017-10-20T15:28:18 15.53 45.14 3.08<br>
2017-10-20T15:29:01 5.4 41.63 2.43<br>
2017-10-20T15:29:05 74.69 93.91 11.51<br>
2017-10-20T15:29:18 80.67 137.35 18.38<br>
2017-10-20T15:30:55 19.65 23.99 2.16<br>
2017-10-20T15:31:03 11.03 29.28 1.82<br>
2017-10-20T15:31:28 4.88 8.44 0.77<br>
2017-10-20T15:31:30 1.58 59.97 3.21<br>
2017-10-20T15:31:35 57.13 135.82 14.96<br>
2017-10-20T15:32:23 25.46 150.54 14.79<br>
2017-10-20T15:33:11 87.92 112.98 16.46<br>
2017-10-20T15:35:13 17.99 32.15 2.33<br>
2017-10-20T15:35:54 154.7 191.82 29.67<br>
<br>
Any hints here?</blockquote><div>Do you have transparent huge pages (THP) enabled? This is a fairly common cause for outsized sys times. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Second question is about general tuning for this big heap as seems we're not going well so far. We've been reading a lot of documentation about the tuning of this algorithm and thought we had a fairly acceptable understanding of the process but this has proven wrong as some of our tunings (as increasing the IHOP to bigger values and increasing the number of parallel threads) haven't show improvement and rather regressions in some cases, as causing longer young collections or dropping in throughput. I'm joining a chunk of the log so you can have a quick look if possible and probably point to some ideas.<br>
<br>
Thanks a lot,<br>
<br>
Hector Caballero<br>
<br>
<br>
<br>
<br>
</blockquote></div><br></div></div>