Why there is performance degradation after ~6 hours of Java 9 G1 work without the actual increase in load?

后端 未结 1 814
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 01:25

I switched 1 instance (2 vCPU, 2GB RAM, load ~4k req/sec) to Java 9 (from latest Java 8). For a while, everything was fine and CPU usage was same as before. However, after ~

相关标签:
1条回答
  • 2020-12-29 01:56

    (Note that GC tuning is extremely dependant on the environment, so there is no magic recipe.)

    Had a very similar issue with G1. By default, it seems to be rather badly suited for REST endpoints (again, this is only what I experienced in my direct neighborhood). What helped me was experimenting with the GC flags, as described here.

    For us, the biggest improvements came from -XX:G1NewSizePercent=25 and -XX:MaxGCPauseMillis=50. G1 is also auto-tuning itself over time, so the max. GC pause limit has a significant effect on all other parameters.

    0 讨论(0)
提交回复
热议问题