July 12, 2018
Performance Monitoring Toolset – Auto Connector Tuning
Comments
(2)
July 12, 2018
Performance Monitoring Toolset – Auto Connector Tuning
Senior Lead Software Engineer
Staff 4 posts
Followers: 4 people
(2)

Connector tuning is one of the essential part of setting ColdFusion Server for production deployment. Incorrect values lead to Service Unavailable or Server too busy errors. With ColdFusion 2018 release, most of these assumptions can we verified with actual data. With auto connector tuning, Realtime traffic and load data on the connector will be tracked and displayed on Performance Monitoring Toolset.

Admin/developers can log into the Performance Monitoring Toolset to visualize the load on individual site/connector on a time series chart.

Before we dive deeper into the feature, let’s understand various configuration/parameters for connector currently supported in ColdFusion.

The important parameter which will be discussed in this blog are:

  1. Connection pool size
  2. Connection pool timeout
  3. Max reuse connections

Connection Pool Size: This setting determines the maximum number of connections that can be created in the connection pool. When multiple requests arrive to the connector from IIS, connector creates new connections in the connection pool only if there are no free connections available in the pool. The connector will not create a new connection if connections reach the connection pool size limit.

Connection Pool Timeout: Time out value(seconds) for each idle connection in the pool is governed by this setting. This value must be in sync with the connectionTimeout attribute of your AJP connector in Tomcat’s server.xml

Max Reuse Connections: When AJP connector makes a connection with ColdFusion server, it does not close the connection even after it finished serving the request. Instead it keeps the connection active, so that for the next request, the same connection can be re-used. This is also called persistent connection.

There are other parameters which a connector inherits from Tomcat AJP connector. Please find the details of those settings from AJP documentation (http://tomcat.apache.org/connectors-doc/reference/workers.html)

The worker.properties is available at {CF-Home}/config/wsconfig/{some no}/ and the server.xml can be found at {CF-Home}/cfusion/runtime/conf/.

There are usually problems and confusion regarding the appropriate value for Connection Pool Size and Max Reuse connection. Finding the appropriate value requires lot of trial and error and simulating the production work load.

After ColdFusion installation, the you can launch the “Web Server Configuration tool” and create the connector for “Individual Site” or “ALL” sites or All Individually in IIS.

1

Some new fields have been added to the webserver configuration tool. WebSite load, this field accepts one of the following values, High, Medium, Low. It signifies the number of request/load the webserver site should handle.

If you know the amount of traffic his website is expecting, he/she can select the appropriate option. Default values set for configuration parameters can be seen by clicking ‘Advanced…’ button is show in the below screen shot.2

User can change these default values based on their requirements.
In ColdFusion 2018 connector sends load information to ColdFusion Server periodically. Default schedule time interval is 30 seconds.

3

This setting would be part of worker.properties file as heartbeat_interval, user can change this value in file as well.
Let’s understand various types of site configuration for IIS.
1. All
2. Individual
3. All-Individual

All: For this type of configuration, only one magic folder (folder created in {CF-Home}/config/wsconfig/{some no}/) is created for all the websites, i.e. same configuration parameter will be used for all the sites.

4

With this setting user doesn’t have control over tuning separate pool size and connection time out for individual website.
Individual: With this configuration user has higher degree of control on tuning the parameters for individual sites, as each website has its own magic folder.

5

All-Individual: This configuration is like individual, but you do not have to manually create connectors for individual sites. In this approach, all the sites will be configured to talk to same ColdFusion instance if cluster is not configured.
In the above scenario each site has its own connector. Based on load on a particular site the allocation of max-reuse or connection pool size has to be done as a ratio of maxthread in ColdFusion .
Suppose ratio of load on the three site are like this 3:2:1 and maxthread in CF is 600, then max-reuse on each site should be Site1 – 300, Site2 – 200, Site3 – 100 . Value of maxthread (server.xml can be found at {CF-Home}/cfusion/runtime/conf/. )at ColdFusion end should be the cumulative sum of connection_pool_size and server.xml at ColdFusion side should look like:
<Connector port=”8012″ protocol=”AJP/1.3″ =”8445″ tomcatAuthentication=”false” maxThreads=”600″ connectionTimeout =”60000″> </Connector>

Connector auto tuning settings in Performance Monitoring Toolset:

When a ColdFusion instance is auto-discovered and is enabled for tracking, the connector auto-tuning is enabled by default.
You can choose to enable/disable the setting from Settings > Monitoring screen.

6

The threshold at which the auto-tuning is triggered is at 90% of the pool size and the pool would be increased 20%.
For example, if the pool size is 100, then the auto-tuning would be triggered if the busy connections are >90 and the pool size would be increased to 120.
The Maximum limit of the pool size for any site cannot cross 2000(default).

Alert Configuration:
You can also configure alerts, when the pool size increases a certain configurable limit.
Alerts can be sent by email/slack and notification icon in Performance Monitoring Toolset dashboard.

7

When a ColdFusion instance is enabled for tracking, the server is configured with any web server(IIS/Apache), and at least one request must be made through the connector for the site to be displayed in Connector overview section of Overview screen.8

When a ColdFusion instance is enabled for tracking, the server is configured with any web server(IIS/Apache), and at least one request must be made through the connector for the site to be displayed in Connector overview section of Overview screen.

9

The Number of sites in the Connector overview, shows the total number of sites configured with the ColdFusion server.
The Health score section shows the health of the site, based on the load of the site. A site is shown in-active, if the site crosses the idle timeout (which is 20 minutes) for IIS.
Clicking on any site, or navigating to the connector section would show the detailed view of the connector. The detailed view shows the Busy Connections, Average response time on a time series graph, based on the time filter applied. It also shows list all the list of sites configured along with the health score and the total load on the site.

10

Hovering over the Busy connections graph, over time, would display a tool tip with busy connections and the pool size at that instance of time.
There is a ‘sites’ filter available to choose the sites, for which busy connections are shown. If there are more than 5 sites, you can choose what sites to monitor, and the selection would be automatically saved.
When the connections cross the threshold set, then the auto-tuning triggers and increases the pool size. When auto-tuning happens the pool-size would be increased automatically and there is no need of IIS restart. Auto-tuning is indicated by Auto-tuned icon on the Busy connections graph. Hovering on the icon, says the total number of times the site got auto tuned and the duration in which it got auto-tuned. Clicking on the auto-tuned icon shows a pop-up with the selected sites’ previous pool size and new pool size and what were the Busy connections at which the auto-tuning triggered. A dotted line on the graph indicates the new pool size.
It also shows all the request made at that instance of time.

Note:
1. After the idle timeout, the pool size that is increased during auto-tuning would be reset to the pool size that the user has set during connector configuration.
2. While configuring connectors, if the sum of pool size of all the sites configured is above 500, then user has to manually increase the maxThreads property of the AJP connector in the server.xml.
3. During auto-tuning we only auto-tune the pool size at IIS connector level. In CF server there is a property maxThreads which doesn’t get auto-tuned. There is a queue at ColdFusion server level, which queues the request if there are no worker threads available. But there is no such queue at mod_jk connector level.

11

In case of a connector configured with cluster, you can drill-down further to see the requests on the based on the worker.
You can navigate to the detailed view for a cluster, by clicking on the site name on the Overview page or by clicking on the site name in the ‘list of sites’ section in the connector page.
The detailed view shows, the busy connections against the worker and which worker got auto-tuned and the health of the workers.

12

In case of Apache, the documentation clearly says “The maximum connection pool size can be configured with the attribute connection_pool_size. We generally do not recommend to use this attribute in combination with Apache HTTP Server. For Apache we automatically detect the number of threads per process and set the maximum pool size to this value.”
Ref: https://tomcat.apache.org/connectors-doc/common_howto/timeouts.html
Hence, we are not tuning the connection pool size.
Note: Connector auto tuning is applicable only for IIS and not for Apache.
You can see which site is connected to which ColdFusion instance/ ColdFusion cluster in Topology/Sites view.

13

2 Comments
2018-07-17 03:37:24
2018-07-17 03:37:24

I have a few questions after reading this.

1) Does the next to last sentence mean that this whole “auto-connector tuning” feature does not apply to Apache? but only to IIS?

