Hi all,

We have recently investigated some GC options. Based on the product
scenarios of IoTDB, we have selected some general JVM GC options. For
options that are completely beneficial and harmless, we plan to
directly add them to the default startup options of IoTDB; For options
that are only beneficial in some specific scenarios, we plan to add
them to default startup options through comments and explain their
usage. Please review~

1. Directly added options:

-Xss512k: This option is intended to optimize the memory occupied by
threads. The default value is 1m. Based on our research and actual
usage scenarios of iotdb, we suggest that the thread stack size of
512k is sufficient. Many online business systems also set up in this
way.

-XX:+UnlockDiagnosticVMOptions: Used to unlock some diagnostic JVM
options, such as -XX:GuaranteedSafepointInterval. This option itself
has no direct impact on performance.

-XX:+UseCountedLoopSafepoints: Prevent the delay in entering the safe
point caused by large bounded loops from causing the GC STW time to be
too long.

-XX:+SafepointTimeout -XX:SafepointTimeoutDelay=1000: These two
options will monitor the waiting time of the jvm threads in safepoint.
If it exceeds 1000ms, the state of the corresponding threads will be
printed to the log to help us troubleshoot the problem of too long
safepoint stw time.

-XX:GuaranteedSafepointInterval=0: Disable scheduled safepoint tasks.
In high concurrency scenarios of IoTDB, it is not necessary to enter
the safepoint regularly, but may cause additional overhead.

-XX:-UseBiasedLocking: Disable biased lock. In high concurrency
scenarios of IoTDB, biased locks are basically useless and have
negative effects with safepoints. In fact, biased locking has been
disabled by default since JDK15.

-XX:+UseAdaptiveSizePolicy: Turn on GC adaptive tuning(Ergonomics)

2. Added through comments:

-XX:+ParallelRefProcEnabled: Turn on parallel processing of Reference
objects in GC process. This option may help if particularly long
reference processing times are observed in the GC logs. Please note:
because this option consumes thread resources, it may have an impact
on application's throughput.

CPU_PROCESSOR_NUM=$(nproc) -XX:ParallelGCThreads=${CPU_PROCESSOR_NUM}:
Set the processing thread of parallel gc to the number of machine CPU
cores. Please note: When the GC time is too long, if there are
remaining CPU resources, you can try to increase this option. Although
this will occupy application thread resources, but because the GC
becomes faster, it will have minor impact on the application. If CPU
resources have reached a bottleneck, increasing this option may make
application slower even if it makes the GC faster.

-XX:+AlwaysPreTouch: Force the operating system to allocate all memory
in advance when the JVM starts, so that all heap areas are allocated
physical memory. It can reduce the overhead caused by memory
allocation, page fault interrupts, etc. during JVM operation. In some
large memory scenarios, we have observed about 10% improvement in
throughput with this option. Please note: The use of this option will
cause the JVM to start slower. At the same time, the physical memory
usage of iotdb will reach the maximum heap memory immediately after
JVM startup, which may reduce memory utilization and trigger OOM
killer when memory is tight.


Best regards,
—————————————
Junzhi Peng

Reply via email to