Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a tomcat server hosting REST APIs. It is connected to a MySQL (RDS Instance) server on the backend. A majority of the operations are write operations (Around 75%). I'm using the Tomcat's connection pool.

Following are the connection pool parameter settings for a Medium RDS instance:

        System.setProperty("org.apache.tomcat.jdbc.pool.FairBlockingQueue.ignoreOS", "true");
        PoolProperties p = new PoolProperties();
        p.setMaxActive(300);
        p.setMaxIdle(10);
        p.setInitialSize(10);
        p.setMinIdle(10);
        p.setDriverClassName("com.mysql.jdbc.Driver");
        p.setJmxEnabled(true);
        p.setTestWhileIdle(true);
        p.setTestOnBorrow(true);
        p.setValidationQuery("SELECT 1");
        p.setTestOnReturn(false);
        p.setValidationInterval(30000);
        p.setTimeBetweenEvictionRunsMillis(30000);
        p.setMaxWait(120000);
        p.setRemoveAbandonedTimeout(60);
        p.setMinEvictableIdleTimeMillis(60000);
        p.setAbandonWhenPercentageFull(40);
        p.setLogAbandoned(true);
        p.setRemoveAbandoned(true);
        p.setJdbcInterceptors("org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;"
            + "org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;"
            + "org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer");

Question We keep getting a PoolExhaustedException under somewhat heavy traffic. Which parameters should I modify? Or is everything fine and I just need to go with a larger instance?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.