Hi, I''m trying to setup rails 2.2.2 pool connections to MySQL by specifying the pool setting with 5 in database.yml but no hope.. It doesn''t work. My rails is running on webrick in the production mode and the webrick is launched by RadRails. Even though I send multiple requests to my app on rails at the same time, it seemed only one connection is shared ( pooled ). I also checked on MySQL with the command "show processlist" but only one connection was shown. Do I have to do something ?? or Rails on Windows cannot make multiple connections ?? thanks. syuji --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Mar 5, 2009 at 3:23 AM, syuji <syujik123-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I''m trying to setup rails 2.2.2 pool connections to MySQL by > specifying the pool setting with 5 in database.yml but no hope.. It > doesn''t work. > My rails is running on webrick in the production mode and the webrick > is launched by RadRails. > > Even though I send multiple requests to my app on rails at the same > time, it seemed only one connection is shared ( pooled ). > I also checked on MySQL with the command "show processlist" but only > one connection was shown. > > Do I have to do something ?? or Rails on Windows cannot make multiple > connections ?? > > thanks. > > syuji >What does you database.yml look like? Are you seeing any error messages in the logs? -Conrad --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Conrad Thank you for the reply. Here is my database.yml -------------------------------------------- production: adapter: mysql host: localhost port: 3306 pool: 5 encoding: utf8 username: testuser password: testpassword database: my_sample_app_production ------------------------------------------ I don''t see any errors in the logs. I get proper responses from MySQL but my problem is that Rails doesn''t pool *multiple* connections. I forgot to mention the version of Ruby I''m using. It''s 1.8.7. Is there any way to check how many connections are in pool ??? As I said earlier, I''ve checked with a "show processlist" command in MySQL console but I''m not sure that''s the best way or not. Thanks in advance. syuji On Thu, Mar 5, 2009 at 11:29 PM, Conrad Taylor <conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Thu, Mar 5, 2009 at 3:23 AM, syuji <syujik123-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> Hi, >> >> I''m trying to setup rails 2.2.2 pool connections to MySQL by >> specifying the pool setting with 5 in database.yml but no hope.. It >> doesn''t work. >> My rails is running on webrick in the production mode and the webrick >> is launched by RadRails. >> >> Even though I send multiple requests to my app on rails at the same >> time, it seemed only one connection is shared ( pooled ). >> I also checked on MySQL with the command "show processlist" but only >> one connection was shown. >> >> Do I have to do something ?? or Rails on Windows cannot make multiple >> connections ?? >> >> thanks. >> >> syuji >> > > What does you database.yml look like? Are you seeing any error messages in > the logs? > > -Conrad > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
In order to take advantage of connection pooling, you need an adapter that supports multithreading. The basic MySQL adapter doesn''t do that. Check out http://github.com/methodmissing/mysqlplus_adapter/tree/master for a pretty detailed walkthrough to set this up. On Thu, Mar 5, 2009 at 4:09 PM, syuji kaneko <syujik123-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, Conrad > > Thank you for the reply. > > Here is my database.yml > -------------------------------------------- > production: > adapter: mysql > host: localhost > port: 3306 > pool: 5 > encoding: utf8 > username: testuser > password: testpassword > database: my_sample_app_production > ------------------------------------------ > > I don''t see any errors in the logs. > I get proper responses from MySQL but my problem is that Rails doesn''t pool > *multiple* connections. > > I forgot to mention the version of Ruby I''m using. It''s 1.8.7. > Is there any way to check how many connections are in pool ??? > As I said earlier, I''ve checked with a "show processlist" command in MySQL > console but I''m not sure that''s the best way or not. > > Thanks in advance. > > syuji > > > > On Thu, Mar 5, 2009 at 11:29 PM, Conrad Taylor <conradwt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> On Thu, Mar 5, 2009 at 3:23 AM, syuji <syujik123-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> >>> Hi, >>> >>> I''m trying to setup rails 2.2.2 pool connections to MySQL by >>> specifying the pool setting with 5 in database.yml but no hope.. It >>> doesn''t work. >>> My rails is running on webrick in the production mode and the webrick >>> is launched by RadRails. >>> >>> Even though I send multiple requests to my app on rails at the same >>> time, it seemed only one connection is shared ( pooled ). >>> I also checked on MySQL with the command "show processlist" but only >>> one connection was shown. >>> >>> Do I have to do something ?? or Rails on Windows cannot make multiple >>> connections ?? >>> >>> thanks. >>> >>> syuji >>> >> >> What does you database.yml look like? Are you seeing any error messages >> in >> the logs? >> >> -Conrad >> >> >> >> > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---