Skip to main content

How to Troubleshoot a CFML Request Timeout

A CFML request timeout occurs when a ColdFusion or Lucee application takes longer to process a request than the maximum time allowed by the application server. This article helps developers identify the cause of these timeouts and implement...

Before you begin

You will need:

  • Developer access to the ColdFusion or Lucee Administrator.

  • Access to the application's source code.

  • Ability to view and interpret server logs.

Identify the source of the timeout

Before making configuration changes, determine if the timeout is occurring at the application level or the web server level.

  1. Check the application's error page or the server logs.

  2. Look for specific timeout messages.

  3. If the error is a 504 Gateway Timeout or 502 Bad Gateway, the issue is likely occurring at the web server (e.g., IIS or Apache) or a proxy (e.g., Cloudflare).

  4. If the error is a ColdFusion/Lucee specific timeout (e.g., "Request Timeout" or "Execution Timeout"), the issue is within the application server configuration.

Check application execution time

If the issue is confirmed as a ColdFusion or Lucee timeout, identify the specific script or process causing the delay.

  1. Open the ColdFusion or Lucee Administrator.

  2. Navigate to Debugging > Debug Settings (or the equivalent section in your version).

  3. Enable Detailed CFML Error Information and Debug Logging.

  4. Run the application and capture the specific request that fails.

  5. Review the logs to identify the specific line of code or database query that is taking an excessive amount of time.

Adjust timeout settings

If a specific process requires more time to complete, you can increase the timeout limits.

Warning: Increasing timeout limits can lead to a higher number of concurrent processes hanging on the server, which may impact the performance of other applications.

  1. Open the ColdFusion or Lucee Administrator.

  2. Navigate to Applications > Application Settings (or Timeout Settings).

  3. Locate the Timeout setting for the specific application or the global default.

  4. Increase the value to a higher number of seconds.

  5. Save the settings.

Optimize the code

If a script is timing out because it is performing inefficient operations, optimize the code instead of increasing the timeout.

  1. Database Queries: Check for missing indexes or inefficient SQL queries.

  2. External API Calls: Use asynchronous processing or a background task runner for long-running external requests.

  3. Looping: Ensure that loops are not performing redundant operations or making repeated database calls.

Clear the CFML Template Cache

Sometimes, stale cache files can cause unexpected delays in script execution.

  1. Open the ColdFusion or Lucee Administrator.

  2. Navigate to Server Settings > Cache.

  3. Select Clear All Cache or specifically clear the Template Cache.

  4. Test the application again.

Restart the ColdFusion or Lucee Service

If the application remains unresponsive after configuration changes, a service restart may be required to clear hung processes.

Warning: Restarting the service will temporarily take all ColdFusion/Lucee applications offline.

  1. Open the Windows Control Panel or the relevant service management tool.

  2. Locate the ColdFusion or Lucee service.

  3. Right-click the service and select Restart.

Confirm the result

  • The specific request that previously timed out now completes successfully.

  • The application remains stable under normal load.

  • No other applications on the server are experiencing performance degradation.

If the timeout persists after increasing limits

If the request still times out after increasing the ColdFusion/Lucee limits, the bottleneck may be at the web server level.

  1. Check the IIS or Apache timeout settings.

  2. If using a proxy like Cloudflare, check the proxy's timeout limits.

  3. Ensure that the web server's timeout is higher than the application server's timeout.

Limitations

  • This article does not cover timeouts caused by network-level issues or firewall blocks.

  • Increasing the timeout is a temporary fix; long-running processes should ideally be moved to a background task or a message queue.

Did this answer your question?