Why is Lucee slow under IIS using BonCode / AJP, and how do I fix it? Print

  • 0

Pages are very slow (multiple seconds) when accessed via IIS → BonCode → Lucee using the AJP connector. Direct access to Lucee’s HTTP port (e.g. localhost:8888) is much faster.

Cause:

On Windows, network address resolution / connector binding mismatches (e.g. using localhost or 127.0.0.1 vs IPv6 loopback ::1) can introduce delays. The BonCode connector and Tomcat's AJP connector may default to addresses that cause extra lookup / resolution or misrouting, which slows down the request. Also, mismatched configuration (threads, connections, packet size, timeouts) can worsen the bottleneck.

Fix / Configuration Steps:

  1. Edit server.xml (typically in …\lucee\tomcat\conf\server.xml) to locate the <Connector protocol="AJP/1.3" … /> line and includ
    address="::1"

    so it looks something like:
    <Connector protocol="AJP/1.3"
    port="8009"
    secret="…"
    secretRequired="true"
    redirectPort="8443"
    address="::1"
    maxThreads="5000"
    packetSize="65536"
    keepAliveTimeout="-1"
    maxConnections="5000"
    />
  2. Depending on your setup this step might not be required, it is recommended to action the above change and restart Lucee to check if this resolves the issue with slow rendering.

    In BonCodeAJP13.settings, set the Server property to ::1 to match. 

    For example:
    <Settings>
    <Server>::1</Server>
    <Port>8009</Port>
    <MaxConnections>5000</MaxConnections>
    <PacketSize>65536</PacketSize>

    </Settings>
  3. Make sure maxThreads in server.xml matches (or is appropriate relative to) MaxConnections in BonCode settings. Also adjust other AJP connector attributes such as packetSize and keepAliveTimeout (-1 seems to help) as needed.
  4. Restart Lucee / Tomcat after changing server.xml. Also restart or recycle IIS / BonCode after changing BonCode settings.

 

 


Was this answer helpful?

« Back