-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eating 100% CPU when setting com.sun.enterprise.server.logging.GFFileHandler.logtoFile=false #3506
Comments
I confirm I can see the CPU spike when running the maven build. There's no CPU spike when starting a plain Payara Server 5.183 in docker without any deployments. |
The property
Besides the IMHO the property should go. If you don't want the logging to write to a file don't configure a file handler. |
There is a property There might be reasons that somebody wants the logs both piped to STDOUT/STDERR plus logfile, so maybe the property should stay, but the Thread should not be started in the first place if it is set to |
…start pump thread if logging to file. Store into queue only if logging to file.
@poikilotherm There is a mechanism to log to several different Handlers in parallel in JUL. |
* #3506 prevent processor wastage when not logging to file. Only start pump thread if logging to file. Store into queue only if logging to file. * add logToFile to the pumps loop condition to stop looping if logToFile is set to false. * draining pendingRecords if the pump gets disabled. reusing the draining code for the log method. * initialize collection to drain to with the correct size * Adding call to flush() after draining pending records.
Description
Summary: I see a 100% CPU load on one CPU core when starting my application, due to a "RUNNABLE" thread.
When using https://github.com/payara/docker-payaraserver-full Docker image (using Payara 5.183 and OpenJDK 1.8.0u171), the logging to file disabled via setting:
(See Dockerfile).
The application logs to console, which is just fine, but it is burning a CPU core infinitely.
I don't know if #2117 is related. Seems to be the only other issue I could find.
Expected Outcome
The server should not be using a complete CPU core for logging...?
Current Outcome
Top from container, see PID 100:
Related thread dump, with
nid=0x64
== PID 100:Steps to reproduce (Only for bug reports)
While the below stays to be a valid option for reproducing, @pioneer2k stated in payara/docker-payaraserver-full#72 this is even a problem when just starting the domain without even a deployment.
You should be able to reproduce by using my feature branch.
Docker, Maven and Git is assumed as installed:
Then enter the container via:
And watch it burn the CPU.
Environment
The text was updated successfully, but these errors were encountered: