Troubleshooting Too Many Connections Error

If you're encountering Too Many Connections errors, this might indicate potential connection leaks in your BeanShell scripts or custom plugins, especially if you are not using the default data source. To address this issue:

  1. Review the Database Connection Monitoring and Leak Detection documentation for guidance on identifying leaks.

  2. The default configuration allows for 500 concurrent database connections. Considering a scenario where each user utilizes an average of 10 connections, this supports approximately 50 concurrent users. It's important to note that simply increasing the maxActive setting is not a recommended solution for connection leaks, as the limit will inevitably be reached if the leaks are not resolved.

  3. Ensure all connections are properly closed in your custom scripts and plugins.

  4. Examine the currently running application and other applications on your Joget platform. Remove any unused applications to free up resources. You can do this by exporting all applications to the server, unzipping them, and then using a text editor to check each appDefinition.xml for BeanShell scripts with SQL codes.

    Alternatively, you could use the App Composer > Advanced Tools > Beanshell to view all the available Beanshell scripts in an App.
  5. Locate your custom plugins at: [JogetFiler]\wflow\app_plugins.

  6. Employ the Performance Analyzer and Application Performance Management (APM) tools to identify slow queries impacting database performance.

  7. Investigate all running and slow queries in your database to determine which ones consume excessive connections. Database engines offer various tools for viewing these queries.

  8. From Joget v6 onwards, administrators can configure settings for the JDBC pool library in the datasource.properties file. Below is an example from the app_datasource-default.properties:

    workflowDriver=com.mysql.jdbc.Driver
    workflowUrl=jdbc:mysql://localhost:3306/jwdb?characterEncoding=UTF-8
    workflowUser=root
    workflowPassword=
    profileName=
    minEvictableIdleTimeMillis=10000
    timeBetweenEvictionRunsMillis=10000
    numTestsPerEvictionRun=-1
    minIdle=1
    maxActive=600
    maxWait=10000

For more details on JDBC pool configuration, see the Tomcat JDBC Connection Pool documentation.

Created by Julieth Last modified by Aadrian on Dec 13, 2024