Rails ActiveRecord w/ MySQL Hangs Once Connection Pool Limit is Reached

Unless specified, ActiveRecord fires up 4 default connections.

I've noticed if I reload a simple page, which makes at least one ActiveRecord call, 4 times every thing functions normal. However, on the fifth time, it hangs for almost 5 seconds. So, every 5th page load it hangs for 5 seconds.

I upped the default connection pool in my adapter to 8 and now it hangs every 9th page request. It seems like it doesn't reuse connections but instead kills them and regenerates them once the pool limit is reached.

I'm not actually using ActiveRecord with entire Rails stack.

Is there a magical ActiveRecord connection flag which prevents this from happening? Or, is there something else going wrong?

-------------Problems Reply------------

Hot damn that was easy...



Sure wish this was something you could configure so you don't have to call it every time.

Category:ruby on rails Views:3 Time:2009-10-22

Related post

  • MySQL and JDBC Connection Pool: unclosed statements 2011-03-02

    I am reviewing a big pile of existing code, trying to find unclosed connections that would cause the connection pool to run out or throw other erros. In some places I see the connection is returned to the pool, the ResultSet is closed, but the Prepar

  • Logging with log4j in a mysql database using connection pool 2012-04-13

    I have implemented a connection pool from JDBC to get and close connections for my data access objects in order to store and retrieve data from a mysql database with java. I also wanted to store the main operations and exceptions in the database with

  • Connection pooling/limit for SQL Server and Linq-to-SQL 2011-06-24

    I found this article regarding Linq-to-SQL and SQL Server connection pooling: MSDN Blog From what I assume from the article, is that Linq-to-SQL using the same Max Pool Size setting just as if it was an ADO object. I have an C# app that is hitting th

  • MySQL .Net connection pool connection.Open() very slow 2011-12-28

    Version 6.4.4: Using the most basic implementation of MySqlConnection, the following code takes 2-5 seconds per connection when preloading the connection pool to reach the "Min Pool Size" configured in my connection string. Any ideas why it is taking

  • Do MySql Connector J JDBC drivers not support connection pooling? 2010-07-14

    Does Connector J really not support connection pooling. Looking at their documentation I have to download a 3rd party library such as DBCP or c3p0 to get this right. What is the motivation for not introducing it in the Connector J driver itself? Is t

  • node-mysql connection pooling 2011-07-18

    I am using node-mysql module (https://github.com/felixge/node-mysql) OR (http://utahjs.com/2010/09/22/nodejs-and-mysql-introduction/) . Is this API handling connection pooling as well? I mean with every user request I am calling Client.connect() to q

  • Multiple Rails app, single MySQL database 2010-04-22

    I intend to have multiple Rails apps each for site.com, api.site.com, admin.site.com. All apps will access the same tables from one single MySQL database. Apps and database runs in the same server. Is there any settings in Rails, ActiveRecord or MySQ

  • C3P0 connection pool tester is not called 2011-01-18

    I tried to check if connect is up or down to MySQL using C3P0 connection pool tester. It works if password is correct. But password can be changed and I need to let user know that there is no connection to MySQL. I want to understand why buildSession

  • .NET/ADO.NET: Detecting Connection Pool Limits 2010-02-26

    I am getting connection timeouts and I suspect they may be caused by a bug that is allowing me to exceed my connection pool limit. Is there a way to progamatically detect this? --------------Solutions------------- You can find this information and a

  • Why would moving our .NET /SQL Server website to a new host cause connection pool size to be exceeded? 2010-06-21

    We've recently moved our company website to a new host. It is an ASP.NET site with C# code behind, connecting to MS SQL server. Since moving the site to the new server, the site is exceeding the connection pool limit (which is not set explicitly, so

  • PHP: Managing Connection Pools in Object-Oriented Approach 2011-11-14

    I am currently using a combination of PHP, ORACLE, PDO, and JNDI to connect my application to the database. I am having trouble understanding the best approach to managing connection pools in an Object-Oriented approach. As a result, i'm getting max-

  • how to effectively share database connection objects from Connection pool in C#? 2011-11-18

    hi can anyone help me to find how to effectively share database connection objects from .net connection pool. Mine is a web appplication and i have to limit the connection pool size to a particlar number too(say 20 connections) .so that requests from

  • Ruby, MySQL: Connection pool that is outside of the rails framework? 2010-04-10

    Is there a ruby gem or such for MySQL connection pooling that isn't part of rails? I simply have a ruby script (again, I don't do anything with rails). --------------Solutions------------- Seamless Database Pool is supposed to work "with any ActiveRe

  • Rails/MySql - amount of database connection pool 2011-09-17

    What is the recommended amount of connection pool to a MySql DB on a Rails 2.3.8 application, to my understanding the default is 5, is this enough? --------------Solutions------------- There's no way to answer that question w/o more information. What

  • Spring3+Hibernate+Tomcat7+MYSQL connection pooling causes app to hang 2011-10-02

    I recently set up connection pooling in tomcat and notice both in the test env and in my dev env that after the app runs for say 12 hrs my app hangs. Digging a bit I notice that it hangs at the first db operation. On my dev env I get an SQLException

  • How does the rails connection pooling work? 2011-02-27

    I'm running a rails 2.3.5 application, which supports me to pool mysql connections to my database. But I remember reading that my mongrel servers are single threaded. What's the point of having a connection pool, to a single threaded application? Is

  • Is there any reason to use a database connection pool with ActiveRecord? 2011-04-28

    What are the benefits to using an external connection pool? I've heard that most other applications will open up a connection for each unit of work. In Rails, for example, I'd take that to mean that each request could open a new connection. I'm assum

  • Really need a db connection pool for unicorn rails? 2011-12-29

    I can't find any document describing database connection pooling effect for unicorn. Unicorn forks several worker processes. I configured prefork and it's critical not to share database connections between workers, so I reset db connections after for

  • Rails 3 DB connection pool - connections not closing 2014-03-19

    Stack is Rails 3 / Postgres + mongrel. I recently had to increase the connection pool because hits on one of the mongrels were always timing out. I reasoned that with 3 mongrels + a delayed_job running on each, I'd need 6 connections in the pool (it

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.077 (s). 11 q(s)