[Backgroundrb-devel] Impossible to get stable?

Michael Siebert info at siebert-wd.de
Sun Aug 20 03:36:07 EDT 2006


dbi and mysql is the basic layer of database access. its just a way to
connect to a db server and send a query. no modelous abstractions, no stuff
around, just tailor your sql like back in (good) old php days.
thats surely not the rails way and uncomfortable but it should give no
errors (except that your db only can handle a certain amount of connections)

2006/8/20, Ben Johnson <bjohnson at contuitive.com>:
>
> Hi Ezra,
> Thanks a lot for your help. Can you clarify what dbi is or mysql bindings?
> I am not sure what you are talking about.
>
> Thanks again for your help.
>
> Thank You,
> Ben Johnson
> E: bjohnson at contuitive.com
> O: 800-341-6826
> M: 817-229-4258
>
>
>
> On Aug 19, 2006, at 11:39 PM, Ezra Zygmuntowicz wrote:
>
>
> On Aug 18, 2006, at 6:20 PM, Ben Johnson wrote:
>
> I have concluded that it is impossible to get this background process
> stable. I am out of ideas and could really use some help.
> Here is what I have:
>
> 50 workers, just running an infinite loop that constantly calls save! on a
> model. Keep in mind this is just for testing purposes. I catch all
> exceptions and put them in the log.
>
> I am tried setting allow_concurrency to true and false. Neither of them is
> stable. For both true and false I have got the following errors:
>
> #<ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout
> exceeded; try restarting transaction:
>
> #<ActiveRecord::StatementInvalid: Mysql::Error: MySQL server has gone
> away:
>
> What have you found to be most stable? Setting allow concurrency to false
> and just putting a Mutex.synchronize object around all database calls? Or
> setting it true?
>
> Thank You,
> Ben Johnson
> E: bjohnson at contuitive.com
> O: 800-341-6826
> M: 817-229-4258
>
>
>
> Hey Ben-
>
> I feel your pain. I have come to the conclusion that ActiveRecord is just
> not thread safe no matter what you do. My best suggestion is to use either
> dbi or mysql bindings directly in your workers. These are thread safe and
> while you would have to write some sql yourself, it would solve your issue.
> I get the feeling that railscore is not very interested in making rails
> thread safe at this point and pushing as many db connections in as many
> threads as you are doing is more the ActiveRecord can handle.
>
> I know its not what you want to hear but its the situation we have to deal
> with.
>
> -Ezra
>
>
>
> _______________________________________________
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>
>


-- 
Michael Siebert <info at siebert-wd.de>

www.siebert-wd.de - Gedanken lesen
www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060820/ed5cf82a/attachment.html 


More information about the Backgroundrb-devel mailing list