From 9151b7cc5ecea050256a419307b6886a02576610 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 12 Jan 2017 12:15:06 -0500 Subject: [PATCH 1/2] Clamp number of file ingest therads to 4 --- .../corecomponents/AutopsyOptionsPanel.java | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java index de9a6e5429..eaafafb754 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java @@ -34,37 +34,25 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel { AutopsyOptionsPanel() { initComponents(); + + /* + * Profiling has shown that contention for I/O resources and for the + * case database limits the number of threads that can do meaningful + * work during ingest. If Autopsy was compute-bound, adding more threads + * on machines with enough processors might help, but currently, after + * four threads, performance actually stays flat and then starts to + * degrade. + */ int availableProcessors = Runtime.getRuntime().availableProcessors(); Integer fileIngestThreadCountChoices[]; int recommendedFileIngestThreadCount; - if (availableProcessors >= 16) { - fileIngestThreadCountChoices = new Integer[]{1, 2, 4, 6, 8, 12, 16}; - if (availableProcessors >= 18) { - recommendedFileIngestThreadCount = 16; - } else { - recommendedFileIngestThreadCount = 12; - } - } else if (availableProcessors >= 12 && availableProcessors <= 15) { - fileIngestThreadCountChoices = new Integer[]{1, 2, 4, 6, 8, 12}; - if (availableProcessors >= 14) { - recommendedFileIngestThreadCount = 12; - } else { - recommendedFileIngestThreadCount = 8; - } - } else if (availableProcessors >= 8 && availableProcessors <= 11) { - fileIngestThreadCountChoices = new Integer[]{1, 2, 4, 6, 8}; - if (availableProcessors >= 10) { - recommendedFileIngestThreadCount = 8; - } else { - recommendedFileIngestThreadCount = 6; - } - } else if (availableProcessors >= 6 && availableProcessors <= 7) { - fileIngestThreadCountChoices = new Integer[]{1, 2, 4, 6}; + if (availableProcessors >= 6) { + fileIngestThreadCountChoices = new Integer[]{1, 2, 4}; recommendedFileIngestThreadCount = 4; - } else if (availableProcessors >= 4 && availableProcessors <= 5) { + } else if (availableProcessors >= 4 && availableProcessors < 6) { fileIngestThreadCountChoices = new Integer[]{1, 2, 4}; recommendedFileIngestThreadCount = 2; - } else if (availableProcessors >= 2 && availableProcessors <= 3) { + } else if (availableProcessors >= 2 && availableProcessors < 4) { fileIngestThreadCountChoices = new Integer[]{1, 2}; recommendedFileIngestThreadCount = 1; } else { @@ -72,7 +60,9 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel { recommendedFileIngestThreadCount = 1; } numberOfFileIngestThreadsComboBox.setModel(new DefaultComboBoxModel<>(fileIngestThreadCountChoices)); + restartRequiredLabel.setText(NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.restartRequiredLabel.text", recommendedFileIngestThreadCount)); + // TODO listen to changes in form fields and call controller.changed() DocumentListener docListener = new DocumentListener() { @@ -92,7 +82,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel { } }; this.jFormattedTextFieldProcTimeOutHrs.getDocument().addDocumentListener(docListener); - + } void load() { @@ -138,7 +128,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel { UserPreferences.setProcessTimeOutHrs((int) timeOutHrs); } } - + boolean valid() { return true; } From 500b0188a9c14f4255e08ef888d5a5dfeaa612d2 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 12 Jan 2017 15:55:27 -0500 Subject: [PATCH 2/2] Tidy up AutopsyOptionsPanel --- .../sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java index eaafafb754..95d9419f7c 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyOptionsPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013-2014 Basis Technology Corp. + * Copyright 2011-2017 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,6 +32,8 @@ import org.sleuthkit.autopsy.core.UserPreferences; */ final class AutopsyOptionsPanel extends javax.swing.JPanel { + private static final long serialVersionUID = 1L; + AutopsyOptionsPanel() { initComponents();