We switched to using Octopus for sharding in our rails2.3/postgresql/resque
app because we were maxing out the disk I/O of our database server. We have ten databases, each with multiple shards. (A shard includes a schema search path).
Some of our processes that work across multiple customers are very slow.
Here is the structure of the code:
User.each do |u|
Octopus.using(u.shard.to_sym) do
update data
end
end
We suspect that the issue is Octopus is constantly opening and closing database connections.
Is this how Octopus works? Can it keep a pool of database connections?