My elasticsearch active master node CPU usage rises to 100% at times and remains the same for few minutes/hours and then comes downs to normal 4-5%.
I ran the "hot_threads" API against the node and found below threads taking all the CPU time.
Hot threads at 2023-03-16T04:45:50.211Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
100.1% (500.3ms out of 500ms) cpu usage by thread 'elasticsearch[node-name-xxx][management][T#1]'
10/10 snapshots sharing following 23 elements
java.base@17/com.sun.crypto.provider.PBKDF2KeyImpl.<init>(PBKDF2KeyImpl.java:119)
java.base@17/com.sun.crypto.provider.PBKDF2Core.engineGenerateSecret(PBKDF2Core.java:70)
java.base@17/javax.crypto.SecretKeyFactory.generateSecret(SecretKeyFactory.java:340)
org.elasticsearch.license.CryptUtils.deriveSecretKey(CryptUtils.java:188)
org.elasticsearch.license.CryptUtils.decrypt(CryptUtils.java:136)
org.elasticsearch.license.CryptUtils.decrypt(CryptUtils.java:116)
org.elasticsearch.license.SelfGeneratedLicense.verify(SelfGeneratedLicense.java:73)
org.elasticsearch.license.LicenseService.getLicense(LicenseService.java:558)
org.elasticsearch.license.LicenseService.getLicense(LicenseService.java:548)
org.elasticsearch.license.LicenseService.getLicense(LicenseService.java:347)
org.elasticsearch.license.TransportGetLicenseAction.masterOperation(TransportGetLicenseAction.java:44)
org.elasticsearch.license.TransportGetLicenseAction.masterOperation(TransportGetLicenseAction.java:23)
app//org.elasticsearch.action.support.master.TransportMasterNodeAction.masterOperation(TransportMasterNodeAction.java:90)
app//org.elasticsearch.action.support.master.TransportMasterNodeAction.executeMasterOperation(TransportMasterNodeAction.java:99)
app//org.elasticsearch.action.support.master.TransportMasterNodeAction.access$400(TransportMasterNodeAction.java:48)
app//org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction.lambda$doStart$3(TransportMasterNodeAction.java:170)
app//org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$$Lambda$5947/0x00000008019586c8.accept(Unknown Source)
app//org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62)
app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:737)
app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
java.base@17/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
java.base@17/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
java.base@17/java.lang.Thread.run(Thread.java:833)
version details =
"version" : {
"number" : "7.15.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "83c34f456ae29d60e94d886e455e6a3409bba9ed",
"build_date" : "2021-10-07T21:56:19.031608185Z",
"build_snapshot" : false,
"lucene_version" : "8.9.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
Please suggest what can be done to fix this and/or find the underlying cause.