• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

How can manage and decrease high CPU usage due running wildfly

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using wildfly-11 on Redhat. According to follow figures due running it my CPU Usage is so heavy thus decrease our performance even crash it. How can solve this issue ? Is there any specific configuration on wildfly to handle it

https://pasteboard.co/JH1kXHW.jpg

https://pasteboard.co/JH1l9C5.jpg

BR
Babak
 
Marshal
Posts: 74341
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please post the figures rather than pastebin links; many people are reluctant to open such links.
 
Babak Simon
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch

Please post the figures rather than pastebin links; many people are reluctant to open such links.



Excuse Me. I have attached both files.
wild1.jpg
[Thumbnail for wild1.jpg]
wild2.jpg
[Thumbnail for wild2.jpg]
 
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These are the reasons that "web servers can have high CPU".

1. You're using an ancient and underpowered CPU. Like, say, a Pentium.

2. You don't have enough physical RAM and the memory-swapping subsystem is eating CPU.

3. You have one or more poorly-designed webapps that are eating up CPU.

The web server is almost never the primary consumer of CPU. They're designed to be relatively lightweight. It's almost always the apps hosted by the server that are the real pigs.
 
Babak Simon
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:These are the reasons that "web servers can have high CPU".

1. You're using an ancient and underpowered CPU. Like, say, a Pentium.

2. You don't have enough physical RAM and the memory-swapping subsystem is eating CPU.

3. You have one or more poorly-designed webapps that are eating up CPU.

The web server is almost never the primary consumer of CPU. They're designed to be relatively lightweight. It's almost always the apps hosted by the server that are the real pigs.



1- No. this is a virtual machine and I am using Platinum CPU 2.5GHZ  that is so huge
2- According to or monitor system memory usage on this system is more than 50%
Also as I was read in many sites mentioned we need do some configuration on wildfly . Is that correct ?

Now . How can solve this issue ?
 
Saloon Keeper
Posts: 7162
165
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can, turn off all webapps, and see what that does to CPU usage. (Without webapps, it should be close to zero.) Then turn them on one by one to see which one causes the CPU spike. If this is a production machine where that is not feasible, and Wildfly has no built-in facilities to monitor individual webapps, you may need to instrument the server to gather more data. https://sourceforge.net/projects/jamonapi/ is something that may be of help with that.
 
Tim Holloway
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Babak Simon wrote:Now . How can solve this issue ?



You can start by not blindly dismissing suggestions that do not please you. Then again, many of the world's problems would be reduced if people didn't simply reject things they didn't like and look for the "solutions" tht pleased them.

Virtual CPUs don't magically create extra processing power. Quite the reverse. They are, after all, just sliced out of the physical CPUs that underpin them. Many virtual machine managers in fact, contain tuning parameters that can throttle not only the number of virtual CPUs, but also their overall service level on the physical machine. That's true for VMs, containers, and many physical OS's as well. I believe that "slicing" is what Linux calls it and support for such things under that OS seems to be on the uptick recently.

I was listing ALL primary possible reasons, not just the most likely ones.

In actuality, I think you have enough CPU. I don't have quite enough data to be certain, but I don't think you're having a high swap rate. So that leaves the third possibility.

I would recommend running a performance monitor on the server to track down and identify the hungry threads.

And just to be clear, webapp servers come pre-set with parameters and self-tuning services that make them perform adequately under most requirements. Tuning is what you do when you've identified a specific unusual requirement.
 
Babak Simon
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:

Babak Simon wrote:Now . How can solve this issue ?



You can start by not blindly dismissing suggestions that do not please you. Then again, many of the world's problems would be reduced if people didn't simply reject things they didn't like and look for the "solutions" tht pleased them.

