how to get CPU usage of tomcat running in docker container [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
My application setup: 4 docker containers setup by docker-compose: myapplication (tomcat, jersey application), kafka, postgres, zookeeper.
I need to know the CPU usage of tomcat container.
1, I used JavaMeloday to get % System CPU 93.36, more details.
2, I used docker stats <docker id> to get that CPU % is 356% at the same time with % System CPU 93.36 by JavaMelody.
In my machine, there are 8 cores. why the numbers in 1 and 2 are different? How to explain them?
Thanks

As mentioned in moby/moby issue 26711:
800% is correct here, which is a standard notation for telling that 8 cores are 100% in use.
So 356% means the docker container processes (not just the java Tomcat) uses almost 4 of the 8 cores.
As opposed to Javamelody, used in "A Step-by-Step Guide to Tomcat Performance Monitoring", which monitors the Java application through JMX, and reports more: from "Java – monitoring cpu and system load of multi-threaded application via OperatingSystemMXBean", that value is an aggregate for all cores).
The issue is: docker stats and javamelody don't monitor the activity at exactly the same time, and could report (and aggregate) different activity peaks.

Related

Java not running on Windows server 2019 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm on this for a really long time. I need to have JRE 6 running on a new nonactivated Windows server 2019 essentials to be able to use a very old remote controller for some servers (old IBM & DELL racks).
No matter what version of java I install, it's just not running. I don't see it in the bottom right corner or in the running services. I know it seems very basic but I couldn't find a solution online.
Am I missing something? All I could find online is suggestions to add java to the environment variables but that is for a different issue. I tried it desperately but of course it didn't solve the problem.
Java, or more precisely the Java Virtual Machine (JVM), is not something that runs in the background. JVM is used to start specific applications. How the java.exe or similar executable will be resolved and invoked will depend on the specific application.
What you usually see in the Windows task tray area is a the Java update checker (Jucheck.exe). Whether or not this service is present will depend on selected installation options. It also might be that a very old Java 6 simply does not ship it.

Tomcat having extremely high cpu usage [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I have tomcat 8 and running a web application on tomcat. Recently I noticed my Vsphere client showing alarms for high cpu usage and found that the process responsible for is tomcat. When I restart the tomcat server it is running good, but after some time, the same problem arise. How to solve this issue?
/data/IMS/java/bin/java -Djava.util.logging.config.file=/data/IMS/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048
This is a broad topic, so I can only really provide you with some pointers on how to debug remote applications.
If you want to get some visibility into what your App is doing you can use a tool like Visual VM. Visual VM can profile cpu and memory usage, see details here. In order to do profiling you need to:
Enable JMX on Tomcat. Docs on how to do this for Tomcat 8 are here.
Run Visual VM and point it at your Tomcat server's JMX connection. Tutorial here.
Do some cpu usage profiling and look at memory usage to get a better idea about what is happening. Formulate some hypotheses and test them out. Repeat the process until you stumble upon a solution.
If I had to guess what was going wrong, I would say memory usage is gradually increasing over time, and garbage collection starts taking a long time.

How to allow Eclipse to use more CPU resources [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am working on Traveling Salesman Problem algorithm. When I execute the program it takes 3-4 hours to finish (not a big surprise for TSP). However, my Task manager tells that CPU is used only by 5% and ram by 27%. Is it possible to add more CPU resource for program execution, without modifying the code (I am not allowed to modify it)?
When you run the java program out of eclipse, it runs as an application on its own and not inside eclipse. There is no way to limit or allow more resources inside java. The only way to do it is:
From a Virtual Machine
When your code can utilise only a limited number of cores and you run it on a multi core machine, in this case modifying the code would be able to utilise more resources.
Since for you none of the above apply - no it's not possible for you.

Why I'm not using 100%? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'm executing a long running batch process in IBM WebSphere Application Server v8.5.5.1, which is getting data from a ECM repository, and afterwards converting it to PDF document. It runs about 20k of small documents, which compose the whole batch.
Right now I'm getting about 20 docs/sec, but the System is only about 45-55% cpu usage, so something is preventing me to get it to work at full throttle
I'm running in Windows 2012 R2 Standard on an HP Proliant DL385p Gen8 (32GB RAM, 2 x AMD Opteron 6272 each with 16 2.1GHz cores )
All resources are locally stored, so almost no network traffic should be bothering.
I've also tried to write the PDF output documents to a RAMDISK, but there's no improvement at all.
Any ideas of where should I peek to let this process use the whole power of my server?
Thanks!!
PS: Please see attached reference image
CPU Usage graph
I think the actual issue is that you're fully using one CPU but not the other.
The good news is that you can probably easily multithread your application to use both processors; just set up a task queue and play around with the number of worker threads you have until you achieve 100% usage.

Capture and Analyze Core Dump on Running App Server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
How can I capture a Core Dump and analyze the Java heap on an application running in Apache Tomcat?
A javacore can be provoked manually (assuming the JVM is configured to dump at user signal - generally it is).
On Windows: Press ControlBreak on the command window to generate the dumps.
On Linux: Press Control\ on the shell window.
On *nix or using Cygwin: kill -quit <pid>
All in all, launch Tomcat from a console, then depending on your platform perform one of the options above. This will generate a javacore which can be analyze with various tools e.g. Visual VM, etc.
VisualVM provide wide range of memory test on any application running with Java. I don't have much idea about tomcat memory analyzer but I'd prefer VisualVM
Download: https://visualvm.java.net/
VisualVM is a visual tool integrating several commandline JDK tools and lightweight profiling capabilities. Designed for both production and development time use, it further enhances the capability of monitoring and performance analysis for the Java SE platform
Screenshot of heap dump.

Categories

Resources