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 :-).

12 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

  2. Hi Anit,

    in your first example with individual connectors your server.xml says “maxThreads=”2100″”.
    Your description says: “Note: calculation for maxThreads: 800+250*5=2050 (the value should be higher than this)”.

    In your second example with ALL IIS sites in one connector your server.xml stays at the same amount of “maxThreads=”2100″”. And your description says: “Note: calculation for max_reuse_connections=connection_pool_size / {no of site}=2100/6=350”.

    So why isn’t the “maxThreads” Value higher in the second example and server.xml?
    Why you don’t say here the value should be higher than this?

    I don’t understand the difference.

    My second question is.
    Your server.xml looks like this:
    ” ”

    My server.xml looks like this:
    “”

    Is “” really necessary or is “/>” at the end as closing tag enough?
    Because “/>” is the default one shipping with ColdFusion10..

    Thanks in advance!

    Kind regards from Germany,

    Patrick

    Like

Leave a comment