It seems that the tuning is only done to the connection_pool_size, yet that sentence about Apache says, “Hence, we are not tuning the connection pool size.” I just want to make sure I’m interpreting that correctly.

2) Also, this article doesn’t make clear: does the auto tuning really change the values on the fly? No restart of IIS required? Nor of the app pool for the site using the connector?

3) And if the auto-tuning raises the values of one or more connection_pool_size values in one or more connectors, does it then also auto-tune (change) the maxthreads value for the AJP connector XML element in the server.xml file? This document comments (in discussing ratios) how that value “should be the cumulative sum of connection_pool_size[s]”, but it never mentions whether the tool changes that value as it autotunes the pool size(s).

Like
(1)
(1)
>
Charlie Arehart
's comment
2018-07-18 07:58:15
2018-07-18 07:58:15
>
Charlie Arehart
's comment

Thanks Charlie for bringing up few points that were missed in the blog.
I have updated the post with points asked by you, so that we have entire information updated at one place.
Below are the answers for the questions:
1) Does the next to last sentence mean that this whole “auto-connector tuning” feature does not apply to Apache? but only to IIS?
Ans: Yes auto-tuning feature is only applicable for IIS and not for Apache, in case of Apache we are just displaying the busy connections.
2)Does the auto tuning really change the values on the fly? No restart of IIS required? Nor of the app pool for the site using the connector?
Ans: When auto-tuning happens the pool-size would be increased automatically and there is no need of IIS restart.
3) Does it then also auto-tune (change) the maxthreads value for the AJP connector XML element in the server.xml
Ans: While configuring connectors, if the sum of pool size of all the sites configured is above 500, then user has to manually increase the maxThreads property of the AJP connector in the server.xml.
During auto-tuning we only auto-tune the pool size at IIS connector level. In CF server there is a property maxThreads which doesn’t get auto-tuned. There is a queue at ColdFusion server level, which queues the request if there are no worker threads available. But there is no such queue at mod_jk connector level.

Like
(3)
Add Comment