Re: Stucks DB connections

2014-02-24 Thread Eric Wong
Ilya Bazylchuk ilya.bazylc...@gmail.com wrote:
 Hey Guys,
 
 We have problems with DB connection in unicorn. When workers work some
 hours we see in Postgres activity stucks connections with query
 COMMIT. After restart unicorn it work fine some time, then
 connections stucks again.
 
 database.yml
 
 adapter: postgis
 postgis_extension: true
 schema_search_path: public,postgis
 encoding: utf8
 pool: 5
 checkout_timeout: 10
 
 unicorn 4.8.2
 pg 0.17.1
 rails 3.2.17

I'm not familiar with postgis.  Is there any sort of idle timeout on the
database side?  Is this high or low traffic when things get stuck?

I think the postgis/pg adapter guys might be able to help, too, since
unicorn doesn't do anything with the DB connections itself.

Some generic, DB-independent thoughts/questions:

Sometimes, tiny socket buffer sizes with the DB connection might hit this.
Any non-standard kernel/socket knobs or tuning?

Also, if running Linux, which kernel version are you running?  If it's
3.7, make sure commit 8fb74b9fb2b182d54beee592350d9ea1f325917a
(mm: compaction: partially revert capture of suitable high-order page)
got backported.
___
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


Re: Stucks DB connections

2014-02-24 Thread Eric Wong
Ilya Bazylchuk ilya.bazylc...@gmail.com wrote:
 Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-40-virtual x86_64) without any changes.
 
 In resque, sidekiq we don't have this problems. Can be stuck
 connection, when unicorn reset request by timeout?

It could be stuck if your DB adapter times out and forget to
reset/rollback transactions on the connections.  Check with the DB
adapter developers.

Note: the internal timeout of unicorn isn't intended for DB failures,
that is a last resort.  Use the builtin timeout of the DB adapters.

(Btw, please keep the mailing list Cc-ed and don't top post)
___
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying