unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Stucks DB connections
@ 2014-02-24 12:33 Ilya Bazylchuk
  2014-02-24 18:25 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Bazylchuk @ 2014-02-24 12:33 UTC (permalink / raw)
  To: mongrel-unicorn

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

unicorn use with nginx

Can you help with something?
_______________________________________________
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Stucks DB connections
  2014-02-24 12:33 Stucks DB connections Ilya Bazylchuk
@ 2014-02-24 18:25 ` Eric Wong
       [not found]   ` <17CD6ADE-9BBE-4989-B846-C9568F2D2973@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2014-02-24 18:25 UTC (permalink / raw)
  To: unicorn list; +Cc: Ilya Bazylchuk

Ilya Bazylchuk <ilya.bazylchuk@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Stucks DB connections
       [not found]   ` <17CD6ADE-9BBE-4989-B846-C9568F2D2973@gmail.com>
@ 2014-02-24 19:01     ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2014-02-24 19:01 UTC (permalink / raw)
  To: Ilya Bazylchuk; +Cc: mongrel-unicorn

Ilya Bazylchuk <ilya.bazylchuk@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-24 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 12:33 Stucks DB connections Ilya Bazylchuk
2014-02-24 18:25 ` Eric Wong
     [not found]   ` <17CD6ADE-9BBE-4989-B846-C9568F2D2973@gmail.com>
2014-02-24 19:01     ` Eric Wong

Code repositories for project(s) associated with this inbox:

	../../../unicorn.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).