Multi-Tenant Deployment to same host

We are using Octopus to push out a Nuget package to a host, within this Nuget package is a bunch of TSQL scripts and a PowerShell script that handles running them (there is some more to, but it isn’t really relevant right now).

The issue I am seeing is that I can not deploy to more than one client on the same host at the same time (in parallel). Our process installs the package to a custom directory “C:\Octopus\Clients#{Client}” and then runs the PS1 script in C:\Octopus\Clients#{Client}\Tools\

If I deploy a second client on the same host it get queued up and I see the message “Cannot start this task yet. There is already another task running that cannot be run in conjunction with any other task. Please wait…” in the log.

Is there a way to get multiple client deployments to the same host to run in parallel?

Just to remove confusion I have a variable set that is:

#{Client} = #{Octopus.Deployment.Tenant.Name}

Hi Chris,

Thanks for getting in touch! We haven’t been able to reproduce this issue with the latest Octopus 3.4 build we’re using internally and it should be working on Octopus 3.4 beta 2. Can you tell me which pre-release version you’re using?

Looking forward to your reply!

Rob

Hi Rob,

We are using Beta0002. I just realized the same behavior is occurring with our UI deployment so I am going to use that as an example because it is a much simpler process.

Our UI deployment is:

  • Step 1: Deploy Package
    -Install to custom directory (C:\Clients#{Client}\APP_UI_#{ENV})
    -Replace appSettings and connectionStrings
  • Step 2: Run a script
$LogDir = "C:\Clients\#{Client}\APP_UI_#{ENV}\Logs"
if (!(Test-Path $LogDir)){
    Write-output "Creating $LogDir"
    New-Item $LogDir -ItemType Directory -force | out-null     
}

#{ENV} is based on the environments ; #{Client} is the tenants name

It maybe by design, but what happens if I deploy a nuget package to more than one tenant on the same host, the first tenant runs step 1. The next tenant deployment on the same IIS host sits and waits until the first tenant finishes. In our case we have ~ 20 tenants on one IIS host, so they all queue up to run in series so instead of groups of clients deploying in 30 seconds it takes 10 minutes for all of our clients to deploy the UI.

Now 10 minutes isn’t really a big deal… the big deal is step 1 from our DB deploy, which I originally referenced takes about an hour. With 7 - 8 clients on a SQL server, a full release deployment to all of our clients is an 8+ hour process.

Here is a screen cap of what I see on the second tenant until the first tenant completes deployment:

Hi Chris,

Thanks for following-up and providing the additional details. That really helps! :slight_smile: I confirmed with one of my other team members that he tested this on the latest build of Octopus 3.4 and he also had to set the Bypass Deployment Mutex to true as per the following documentation page. http://docs.octopusdeploy.com/display/OD/Run+multiple+processes+on+a+Tentacle+Simultaneously

He mentioned large deployments were far faster after doing this.

Let me know if you have any other thoughts on this.

Thanks

Rob

This is perfect. Thanks!

Notice:

This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.