vishakhasa-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2013-Apr-24 11:41 UTC
URGENT:Rails application crashed for 700 request per minute.
Hi, We have our rails application running on AWS. we have two application servers and one database(postgres) server of C1.xlarge <http://aws.amazon.com/ec2/instance-types/> AWS instance type. Our passengermaxpoolsize is set to 30. And postgresql max connection limit is 100. Recently we found that when we got nearly 700 request per minute, our application created nearly crossed the max connection limit of postgres server and our application server went into waiting state and utilized nearly 100% of CPU and RAM. Can anyone guide us what might be cause of this crash? How rails processes using the connection pool configuration? Regards, -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/w6lA93AfSHMJ. For more options, visit https://groups.google.com/groups/opt_out.
Matt Jones
2013-Apr-25 17:08 UTC
Re: URGENT:Rails application crashed for 700 request per minute.
On Wednesday, 24 April 2013 07:41:23 UTC-4, visha...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org wrote:> > Hi, > > We have our rails application running on AWS. we have two application > servers and one database(postgres) server of C1.xlarge > <http://aws.amazon.com/ec2/instance-types/> AWS instance type. > Our passengermaxpoolsize is set to 30. And postgresql max connection > limit is 100. > Recently we found that when we got nearly 700 request per minute, our > application created nearly crossed the max connection limit of postgres > server and our application server went into waiting state and utilized > nearly 100% of CPU and RAM. > > Can anyone guide us what might be cause of this crash? How rails processes > using the connection pool configuration? > >There''s a ''pool'' setting you can put in database.yml (alongside the DB adapter, etc) to set the number of connections in the pool. By default it''s 5, so that would explain the crash - 30 Passenger workers x 5 connections per worker = more than 100. You may just want to bump the number up in Postgres. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Ha-Fa1ET8icJ. For more options, visit https://groups.google.com/groups/opt_out.