Minimize memory consumption: Managing excessive Jenkins logs
Edit on GitHubThe excessive accumulation of logs in a Jenkins instance, particularly the substantial volume of stdout
and stderr
logs generated by numerous job executions, can lead to performance degradation. Without proper log management strategies, these logs can quickly accumulate, overwhelming the Jenkins server’s memory and disk space. This can lead to performance degradation, causing Jenkins to become slow and unresponsive, especially during peak usage periods.
To address this problem, take the following steps:
- Determine the source of log generation:
- Examine Jenkins logs to identify jobs and builds with significant log generation.
- Analyze build scripts to identify and eliminate unnecessary log generation.
- Mute Jenkins from receiving logs if needed:
- To disable child process logging, override
\Spryker\Zed\Queue\Business\Process\ProcessManager::triggerQueueProcess()
on the project level:
- To disable child process logging, override
...
if (!$this->queueConfig->getQueueWorkerLogStatus()) {
$process->disableOutput();
}
...
- To add forwarding for
stderr
, override\Spryker\Zed\Queue\Business\Worker\Worker::executeOperation()
on the project level:
if ($this->queueConfig->getQueueWorkerLogStatus()) {
$processCommand = sprintf('%s >> %s 2>&1', $processCommand, $this->queueConfig->getQueueWorkerOutputFileName());
}
Thank you!
For submitting the form