#1 2020-05-08 12:25:29

krugms
Member
Registered: 2020-05-08

WildFly - CPU Utilization

Hello.  We have a strange occurrence with ReportServer (Community Edition RS3.0.7-6008) running under WildFly 14 on Windows Server, connected to Microsoft SQL Server (SQL 2012 and 2016, depending on the environment we're working in).  We have been able to successfully deploy under WF14, using the recommended WildFly installation instructions.  The server runs fine, all is good generally speaking.  We can generate reports, performance is fine, etc.  However, whenever ReportServer is first launched (either from a server reboot, or a web server restart), the application will consume about 12-14% CPU (it actually appears to be total consumption of a single CPU core, so hardware dictates the percentage, which means it could be even higher).  This CPU utilization remains steady, even when ReportServer has no activity and is completely idle, until either 1) someone hits the ReportServer login page via a browser (actual login isn't needed, just the login page needs to load); or 2) A report is generated via URI call request. 

At that point, CPU usage goes back to zero or near zero when idle, and all is good with the world.

As mentioned, we have no issues with the functionality of ReportServer running under WildFly, except for this CPU thing.  There are some cases where we've deployed more than one instance of Community Edition on a single Windows server (to support various testing environments), and after a server reboot with multiple instances of ReportServer running, total CPU utilization can become very high.  If there are three instances of ReportServer, for example, then the CPU usage when idle is tripled. 

For now, we have a script workaround to launch IE and hit the ReportServer login page automatically, but this is cumbersome to manage and certainly isn't a fix.

For additional information, we did hook into our ReportServer instances with Java Mission Control to see if we could get a bead on which thread or threads were causing CPU usage, and discovered that it's always a call to the JpaEventLoggerStartup$1.class.  It seems to get stuck in the while/try/catch loop in that class, until some kind of human action (hit login page or generate a report) causes the loop to exit and get to the Return.

Thoughts on what this could be?  Is there anything we can do within the WildFly config to avoid this infinite loop issue?  Any insight or feedback is appreciated.

Last edited by krugms (2020-05-08 12:33:58)

Offline

#2 2020-05-08 13:28:23

eduardo
Administrator
Registered: 2016-11-01
Website

Re: WildFly - CPU Utilization

Hi krugms,

thanks for this thorough analysis. The code that is probably causing this is in the JpaEventLoggerStartup$1.class can be seen here:

Thread sStarter = new Thread(new Runnable() {
			
			@Override
			public void run() {
				while(true){
					try{
						injector.getInstance(EntityManager.class);
						break;
					} catch(Exception e){
						
					}
				}
				eventLoggerService.start();
			}
		});

which explains the behavior you observe (infinite loop until something happens).

We will check if there is a better way of achieving this in ticket RS-4112.  If you have any more ideas of course you can always post them here.

Regards,
Eduardo

Offline

#3 2020-05-08 14:05:00

krugms
Member
Registered: 2020-05-08

Re: WildFly - CPU Utilization

Thanks Eduardo.  Is there any way I can track the status of RS-4112?

Also - is there any additional information that you can provide as to what exactly this code is trying to do?  On the surface, it seems database connection related, but I can't be sure.  Depending on what it's actually trying to do, I may be able to make some changes in WildFly (maybe) that will assist.

Thank you!

Offline

Board footer

Powered by FluxBB