Installing QPR ProcessAnalyzer Server

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search

Introduction

This page describes how to install QPR ProcessAnalyzer Server. Installation steps are:

  1. See the System Requirements, and acquire a compatible Windows server and SQL Server.
  2. Setup an SQL Server database.
  3. Install and configure Roles and Features for IIS.
  4. Install QPR ProcessAnalyzer using Web Deploy or manually.
  5. Activate QPR ProcessAnalyzer server license. The activation occurs online automatically during the server startup if there an internet access. If not, the activation needs to be done manually using the Activation Utility).
  6. Configure IIS and .Net for QPR ProcessAnalyzer.
  7. Go through and set settings in QPR ProcessAnalyzer Server web.config file and change them if needed.
  8. Go through the environment settings stored to the PA_Configuration table and set them if needed.
  9. Setup the Scripting Sandbox.
  10. Setup https and signed certificate to IIS.
  11. If using Snowflake processing, install the Snowflake ODBC driver and set the SnowflakeConnectionString setting. For more information, see Snowflake Connection Configuration.

Notes:

Create and Initialize Database

QPR ProcessAnalyzer needs an SQL Server database for storing data managed by the system. Also another database is needed to run SQL scripts, which is instructed later in section Scripting Sandbox. It's possible to connect to SQL Server either using Windows authentication (Windows account) or SQL Server authentication.

Follow these steps to create and initialize the database:

  1. Open SQL Server Management Studio and create a new database. You can use for example name QPR_ProcessAnalyzer. You must select <default> for the collation, so that the database collation will be same as the server collation. As QPR ProcessAnalyzer also uses the tempdb (which is using server collation), the collations between the QPR ProcessAnalyzer database and tempdb need to match.
  2. Create a login in Security > Logins > New Login....
  3. In the User Mapping tab, assign the login to the QPR ProcessAnalyzer database. For an easy setup, check the db_owner role, or for advanced setup, use the hardened configuration.
  4. Run database setup scripts initializedb.sql and optimizedb.sql, available in the PA_Deploy.zip package. The initializedb.sql script creates database tables, primary and foreign keys, indexes and default configuration data. The optimizedb.sql script take into use snapshot isolation (https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/snapshot-isolation-in-sql-server) and simple recovery model (https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/recovery-models-sql-server).
  5. Optionally, increase the Initial Size and Autogrowth settings of the database datafiles for better performance (in Database Properties > Files).
  6. Implement scheduled maintenance tasks for the database according to SQL Server best practices, e.g. backups and regular defragmenting of indexes.

Install Server Roles and Features for IIS

The following Server Roles and Features should be enabled for Microsoft Internet Information Services (IIS):

  1. On the taskbar, click Server Manager, and then click the Manage menu, and then click Add Roles and Features.
  2. In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
  3. In the Server Roles section, select the following components:
    • Common HTTP Features: Default Document, Directory Browsing, HTTP Errors, Static Content, HTTP Redirection (please do not install WebDAV Publishing because its handler mappings are not directly compatible with QPR ProcessAnalyzer)
    • Health and Diagnostics: HTTP Logging, Custom Logging
    • Performance: Static Content Compression
    • Security: Request Filtering
    • Application Development: .Net Extensibility 4.8, Application Initialization, ASP.NET 4.8, ISAPI Extensions, ISAPI Filters
    • Management Tools: IIS 6 Management Console
  4. In the Features section, select the following components:
    • .Net Framework 4.8 Advanced Services: ASP.NET 4.8
    • Windows Powershell: Windows Powershell 5.1 (or newer) (if available)
  5. On the Confirm installation selections page, click Install.
  6. On the Results page, click Close.

Install QPR ProcessAnalyzer Server using Web Deploy

