abh1sar commented on code in PR #12847:
URL: https://github.com/apache/cloudstack/pull/12847#discussion_r4218540355


##########
plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java:
##########
@@ -64,6 +65,37 @@
 public class NASBackupProvider extends AdapterBase implements BackupProvider, 
Configurable {
     private static final Logger LOG = 
LogManager.getLogger(NASBackupProvider.class);
 
+    public static final ConfigKey<Boolean> NASBackupParallelExecution = new 
ConfigKey<>("Advanced", Boolean.class,
+            "backup.nas.parallel.execution.enabled",
+            "true",
+            "Let NAS take-backup commands run concurrently on a KVM host 
instead of queueing behind every earlier command on that host "
+            + "and holding up every later one. Concurrency is bounded per host 
by backup.nas.parallel.max.per.host. "
+            + "Disable to restore strictly sequential execution.",
+            true, ConfigKey.Scope.Zone);
+
+    public static final ConfigKey<Integer> NASBackupParallelMaxPerHost = new 
ConfigKey<>("Advanced", Integer.class,
+            "backup.nas.parallel.max.per.host",
+            "2",
+            "Maximum number of NAS take-backup commands each management server 
keeps in flight on one KVM host when parallel "
+            + "execution is enabled; further backups for that host wait on 
that management server. The count is kept per management "
+            + "server, so with several management servers a host can see up to 
this value times the number of management servers. "
+            + "Keep that product below the agent's worker thread count 
(workers in agent.properties, default 5) so start, stop, "
+            + "reboot and migrate commands are never queued behind backups.",
+            true, ConfigKey.Scope.Zone);
+
+    public static final ConfigKey<Integer> NASBackupParallelQueueTimeout = new 
ConfigKey<>("Advanced", Integer.class,
+            "backup.nas.parallel.queue.timeout",
+            "7200",
+            "Seconds a NAS take-backup may wait for a free per-host slot 
before it fails.",
+            true, ConfigKey.Scope.Zone);
+
+    /** In-flight take-backup commands per host, so backups never occupy every 
agent worker thread. */
+    private final ConcurrentHashMap<Long, HostBackupSlots> hostBackupSlots = 
new ConcurrentHashMap<>();

Review Comment:
   What if the request is coming from multiple management servers and each is 
maintaining a copy of the hostBackupSlots? Will it cause over allocation?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to