Skip to content
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

Add a threadpool to Qualification tool to process logs in parallel #2841

Merged
merged 7 commits into from
Jun 29, 2021

Conversation

tgravescs
Copy link
Collaborator

Add a threadpool and parameters to configure timeout and number of threads (defaults to cores on host/4).
Updated some log messages so it shows path or something useful since now the log messages don't come out in sequential order.

Fixed a bug with printing out the text file when there aren't any apps in QualOutputWriter.

Times to process 105 log files went from about 6.5 minutes to 45 seconds, interestingly enough, processing 210 log files only takes a bit longer at like 50 seconds, it looks like a few of the log files are skewed and take much longer than others.

@tgravescs tgravescs added this to the June 21 - July 2 milestone Jun 29, 2021
@tgravescs tgravescs self-assigned this Jun 29, 2021
@tgravescs
Copy link
Collaborator Author

build

@tgravescs tgravescs merged commit 4fc17cb into NVIDIA:branch-21.08 Jun 29, 2021
@tgravescs tgravescs deleted the threadpoolUpmerge branch June 29, 2021 18:08
Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice speedup

.setDaemon(true).setNameFormat("qualTool" + "-%d").build()
logInfo(s"Threadpool size is $nThreads")
private val threadPool = Executors.newFixedThreadPool(nThreads, threadFactory)
.asInstanceOf[ThreadPoolExecutor]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: redundant cast?

Comment on lines +61 to +66
threadPool.shutdown()
if (!threadPool.awaitTermination(waitTimeInSec, TimeUnit.SECONDS)) {
logError(s"Processing log files took longer then $waitTimeInSec seconds," +
" stopping processing any more event logs")
threadPool.shutdownNow()
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may get an InterruptedException in awaitTermination, may want to surround it with try/finally and place shutdownNow into finally.

None
case e: Exception =>
// catch all exceptions and skip that file
logWarning(s"Got unexpected exception processing file: $path", e)
logWarning(s"Got unexpected exception processing file: ${path.eventLog.toString}", e)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: toString is redundant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants