You are viewing limited content. For full access, please sign in.

Question

Question

Forms-Initial Login Slow

asked on December 3, 2021

Hello,

We have a customer who is noticing some delays with the initial launch of Forms, compared to so subsequent logins from the same browser (Possible Cache).

The one thing I noticed when I had then run a HAR trace between the two logins, and provide me the traces, there is an entry on the HAR trace for the slow initial connection, called MobileTask, which takes almost 5 seconds to process:

I do not see this entry on the 2nd attempt to connect.

Does anyone know what this call is for? 

They are not using the Mobile App to connect to Forms.

Overall- 1st connection is taking roughly 15-20 seconds to connect and subsequent connections are taking 4-6 seconds.

We have not run a WireShark at this time.

Appreciate any insight anyone might have.

Jeff Curtis

0 1

Replies

replied on December 5, 2021

Can you check what's value of "User-Agent" from the request header? The MobileTasks link will be called when the browser's user agent is a mobile one and the Inbox tasks lists will be different as the desktop one. 

It's better to open a support case and provide video to illustrate the issue as well as the HAR trace files. 

1 0
replied on December 6, 2021

Hi Jeff, in addition to what Xiuhong Xiang asked about, they might also be running to an IIS "cold start" where the app pool only starts up once it receives a request and terminates after 20 minutes of no activity. 

I have a PowerShell script that changes IIS settings so that Laserfiche app pools start up when the IIS server starts and stay running instead of shutting down after an idle timeout. Worth giving a spin. I run this on every web server on every deployment I do. Note that it requires a server restart to take full effect.

#From: http://www.herlitz.nu/2017/11/07/enable-IIS-preloadEnabled-and-AlwaysRunning-using-PowerShell/
### Enable if required
#Import-Module ServerManager
#Add-WindowsFeature Web-Scripting-Tools

Write-Host "*** Start IIS Settings Optimization Script ***"
Import-Module WebAdministration

#Set the site name
$siteName = "Default Web Site"

#Fetch the site
$site = Get-Website -Name $siteName
if (!$site)
{
    Write-Host "Site $siteName could not be found, exiting!" -ForegroundColor Yellow
    Break
}

#Fetch the application pools
$appPools = Get-ChildItem "IIS:\AppPools\"

#Fetch the site collection (web apps under the site)
$appCollection = Get-ChildItem "IIS:\Sites\$siteName" | Where-Object {$_.NodeType -eq 'application'}

#Declare apps to preload
$appsToPreload = New-Object System.Collections.ArrayList(,('AuditTrail','FederatedSearch','Forms','Laserfiche','LFCMIS','LDPS','LFDS','LFDSSTS','Mobile','WebLink','Workflow'))
$appsToPreloadUndetected = $appsToPreload.Clone()


#Useful resource on working with IIS recycle times in PowerShell: 
#https://www.habaneroconsulting.com/stories/insights/2013/set-the-specific-times-to-recycle-an-application-pool-with-powershell

#Set to desired daily recycle time
$recycleTimes = @("04:00")

Write-Host "***************************************************"
Write-Host "* Update all IIS AppPools to:                     *"
Write-Host "* -Disable idle timeouts                          *"
Write-Host "* -Schedule consistent app pool recycling time(s) *"
Write-Host "* -Set Start Mode to AlwaysRunning                *"
Write-Host "***************************************************"
Write-Host "`n" 

foreach ($appPool in $appPools) {
    if ($appPool.processModel.idletimeout -ne '0')
    {
        $appPool | Set-ItemProperty  -Name processModel -value @{idletimeout='0'}
        Write-Host "$($appPool.Name) idle timeout disabled" -ForegroundColor Green
    }`
    else 
    {
        Write-Host "$($appPool.Name) already has idle timeout disabled" -ForegroundColor Yellow
    }
    
    #Clear existing recycle schedule and add specified schedule
    #Easier than trying to check all the collection values and ensures setting is correct at the end
    $appPool | Clear-ItemProperty -Name Recycling.periodicRestart.schedule
    foreach ($recycleTime in $recycleTimes) {
        $appPool | Set-ItemProperty -Name Recycling.periodicRestart.schedule -Value @{value=$recycleTime}
        Write-Host "$($appPool.Name) added recycle time at $recycleTime" -ForegroundColor Green
    }

    if ($appPool.Recycling.periodicRestart.time -ne '00:00:00') 
    {
        $appPool | Set-ItemProperty -Name Recycling.periodicRestart -Value @{time='00:00:00'}
        Write-Host "$($appPool.Name) revolving recycling disabled" -ForegroundColor Green
    }`
    else {
        Write-Host "$($appPool.Name) already has revolving recycling disabled" -ForegroundColor Yellow
    }

    if ($appPool.startMode -ne "AlwaysRunning")
    {
        Write-Host "$($appPool.Name) startMode is set to $($appPool.startMode), activating AlwaysRunning"
        
        $appPool | Set-ItemProperty -Name "startMode" -Value "AlwaysRunning"

        Write-Host "$($appPool.Name) startMode is now set to $($appPool.startMode)" -ForegroundColor Green
    } `
    else 
    {
        Write-Host "$($appPool.Name) startMode was already set to $($appPool.startMode) " -ForegroundColor Yellow
    }
    Write-Host "`n"
}
Write-Host "`n"


#Ensure Application Initialization is available
$webAppInit = Get-WindowsFeature -Name "Web-AppInit"

if (!$webAppInit.Installed) #
{
    Write-Host "$($webAppInit.DisplayName) not present, installing"
    Install-WindowsFeature $webAppInit -ErrorAction Stop
    Write-Host "`nInstalled $($webAppInit.DisplayName)`n" -ForegroundColor Green
} `
else 
{
    Write-Host "$($webAppInit.DisplayName) was already installed" -ForegroundColor Yellow
}

Write-Host "**************************************************"
Write-Host "* Activate preloadEnabled on Laserfiche web apps *"
Write-Host "* and the IIS Site instance                      *"
Write-Host "**************************************************"
Write-Host "`n"

#Enable preloadEnabled on the IIS Site instance
if (!(Get-ItemProperty "IIS:\Sites\$siteName" -Name applicationDefaults.preloadEnabled).Value) 
{
    Write-Host "$siteName preloadEnabled is inactive, activating"
    
    Set-ItemProperty "IIS:\Sites\$siteName" -Name applicationDefaults.preloadEnabled -Value True
    
    Write-Host "$siteName preloadEnabled is now set to $((Get-ItemProperty "IIS:\Sites\$siteName" -Name applicationDefaults.preloadEnabled).Value)" -ForegroundColor Green
} `
else
{
    Write-Host "$siteName preloadEnabled already active" -ForegroundColor Yellow
}

#Enable preloadEnabled on Laserfiche web apps
foreach ($app in $appCollection) {
    $appName = $app.Name  
    if (!($app.preloadEnabled)) 
    {
        $preloadFlag = $false
        foreach ($appToPreload in $appsToPreload) {
            if ($app.Name -eq $appToPreload) {

                Write-Host "$appName is in preload list and preloadEnabled is inactive, activating"

                Set-ItemProperty "IIS:\Sites\$siteName\$appName" -Name preloadEnabled -Value $true

                Write-Host "  preloadEnabled is now set to $((Get-ItemProperty "IIS:\Sites\$siteName\$appName" -Name preloadEnabled).Value)" -ForegroundColor Green

                $appsToPreloadUndetected.Remove($appName)

                $preloadFlag = $true
            }
        }
        if ($preloadFlag -eq $false) {
            Write-Host "$appName is not on preload list"
        }
    } `
    else
    {
        $appsToPreloadUndetected.Remove($appName)
        Write-Host "$appName has preloadEnabled already active" -ForegroundColor Yellow
    } 
}

if ($appsToPreloadUndetected.count -gt 0) {
    $appsToPreloadUndetected = $appsToPreloadUndetected -join "`n"
    Write-Host "The following apps on the preload list were not detected in IIS:`n$appsToPreloadUndetected"
}
Write-Host "`n"
Write-Host "***********************************************" -ForegroundColor Green
Write-Host "* IIS Optimization Script Complete            *" -ForegroundColor Green
Write-Host "* Please restart for settings to take effect! *" -ForegroundColor Green
Write-Host "***********************************************" -ForegroundColor Green

 

1 0
replied on December 7, 2021

Hey Sam,

Thanks for this.

Should we backup the Forms DB before running this?

Appreciate your time,

Jeff  Curtis

0 0
replied on December 7, 2021

Welcome =)

The script doesn't touch any application databases, only IIS settings on the local machine. A VM snapshot would be an appropriate backup, though it's also trivial to change the affected settings back in the IIS Management Console.

0 0
replied on December 7, 2021

Thanks Sam

Passed this along to the Customer.

I will see how it's goes.

Jeff

0 0
replied on December 10, 2021

Hey Sam,

Even after running your PS Script, customer is still seeing slow initial load times. 

Should we go the route that Xiuhong Xiang suggest and open a case with Support?

Thanks,

Jeff Curtis

0 0
replied on December 10, 2021

Yes, please open a support case.

0 0
replied on December 10, 2021

Will do..thanks

Jeff Curtis

0 0
replied on April 27, 2022

Hey  Jeff, Did you ever get this one sorted out? Inquiring minds want to know :)

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.