Follow these instructions to install QPR ProcessAnalyzer server using the Web Deploy. There is also a manual installation method available. The QPR ProcessAnalyzer Service can be installed either via a Microsoft Web Deploy package or manually.

  1. Install Microsoft Web Deploy 3.6 or later (Installation package: https://www.microsoft.com/en-us/download/details.aspx?id=43717).
  2. Copy files PA_Deploy.zip, Configuration.ps1 and DeployPAService.ps1 to a same folder from the Service folder (QPR ProcessAnalyzer Server file package from Downloads page).
  3. Open Configuration.ps1 using a text editor and modify settings for your needs. The table below lists available settings in the file.
  4. Launch Microsoft PowerShell as an administrator and navigate to the folder containing the deployment files.
  5. Run .\DeployPAService.ps1 and input the application pool user password when requested (asked only if you chose to use custom credentials).
  6. Make sure that there is an https binding set to the IIS web site for QPR ProcessAnalyzer (found in Edit Bindings...). If you don't have a valid SSL certificate, a self-signed certificate can be used.
Parameter name Description Example value
$webSiteName Name of the IIS Website, where QPR ProcessAnalyzer Server is installed. The Website must be created when installing QPR ProcessAnalyzer Server. "Default Web Site"
$appPath Path where the application will be created. "$webSiteName\$virtualDir$appName"
$DBConnectionString Connection string used by QPR ProcessAnalyzer Server to access the database. "Server=localhost\databaseinstancename;Database=QPR_PA;Persist Security Info=False;User ID=<SQLServerLogin>;Password=<password>"
$customAppPool Defines if custom application pool is used. $false
$appPoolName Name of the application pool used by QPR ProcessAnalyzer Server. The application pool is created by the QPR ProcessAnalyzer Server installation. "QPRPA"
$customAppPoolCredentials Defines whether the application pool will be run as a user defined in $appPoolUser setting (password for the account will be requested during the installation.) If you set $customAppPoolCredentials = $false in the configuration script, you need to create a new user to DB and name the user NT AUTHORITY\NETWORK SERVICE and grant DBO role to it. $true
$appPoolUser Defines the identity under which the application pool is run. Password for the user is requested during the installation and not stored here. "PA_user"
$logFileName Name of the QPR ProcessAnalyzer Server log file. Only the file name, not the folder path. "PAService_$svcVerMajor.$svcVerMinor.$svcVerRelease.svclog"
$paLogFileName Name of the QPR ProcessAnalyzer log file. Only the file name, not the folder path. "w3wp.txt"
$logFilePath Path to the service log file and QPR ProcessAnalyzer log file. "C:\ProgramData\QPR Software\QPR ProcessAnalyzer\201X.X\Logs"
$supportLoadBalancer Defines if QPR ProcessAnalyzer service is running behind a system that hides the original client IP, such as a load balancer. If you are running the service in Amazon Web Services and wish to use the AWS load balancing, set to "True". "True"
$ActivationEMSAddress See the description of the corresponding setting in the web.config section. "https://activation.qpr.com"
$ActivUserFirstName See the description of the corresponding setting in the web.config section. "UserFirstName"
$ActivUserLastName See the description of the corresponding setting in the web.config section. "UserLastName"
$ActivUserEmail See the description of the corresponding setting in the web.config section. "system.owner@company.com"
$LicenseFilePath QPR ProcessAnalyzer Server license file path. The license file is generated automatically, when QPR ProcessAnalyzer Server is activated. The user account defined in the $appPoolUser setting must have write access to the specified folder. If this folder doesn't already exist, you have to create it. It's recommended to use folder C:\ProgramData\QPR Software\QPR ProcessAnalyzer\License\. The lisence file name is not part of this setting. "C:\ProgramData\QPR Software\QPR ProcessAnalyzer\License\"
$licenseFileName Name of the QPR ProcessAnalyzer Server license file. The license file is generated automatically, when QPR ProcessAnalyzer Server is activated. Please, do not change this setting. "pa_service.lf"
$ProductActivationCode See the description of the corresponding setting in the web.config section. QPR ProcessAnalyzer Server automatically activates itself if the code is specified and there is an internet connection in the server computer. If there is no internet access, the activation need to be done manually by using the Activation Utility.
$responsePollingInterval See the description of the corresponding setting in the web.config section. 300000

IIS Configuration

All the IIS configurations instructed in this chapter needs to be in place for QPR ProcessAnalyzer Server to work correctly.

Set Application Pool Always Running

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Select QPR ProcessAnalyzer application pool and click Advanced Settings....
  3. Set (General) > Start Mode to AlwaysRunning. Click OK.

Enable Application Preloading

  1. Open Internet Information Services (IIS) Manager and in the left side hierarchy under Sites select the QPR ProcessAnalyzer application.
  2. Click Advanced Settings... on the right pane.
  3. Set Preload Enabled to True. Click OK.

Disable Application Pool Idle Timeout

When the IIS application pool that runs QPR ProcessAnalyzer Server shuts down, all loaded models are dropped and script running is stopped. By default, idle application pools (i.e. QPR ProcessAnalyzer hasn't been used for some time) are shut down automatically after a certain time. To disable application pool idle timeout:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Locate QPR ProcessAnalyzer application pool, select it and click Advanced Settings....
  3. Set Process Model -> Idle Time-out (minutes) to 0. Click OK.

Disable Application Pool Regular Recycling

When the IIS application pool that runs QPR ProcessAnalyzer Server shuts down, all loaded models are dropped and script running is stopped. By default, application pools are restarted (recycled) regularly. To disable application pool regular recycling:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Locate QPR ProcessAnalyzer application pool, select it and click Advanced Settings....
  3. Set Recycling -> Regular Time Intervals (minutes) to 0. Click OK.

Disable Application Pool Overlapping Recycle

If using regular application pool recycling, e.g. at specific times, it's recommended to disable the overlapping recycles. When using overlapping recycles, a new instance is started before shutting down the previous, which will take much more memory. Disable the overlapping recycling as follows:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Locate QPR ProcessAnalyzer application pool, select it and click Advanced Settings....
  3. Set Recycling -> Disable Overlapping Recycle to True. Click OK.

IIS Application Pool User Profile Loading

To enable user profile loading:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Click QPR ProcessAnalyzer application pool and click Advanced Settings....
  3. Set Process Model > Load User Profile to True. Click OK.

The user profile loading allow access to their cryptographic store and environment variables (such as %TEMP%). Additional information can be found from Compatibility Issues with Application Pool Identities.

Disable Application Pool Pinging

Application pool pinging is a mechanism in IIS to monitor that applications are responding normally. In QPR ProcessAnalyzer, application pool pinging may cause issues when there are long running analysis calculations, because during them the application pool might not respond to a ping. As a result, IIS shuts down QPR ProcessAnalyzer application pool (that IIS considers unhealthy), and models are dropped from the memory which degrades performance.

To disable application pool pinging:

  1. Open Internet Information Services (IIS) Manager and click Application Pools in the left side hierarchy.
  2. Locate QPR ProcessAnalyzer application pool, select it and click Advanced Settings....
  3. Set Ping Enabled to False. Click OK.

More information about IIS Application Pool Pinging: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc725836(v=ws.10)

Add MIME Type for .po and .woff2 files (set by default)

Note: This setting is by default in place in the web.config file provided by the installation package.

IIS needs to have a MIME type for .po (language dictionaries) and .woff2 (fonts) files specified. Otherwise Follow these steps:

  1. Open Internet Information Services (IIS) Manager, expand the left side hierarchy and click QPRPA application.
  2. Select MIME Types.
  3. Click Add... and add a entry with .po extension and application/octet-stream MIME type.
  4. Add also an entry for the .woff2 extension with font/woff2 MIME type.

Importing large files (set by default)

Note: This setting is by default in place in the web.config file provided by the installation package.

To import files up to 2GB, the following settings need to be in place:

  • Web.Config/system.webServer/security/requestFiltering/requestLimits/maxAllowedContentLength (maximum allowed value 4294967295 bytes = 4GB)
  • Web.Config/system.web/httpRuntime/maxRequestLength (maximum allowed value 2147483647 kilobytes = 2TB)

Add HTTP response header Cache-Control: no-cache (set by default)

Note: This setting is by default in place in the web.config file provided by the installation package.

This setting configures the client side caching properties to work correctly. This setting defines that the caching can be used in the browser side, but the browser checks the latest versions of the files from the server.

  1. Open Internet Information Services (IIS) Manager and click the QPR ProcessAnalyzer web application (e.g. QPRPA).
  2. Select HTTP Response Headers QPR ProcessAnalyzer.
  3. Click Add..., and specify Name Cache-Control and Value no-cache. Click OK.

.Net Configuration: gcAllowVeryLargeObjects

The following change needs to be done to .Net configuration to run large process mining models:
1. Find and backup the .Net machine configuration file located in %windir%\Microsoft.NET\Framework64\v4.0.30319\config\machine.config where %windir% is the Windows folder (usually C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config).
2. Modify the file by adding the following tag inside <runtime></runtime> tags (if found):

<gcAllowVeryLargeObjects enabled="true" />

3. If <runtime></runtime> tags aren't found, replace <runtime/> tag with:

<runtime>
  <gcAllowVeryLargeObjects enabled="true" />
</runtime>

4. Open Internet Information Services (IIS) Manager and restart IIS by clicking Restart in the top right.