In response to Chris Tierney’s recent article on max_reuse_connections in ColdFusion

This blog is in response to Chris Tierney’s recent article on max_reuse_connections in ColdFusion. Sorry Chris, but your blog truncated the server.xml entry, when I posted back. So, I am responding here.

Chris,

As mentioned on the blog, when Tomcat connector makes a connection with Tomcat server, it does not closes 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. Also, the max value for the re-use connection is determined based on the number of sites configured with same CF server and the load on each site.

If you have connector created with “ALL” then the resources allocated, will be shared across connections. Whereas, the individual connectors would have there own dedicated connections. The reuse connection plays an important role in terms of performance, but the calculation has a little tweak to it. While creating individual connectors, we would prefer to keep the max_reuse_connections not go below 100 or 150 (if it’s a low traffic running site). For moderate traffic, the value may be 200/250. For a site running under high volume, the value may go around 500 or as higher, as needed.

Having said that, lets look at your scenario. You have 6 sites – 1 running under load and 5 with low traffic. When you create individual connectors, theoretically, these values can be set:-

Site with heavy traffic (only one site)

worker.cfusion.max_reuse_connections=500 worker.cfusion.connection_pool_size=800

Site with low traffic (rest five sites each)

worker.cfusion.max_reuse_connections=100 worker.cfusion.connection_pool_size=250

server.xml

<Connector port=”8012″ protocol=”AJP/1.3″ redirectPort=”8445″ tomcatAuthentication=”false” maxThreads=”2100″ connectionTimeout =”60000″> </Connector>

Note: calculation for maxThreads: 800+250*5=2050 (the value should be higher than this)

Similarly, when connector is created with “ALL”, theoretically, these values can be set:- worker.cfusion.max_reuse_connections=350 worker.cfusion.connection_pool_size=2100

server.xml

<Connector port=”8012″ protocol=”AJP/1.3″ redirectPort=”8445″ tomcatAuthentication=”false” maxThreads=”2100″ connectionTimeout =”60000″> </Connector>

Note: calculation for max_reuse_connections=connection_pool_size / {no of site}=2100/6=350.

Thus, in case of connector is created with “ALL”, the max_reuse_connections calculation is straight forward, but in case of “Individual” connector, its a bit tricky :-).

Advertisements

11 thoughts on “In response to Chris Tierney’s recent article on max_reuse_connections in ColdFusion

  1. Anit, for your example above, with one connector having one site, can you clarify why you did not set the max_reuse_connections = connection_pool_size?

    Also, your discussion here, like that of the Adobe blog, leaves something out which seems may be important: are we really talking about sites? or connection pools (if using IIS)? For instance, if one configures the connector for “all sites” (unlike your first example above), and has 20 sites but each in their own app pool, does it affect these calculations differently than if it was 20 sites all in one app pool?

    I have more questions about all this, as does Byron in the Adobe blog post (no reply to him since Mar 3, at http://blogs.coldfusion.com/post.cfm/coldfusion-11-iis-connector-tuning#comment-D61C64EC-A551-FD91-FD3548D61A0645EB), but if you might be able to at least answer the above single question, it could help folks who have been left wondering about this.

    I really do hope that in time we all get to better understand the real ins and outs of this connector tuning, especially how best to monitor it, and know when we have good or bad values. But in the meantime, thanks for trying to advance the conversation with this post from Dec ’14.

    Like

    • Trena,

      Are yo getting “Service Unavailable”? The error codes you are sharing, looks to be from Event Viewer. They may not helpful. Can you describe in detail, what you see?

      Like

      • Yes. Here are the following messages I am receiving:
        The ColdFusion10 application services terminated with the following error: The requested resource is in use.

        The IIS Admin Service entered the stopped state.

        The Kernel power manager has initiated a shutdown transition.

        The operating system is shutting down at system time…

        I hope this helps.

        Thanks,

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s