[
https://issues.apache.org/jira/browse/SOLR-16605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17653690#comment-17653690
]
Shawn Heisey commented on SOLR-16605:
-------------------------------------
Test program:
{code:java}
package org.elyograg.misc;
import java.lang.management.ManagementFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.sun.management.OperatingSystemMXBean;
@SpringBootApplication
public class OsbeantestApplication {
public static void main(String[] args) {
// SpringApplication.run(OsbeantestApplication.class, args);
// OperatingSystemMXBean osb2;
OperatingSystemMXBean osb1 = (OperatingSystemMXBean)
ManagementFactory.getOperatingSystemMXBean();
Thread t = new CpuStressThread();
t.setDaemon(true);
t.start();
while (true) {
System.out.println("process: " +
osb1.getProcessCpuLoad() * 100);
System.out.println("system: " + osb1.getSystemCpuLoad()
* 100);
try {
Thread.sleep(3000);
} catch (Throwable e) {
e.printStackTrace();
}
}
}
public static final class CpuStressThread extends Thread {
private double load = 0.8;
private long duration = 100000;
public CpuStressThread() {
}
/**
* Generates the load when run
*/
@Override
public void run() {
long startTime = System.currentTimeMillis();
try {
// Loop for the given duration
while (System.currentTimeMillis() - startTime <
duration) {
// Every 100ms, sleep for the
percentage of unladen time
if (System.currentTimeMillis() % 100 ==
0) {
Thread.sleep((long)
Math.floor((1 - load) * 100));
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
{code}
> CPU in UI cloud->nodes is always 0%, even when Solr is very busy.
> -----------------------------------------------------------------
>
> Key: SOLR-16605
> URL: https://issues.apache.org/jira/browse/SOLR-16605
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Components: Admin UI
> Affects Versions: 9.1
> Reporter: Shawn Heisey
> Assignee: Shawn Heisey
> Priority: Major
> Attachments: fixcpuadminui-1.patch
>
>
> The Cloud->Nodes section of the admin UI is always reporting 0% CPU even on
> very busy Solr nodes. I thought the attached patch would fix t, but it
> doesn't seem to be working. Instead of always 0%, it now shows an occasional
> 50% or 100%... and even rarer is a different percentage like 84% or 17%. The
> Solr process at that time was usng about 180% CPU (two CPUs in AWS instance).
> Using OperatingSystemMXBean from com.sun instead of java.lang seemed to work
> fine in a quick test program, but it's not working in Solr. I am trying this
> on Ubuntu Linux with OpenJDK 17 and 11.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]