Application Server
Purpose of the Application Server
The purpose of the Perfion Application Server is threefold:
It offloads the Web- and Windows-clients certain tasks.
It replaces the Perfion Scheduler.
It runs certain maintenance tasks.
Offloading jobs from the client
The primary purpose of the Application Server is to allow clients (both the Windows and the Web-client) to send it jobs for asynchronous execution, allowing the client (and its user) to continue working. Running a report or executing an Action are good examples of such jobs.
Before version 4.9 2021 R1 only the Web Client were able to send jobs to the Application Server, but from this version and on, the Windows Client can do it as well.
In this version, the Application Server allows both clients, to perform jobs doing the following:
Execute an action
Run a report or a publication
Do an Import
More Job Types will be added in later versions of Perfion.
Replacing the Scheduler
The Application Server replaces the Scheduler, meaning that it takes over its duty of running Scheduled Tasks.
This means that before installing the Application Server you must uninstall the scheduler, if you have it installed. These two tools will simply not co-exist on the same Perfion Database.
From version 4.9 there is no Scheduler, and an old 4.8 scheduler will refuse to start as soon as your Perfion database has been upgraded to 4.9.
Running Maintenance Tasks
In version 4.9 the Application Server do not have any built-in maintenance tasks. Such tasks will be added in a later version.
Licensing
Note that while running the Application Server does not require any special license, you still need a license to run tasks on the Scheduler (which now is a part of the Application Server).
Furthermore you also need a separate License in order to have access to Actions.
Installing the Application Server
The Application Server can be installed either as a Windows Service or as a Console App. This means, that the Application Server, as the name implies, is a “server process” and will run despite that all Perfion Clients in some installation are shut down. In other words the user can ask the Application Server to do some lengthy job, shut down his/her client and come back next morning to a job that has hopefully completed by then.
The console and service-versions work exactly the same. Perfion recommends installing it as a service, since a service will run on a server despite that no one is logged in.
Installing as a Console App
These are the steps to install the Application Server as a Console App
NOTE: A single Application Sever instance can only serve one Perfion Database. If you have more Perfion Databases, you need to install an Application Server per database. Simply repeat steps 4 - 8 for each database using a separate installation-folder for each (used in step 4).
Uninstall the Scheduler, if you have it running. The Application Server will take over its tasks.
Find a suitable server for running the Application Server. It can be any Windows Computer having the .net 4.8-framework installed and being able to reach the Perfion Database.
Obtain the zip-file containing the Application Server from the Perfion Knowledge Base.
Unzip the contents of the zip-file to a folder on the chosen server.
MAKE SURE to right-click the downloaded zip file, choose Properties and Unblock It before extracting all files
Open the file named Perfion.ApplicationServer.ConsoleApp.exe.config (not Perfion.ApplicationServer.Service.exe.config) and edit the connection string so that it connects to the correct database.
Open a Command-prompt and go to the Installation-folder
Start the Perfion.ApplicationServer.ConsoleApp.exe (not Perfion.Scheduler.Service.exe) by simply typing Perfion.ApplicationServer.ConsoleApp.exe in the prompt and hitting return.
If you have multiple database on which you want to run the Application Server, you need to repeat all the above steps, paying attention to the following:
Each Application Server needs its own installation folder (step 4)
Only one Application Server may handle a Perfion database. Two Application Servers cannot coexist on the same database.
The final step 8 will launch the Application Server as a console app. It looks like shown in the figure below:
If you get an error message when launching it, please check your database connection string. If problem persists, please create a support ticket in Zendesk.
The Console App can be stopped by pressing the “Return”-key in the window, after which it closes.
After restarting the Windows server, for whatever reason, you will need to restart each Application Server, when running as a Console App.
Installing as a Service
Below are the steps need to be performed to install the Application Server as a Windows Service.
Do steps 1 - 5 as when installing as a Console App.
Open the file named Perfion.ApplicationServer.Service.exe.config (not Perfion.Scheduler.ConsoleApp.exe.config) and change the connection, so that it connects to the correct database.
If you intend to run multiple Services (i.e. you have multiple databases) you must additionally change the InstallUtil.exe.config-file (a sample file is part of the package). In this file you must change the ServiceName, so that each set up service has a different name. This is needed since two Windows-services cannot have the same name. In order to distinguish each service in the Service-Window, it is a good idea to also change at least the DisplayName and maybe even the Description as well.
A sample InstallUtil.exe.config -file is shown here.
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0.30319"/>
</startup>
<appSettings>
<add key="ServiceName" value="My.Application.Server.Production"/>
<add key="DisplayName" value="My Production Application Server"/>
<add key="Description" value="My Perfion Application Server for Production"/>
</appSettings>
</configuration>
Open a Command-prompt as an Administrator and navigate to the installation folder.
Type the command:
InstallUtil.exe "Perfion.ApplicationServer.Service.exe"
Assuming the above succeeds (check the output from the InstallUtil-tool), the Application Server is installed and only needs to be started.
Open the Services-Window (run services.msc) and find the Application Server-service which is (display-) named My Production Application Server, assuming you used the same naming as shown in the sample above. See screenshot below.
Double-click it to edit it and do the following:
Set Startup Type to “Automatic” assuming you want the service to start with the server.
Click the button “Start” to start it now.
If you want more Application Servers on the same machine, please run steps 4 – 10 again, making sure that:
You create a new folder for each Application Server
Each service gets its own name in its own InstallUtil.exe.config-file.
Make sure that each service points to its own database. Two Application Servers cannot coexist on the same database.
When having done the steps 1 through 12 the Application Server-service go into status “running” as shown in the screenshot below:
NOTE: The Application Server automatically adds the current version number to the display name for convenience.
Uninstalling the Application Server-service
This is done using the following steps
Open a command-prompt as an Administrator.
Go to the installation folder for the Application Server you want to uninstall.
It is here important that the InstallUtil.exe.config-file holds the unique service name of the Application Server-service to be uninstalled. It should do so, if it has not been modified since it was installed.
Run the following command in the prompt: InstallUtil.exe "Perfion.ApplicationServer.Service.exe" /uninstall
This will uninstall the Application Server with the name provided in the InstallUtil.exe.config-file.
Testing that the Application Server is running
When you have a running Application Server on some Perfion database, you can start the either the Windows or Web Client to check whether it runs as it should or not.
Windows Client
When Application Server is running the two icons with numbers in top right corner of the Windows Client will “light up” as shown here:
When Application Server is not running the two icons will be “greyed out” and look like this:
To learn more about these number, please go to Chapter Understanding the number-icons in main form.
Web Client
When Application Server is running the Application Server icon top right in the Web Client is blue. It looks like this:
When Application Server is not running the same icon is “greyed out” and looks like this:
Using the Application Server in the Windows Client
This chapter will very briefly describe how to use the functionality available on the Application Server when using the Windows Client.
The Windows Client requires an Administrator to pick which functionality for which the Application Server should be used. This is opposed to the Web Client, which cannot do any of the provided functionality, if there is no Application Server installed to do it.
Per default all functionality available on the Application Server will still run locally in the Windows Client, so to utilize the Application Server here, you should, as an administrator, go to “Administration”, pick “Settings” and switch to the “Application Server”-tab and enable the wanted functionality. This tab is shown here:
The topmost three buttons control whether a functionality is run locally or on the Application Server. A “blueish”-button is checked meaning that the client would use the Application Server. A grey button means that the client would run the functionality locally. So in the above example “Reports and Publications” as well as “Actions” are both handled by the Application Server, while “Import” is still to be run locally.
The settings here are global for the Perfion-database, meaning that all users using the Windows Client will be affected by the above.
NOTE: When a functionality is chosen to be run on the Application Server, the client will show an error-dialog if the Application Server for some reason is not available, when some job is requested (i.e. is report is run). The client will not “fall back” to run the report locally.
Note further, that in case you do not use the Web Client, using the Application Server in your installation is optional. All functionality in Perfion is still available to be run local, despite that you choose not to install the Application Server. This may change in a future release of the Application Server.
Running a report or a publication
Running a report on the Application Server is done the exact same way, as when running it locally: Simply right-click an item in some grid and in the popup-menu that appears pick, under the Reports-menu, the one you want to run.
Doing it on the Application Server, however, will not block the client during its generation. Instead the client will send the Job to the Application server and show a “Job Created”-alert telling you, that the Job indeed has been created and that the Application Server soon will pick it up. The alert shows in bottom corner of the Main Form as seen in the screen shot below.
When the Application Server is done carrying out the Report-job (or any Job, for that matter), a similar alert shows up telling you, that the Job has completed. If you are fast, you can click the text, which really is a link, and the produced output will show.
In case you choose not to click it, you can go to the so-called Job Viewer to see the list of jobs you currently have run or still is running. You open the Job Viewer, for example, by clicking any of the icons in the top right-corner of the Main Form. The Job Viewer looks like this when a single Report-job has completed:
Double clicking a job will show you the result of it (if it has a result). In this example, clicking a report job will bring up the usual Perfion Report-dialog (not shown).
You can read more about the Job Viewer in Chapter The Job Viewer.