unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Unicorn behaving irrationally in production after a day
@ 2013-05-10 13:00 Bogdan Dumitru
  2013-05-10 14:19 ` Daniel Condomitti
  2013-05-10 14:33 ` Aaron Suggs
  0 siblings, 2 replies; 3+ messages in thread
From: Bogdan Dumitru @ 2013-05-10 13:00 UTC (permalink / raw)
  To: mongrel-unicorn@rubyforge.org

Hey guys,

I'm new to Unicorn and have been running into a weird issue. I'm currently running a EC2 cluster with each machine having nginx with 4 unicorn workers. I'm deploying using rubber (https://github.com/rubber/rubber), and the unicorn.rb config is basically the GitHub unicorn config (as detailed here: https://github.com/blog/517-unicorn).
Everything works fine when I deploy, but after half a day - 1 day the server behaves irrationally. The server is an api server for a mobile application so I can easily see some variables that, on request, have a certain value, but if I do some checking with the rails console (on the production machine) I get  a different value (the correct one). This seams to me like a weird object caching situation. It all gets solved if I restart unicorn.
I'm not sure what config information you guys might be interested in so I won't bloat this mail with anything but let me know if there's any questions I can answer.

I hope somebody can point me in the right direction because I can't really make heads or tails of it.
Cheers,
-b

PS: I've read about something similar happening when using memcached for object caching, in a previous version, but that isn't the case here.

_______________________________________________
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: Unicorn behaving irrationally in production after a day
  2013-05-10 13:00 Unicorn behaving irrationally in production after a day Bogdan Dumitru
@ 2013-05-10 14:19 ` Daniel Condomitti
  2013-05-10 14:33 ` Aaron Suggs
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Condomitti @ 2013-05-10 14:19 UTC (permalink / raw)
  To: unicorn list

Are you disconnecting from/reconnecting to your database and any cache
stores in the before and after_fork hooks? Sharing the socket across
workers can potentially cause issues like this.

On May 10, 2013, at 6:00 AM, Bogdan Dumitru <dumbogdan@gmail.com> wrote:

> Hey guys,
>
> I'm new to Unicorn and have been running into a weird issue. I'm currently running a EC2 cluster with each machine having nginx with 4 unicorn workers. I'm deploying using rubber (https://github.com/rubber/rubber), and the unicorn.rb config is basically the GitHub unicorn config (as detailed here: https://github.com/blog/517-unicorn).
> Everything works fine when I deploy, but after half a day - 1 day the server behaves irrationally. The server is an api server for a mobile application so I can easily see some variables that, on request, have a certain value, but if I do some checking with the rails console (on the production machine) I get  a different value (the correct one). This seams to me like a weird object caching situation. It all gets solved if I restart unicorn.
> I'm not sure what config information you guys might be interested in so I won't bloat this mail with anything but let me know if there's any questions I can answer.
>
> I hope somebody can point me in the right direction because I can't really make heads or tails of it.
> Cheers,
> -b
>
> PS: I've read about something similar happening when using memcached for object caching, in a previous version, but that isn't the case here.
>
> _______________________________________________
> 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
_______________________________________________
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: Unicorn behaving irrationally in production after a day
  2013-05-10 13:00 Unicorn behaving irrationally in production after a day Bogdan Dumitru
  2013-05-10 14:19 ` Daniel Condomitti
@ 2013-05-10 14:33 ` Aaron Suggs
  1 sibling, 0 replies; 3+ messages in thread
From: Aaron Suggs @ 2013-05-10 14:33 UTC (permalink / raw)
  To: unicorn list

Unicorns are mythical creatures that always behave rationally. :)

This sounds like a bug in your application rather than unicorn. Are you using :memory_store as your Rails.cache? That would fit the symptoms you're describing, since the cache would not be shared across processes.

If so, the solution is to use a shared cache store, like memcache (or the file system cache while you're on a single server).

On May 10, 2013, at 9:00 AM, Bogdan Dumitru <dumbogdan@gmail.com> wrote:

> Hey guys,
> 
> I'm new to Unicorn and have been running into a weird issue. I'm currently running a EC2 cluster with each machine having nginx with 4 unicorn workers. I'm deploying using rubber (https://github.com/rubber/rubber), and the unicorn.rb config is basically the GitHub unicorn config (as detailed here: https://github.com/blog/517-unicorn).
> Everything works fine when I deploy, but after half a day - 1 day the server behaves irrationally. The server is an api server for a mobile application so I can easily see some variables that, on request, have a certain value, but if I do some checking with the rails console (on the production machine) I get  a different value (the correct one). This seams to me like a weird object caching situation. It all gets solved if I restart unicorn.
> I'm not sure what config information you guys might be interested in so I won't bloat this mail with anything but let me know if there's any questions I can answer.
> 
> I hope somebody can point me in the right direction because I can't really make heads or tails of it.
> Cheers,
> -b
> 
> PS: I've read about something similar happening when using memcached for object caching, in a previous version, but that isn't the case here.
> 
> _______________________________________________
> 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
_______________________________________________
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:[~2013-05-10 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-10 13:00 Unicorn behaving irrationally in production after a day Bogdan Dumitru
2013-05-10 14:19 ` Daniel Condomitti
2013-05-10 14:33 ` Aaron Suggs

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

	https://yhbt.net/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).