Virtual CPUs don't magically create extra processing power. Quite the reverse. They are, after all, just sliced out of the physical CPUs that underpin them. Many virtual machine managers in fact, contain tuning parameters that can throttle not only the number of virtual CPUs, but also their overall service level on the physical machine. That's true for VMs, containers, and many physical OS's as well. I believe that "slicing" is what Linux calls it and support for such things under that OS seems to be on the uptick recently.

I was listing ALL primary possible reasons, not just the most likely ones.

In actuality, I think you have enough CPU. I don't have quite enough data to be certain, but I don't think you're having a high swap rate. So that leaves the third possibility.

I would recommend running a performance monitor on the server to track down and identify the hungry threads.

And just to be clear, webapp servers come pre-set with parameters and self-tuning services that make them perform adequately under most requirements. Tuning is what you do when you've identified a specific unusual requirement.



As I reas in many forums mentioned can find the solution via threaddump . Is that correct ? If yes Would you say please how can get it and upload here to find the reason

 
Babak Simon
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:If you can, turn off all webapps, and see what that does to CPU usage. (Without webapps, it should be close to zero.) Then turn them on one by one to see which one causes the CPU spike. If this is a production machine where that is not feasible, and Wildfly has no built-in facilities to monitor individual webapps, you may need to instrument the server to gather more data. https://sourceforge.net/projects/jamonapi/ is something that may be of help with that.



Exactly. when I kill PID 7822 cou usage decrease and is about 10% . is that possible to find and solve issue viia threaddump or heapdump ?
 
Tim Holloway
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Babak Simon wrote:
Exactly. when I kill PID 7822 cou usage decrease and is about 10% . is that possible to find and solve issue viia threaddump or heapdump ?



What I would generally do when using the Eclipse IDE would be to identify the high-usage thread, pause it and look at the stack trace. For best results this might need to be done more than once, since Murphy's Law states that if a thread spends 90% of its time running at 90% CPU and 10% of the time at 10% CPU, chances are high that when you pause it it will be running the 10% part.

There are other IDEs and other tools, of course. And a profiler can be used to see what percent of the overall time was spend in which method. Which is basically doing what I mentioned automatically at high speeds so as to confound Mr. Murphy.
 
Babak Simon
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:

Babak Simon wrote:
Exactly. when I kill PID 7822 cou usage decrease and is about 10% . is that possible to find and solve issue viia threaddump or heapdump ?



What I would generally do when using the Eclipse IDE would be to identify the high-usage thread, pause it and look at the stack trace. For best results this might need to be done more than once, since Murphy's Law states that if a thread spends 90% of its time running at 90% CPU and 10% of the time at 10% CPU, chances are high that when you pause it it will be running the 10% part.

There are other IDEs and other tools, of course. And a profiler can be used to see what percent of the overall time was spend in which method. Which is basically doing what I mentioned automatically at high speeds so as to confound Mr. Murphy.



Now. As I am a system admin not a developer how can find the problem ? what is the solution ?
 
Tim Holloway
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a system administrator, the usual procedure would be to contact the developer. In MY Universe, at least, sysadmin's aren't supposed to be liable for other people's screw-ups.

Naturally some diplomacy and resolution through corporate channels would be preferable. Despite the undeniable pleasure at the thought of grabbing said developer(s) bt the throat and shaking them.

A program isn't production ready just because it "runs". A program is only production ready when it runs in production.

Ideally there's a test server somewhere where the developers can do the necessary profiling and stuff without messing with production resources.
 
Greenhorn
Posts: 13
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Babak Simon wrote:
Now. As I am a system admin not a developer how can find the problem ? what is the solution ?



You should look at the Performance Tuning Guide. The EAP 7.1 product is based on the project Wildfly 11. The configuration settings are identical to Wildfly 11.
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/performance_tuning_guide/undertow_tuning#undertow_listeners

Your starting point is most likely to throttle incoming connections. See section 9.3. You will want to limit the max-connections on the HTTP/HTTPS listener.

As Tim mentioned. You should really pass responsibility for this issue to the development team.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic