I have a few Pylons applications that share a SQL access log routine.
Yesterday I migrated it from MySQL to PostgreSQL, and I'm getting a
bunch of errors like this:

>>  connection = self.contextual_connect(close_with_result=True)
Module sqlalchemy.engine.base:1229 in contextual_connect
>>  return self.Connection(self, self.pool.connect(), 
>> close_with_result=close_with_result, **kwargs)
Module sqlalchemy.pool:142 in connect
>>  return _ConnectionFairy(self).checkout()
Module sqlalchemy.pool:304 in __init__
>>  rec = self._connection_record = pool.get()
Module sqlalchemy.pool:161 in get
>>  return self.do_get()
Module sqlalchemy.pool:631 in do_get
>>  raise exc.TimeoutError("QueuePool limit of size %d overflow %d reached, 
>> connection timed out, timeout %d" % (self.size(), self.overflow(), 
>> self._timeout))
TimeoutError: QueuePool limit of size 5 overflow 10 reached,
connection timed out, timeout 30

I assume this means I should set ``create_engine(pool_size=,
max_overflow=)`` to some large number. But what would be a good
starting point if it's currently at the default?  25? 50?  The sites
are like this:


Site #1: Highest traffic.  Failing at 6 requests/minute according to
the error reports in my inbox. Using Postgres only for the stats, but
soon will be using it for site stuff too (which is working fine with
SQLite).

Site #2: Second-highest traffic. Using Postgres both for the stats and
the site. No problems seen yet.

Site #3: The most critical site, but moderate traffic. Using
PostgreSQL for both the stats and the site. One user complaint.

Site #4: Small site, little used. Using PostgreSQL only for stats.

Each site has a separate engine for its site stuff and for the stats
(so one or two engines per site, going to different databases).

For now I'm going to set 'max_overflow=15' and see if that fixes it.

-- 
Mike Orr <sluggos...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to