I often come across poor performing SmartForm applications and have had many successes tuning and optimizing them. However, this is somewhat reactive. Business users will normally complain first before developers take action.
Recently, I was invited to take a look at one of the application performance monitoring tools called eG Enterprise. This is a product by the company eG Innovations which is headquartered out of Singapore and has offices globally. They have both on-premise and cloud based monitoring solutions and one of the interesting capabilities was the ability to monitor across different layers in the application (network, IIS, SQL, storage, etc).
In this article, I will be covering:
- How to install and configure eG Enterprise to work with a K2 setup. This will be using their cloud based version.
- Show off some of the monitoring and dash board functions available in eG Enterprise.
Installing eG Agent
1. Before doing the setup, we added a configuration on the eG site to allow us to test the agent. In this case, we added a SQL component which points to our server. Note that I was testing this on a internal virtual machine via NAT so I configured an internal IP address. In a production scenario, you can open the SQL server’s port to the eG’s external agent IP. This will allow it to monitor the SQL server service.
2. On the K2 server, run the correct setup file for your OS platform. In my case, this is on Windows 2012 R2 x64.
3. Click Next on the welcome message screen.
4. Click Next on the License Agreement page.
5. The default setup location is C:\. In my case, I choose to put it in C:\Program Files\.
6. Choose whether your setup is using SSL or not. In this setup, we are using SSL so click Yes.
7. You can choose whether to only allow trusted certificates. For this setup, I selected No.
8. Specify your eG Manager site name and the port.
9. No proxy is involved on my setup so I selected No.
10. Click Next on the summary page.
11. Click Yes to assign a name for the eG Agent.
12. Give a nickname to this host (This will be used later in the configuration).
13. That completes the setup!
14.At this point, you will see two windows services installed (eGAgentMon and eGurkhaAgent).
15. You can check the agent error logs to see if there is any communication errors between the agent and the eG manager. The log file can be found in <install dir>\eGurkha\agent\logs.
Configure eG Manager
For the eG configuration, I will be covering the key configuration screens that were used for this demonstration. Note that it is recommended to work with the eG team to make sure your environment is configured to the way you want and that the right components are monitored.
16. After the agent setup, we can then configure the IIS component. This will be for the web layer monitoring. The host nick name specified earlier will be used.
17. The Real User Monitor (RUM) component will be the required for us to track the real time usage of the application.
18. Once this is done, we can create a segment and include the different components. This is one of the cool features available on the eG platform to allow monitoring to the different tiers in the application.
19. The other item that you would want to tweak is how eG monitors the application. This involves the “URL Segments to be used as grouped URL” setting. By default, it groups applications by the first and second URL segments.
20. As the SmartForms URL path is usually in the format <base url>/Runtime/Runtime/Form/<Form Name> or <base url>/Runtime/Runtime/View/<View Name>. The first and second segments represent “Runtime/Runtime”. We will switch it from “1,2” to “3,4” to differentiate each SmartForm Form and View.
Configure IIS URL Rewrite Rules for Real User Monitoring
Now to be able to use the RUM component, eG has two ways of integrating with your application. The first method involves script injection into your master page (assuming this is an ASP.NET solution). For SmartForms, we will be using the second method which is to use the IIS URL Rewrite method.
21. Important! To use the IIS URL Rewrite method. First download and install IIS URL Rewrite 2.0. Version 1.0 is installed on Windows 2012 R2 and needs to be upgraded.
22. As outbound URL rewriting can only be done on uncompressed context, we need to turn off static compression. In IIS Manager, click on the Compression icon under the Runtime folder.
23. Uncheck the Enable static content compression checkbox and save your settings.
Note that K2 by default turns this setting on for performance reasons. Turning static compression off is required in this case. This might cause a performance hit due to higher bandwidth traffic depending on the content of the page.
24. Outbound rewriting can be used together with IIS dynamic compression if you set the following key in the registry.
Note: You can also add it using this command.
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v LogRewrittenUrlEnabled /t REG_DWORD /d 0
25. Now let’s configure the RUM Head rule which inserts the start time script. Under the Runtime folder, click on the URL Rewrite icon.
26.Click Add Rule(s)..
27. Select Outbound rules > Blank rule.
28. Give a name “eG RUM Head Rule” and select <Create New Precondition…>.
29. Give a name “isHtmlContent” and click Add.
30. Enter a pattern of “^text/html”. Your Add Condition dialog should look like this. Click OK.
31. Click OK to save the Precondition.
32. On the Edit Outbound Rule screen under the Match section, enter the Pattern value of “</head[^>]*>”. Under the Action section, enter the Value of
33. Click Apply to save the settings.
34. Now we will be adding the RUM body rule. Repeat steps 25-27. In the new Outbound Rule. Give the name “eG RUM Body Rule” and select the isHtmlContent precondition. Under the Match section, enter the Pattern value of “</body[^>]*>”.
35. For the Action section, enter the value
Note: The settings in red will be taken from your configuration in the eG manager. This will be unique for your side.
Note: If your SmartForm runtime site is using SSL, the settings need to also match accordingly. i.e. the RUM URLs must also be using SSL.
36. To verify that you have done this right, you can run any SmartForm page and view the page source. You should see these two script sections being inserted.
Now here is the good stuff! If you have done everything right, you will get access to the various dash boards and reports.
You can see the health of the various layers and also be able to pinpoint issues at each tier. In the screenshot below, we can see that there are some errors found in the system event log. You can access the details directly.
Real User Monitoring Dashboard
This gives real time statistics on your SmartForm site. You can configure the data collection intervals as required (in this example, we configured to collect every 2 minutes). You can see where your traffic is coming from and also the various statistics on your pages.
You can also monitor the traffic load and user experience over time. Very cool.
Page Groups Performance Report
This report allows you to query data over a specified period and it gives you detailed information on how your SmartForm applications are running.
Page Requests – Page Groups Report
This report shows you the average load times of the various pages and is useful for identifying which pages are having performance issues. This allows your developer to focus on optimizing the right pages.
Top N by Page Views Report
This is another useful report which shows you the number of page accesses over a specified period of time. This is great for identifying your popular applications and also the profile of your users (browser types and location).
This article is intended to give good insight on how K2 integrates with Enterprise Application Monitoring tools like eG Enterprise. The capability to have a 360 degree view of your environment and applications can be invaluable and a strong positive impact to the way you work. I hope this will be valuable to you. Cheers!