I am using elasticsearch 7.3 cluster which consists of
3 Master,
10 Data nodes
The cluster contains almost 100 active index and 10,000 aliases to write on the index.
Cluster load is almost 15-20k bulk ingestion per minute.
Now here is the problem:
-
I tried with below config:
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: full
xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/ssl/cert.p12
xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/ssl/cert.p12
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: /etc/elasticsearch/ssl/cert.p12
xpack.security.http.ssl.truststore.path: /etc/elasticsearch/ssl/cert.p12CPU uses was at peaks
-
Second config I tried is:
changed to
xpack.security.transport.ssl.verification_mode: certificateCPU was still at peaks
-
Third config I tried is:
changed to
xpack.security.transport.ssl.verification_mode: noneCPU was still at peaks
-
Fourth I tried with removing complete transport layer
that is with the below config onlyxpack.security.enabled: true
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: /etc/elasticsearch/ssl/cert.p12
xpack.security.http.ssl.truststore.path: /etc/elasticsearch/ssl/cert.p12Still, CPU was at peaks
-
I removed complete xpack security and CPU usage scaled down from 100% to less than 10-20%.
I checked hot threads during all those above configurations and all the time CPU consumption was by http_server_worker and transport_worker
Attaching screenshots of graphs for CPU uses Hot threads results as well.
It seems some bug is there with xpack Auth system which takes a lot of CPU.
Hot thread result-2: It's just part result see link for full result https://slack-files.com/T02FYRSTM-FRSDW5TCN-51434a66f4
Hot threads at 2019-12-15T13:52:24.340Z, interval=500ms, busiestThreads=99999, ignoreIdleThreads=true:
java.base@12.0.1/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
java.base@12.0.1/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:232)
app//org.elasticsearch.bootstrap.Bootstrap$1.run(Bootstrap.java:83)
java.base@12.0.1/java.lang.Thread.run(Thread.java:835)
0.0% (0s out of 500ms) cpu usage by thread 'Common-Cleaner'
10/10 snapshots sharing following 5 elements
java.base@12.0.1/java.lang.Object.wait(Native Method)
java.base@12.0.1/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
java.base@12.0.1/jdk.internal.ref.CleanerImpl.run(CleanerImpl.java:148)
java.base@12.0.1/java.lang.Thread.run(Thread.java:835)
java.base@12.0.1/jdk.internal.misc.InnocuousThread.run(InnocuousThread.java:134)
::: {datapoints_default_cs1-r52xl-data3}{KjC3JfvLS7WDN_u-VckRVw}{bbC4KJecRruQeyoHP6pu3Q}{172.31.32.90}{172.31.32.90:9300}{di}{rack_id=dpp, xpack.installed=true}
Hot threads at 2019-12-15T13:52:24.342Z, interval=500ms, busiestThreads=99999, ignoreIdleThreads=true:
88.3% (441.3ms out of 500ms) cpu usage by thread 'elasticsearch[datapoints_default_cs1-r52xl-data3][http_server_worker][T#7]'
9/10 snapshots sharing following 285 elements
CPU usage high is when using xpack security enabled any mode, and low is without xpack security.