search for: allow_concurrency

Displaying 20 results from an estimated 70 matches for "allow_concurrency".

2006 May 12
5
How is Actionpack is not thread-safe? @@allow_concurrency?
...# Controls whether the application is thread-safe, so multi-threaded servers like WEBrick know whether to apply a mutex # around the performance of each action. Action Pack and Active Record are by default thread-safe, but many applications # may not be. Turned off by default. @@allow_concurrency = false cattr_accessor :allow_concurrency @@allow_concurrency is apparently only used in caching.rb, which makes sense... Anyway - I am working on an app that needs to preserve state from request to request, so I can''t have multiple processes to allow for concurrency; it has to be do...
2006 Aug 18
1
Ezra....allow_concurrency = false?
...il you wrote this: Glad you''re getting some use out of the plugin ;) ActiveRecord does have some issues with threading and concurrency that can sometimes cause that error you are seeing. Open up your script/backgroundrb/ start file and comment out the following line: ActiveRecord::Base.allow_concurrency = true Make sure you do that up in your main app script folder and not in the plugin. Well you can do it in the plugin as well to keep it consistent. Then you need to restart the drb server. Give this a shot and see if it gets rid of your problem. Also I am curious about using this plugin on text...
2006 Aug 26
0
postgres-pr barfs at ActiveRecord::Base.allow_concurrency = true
...9;' for #<PGconn:0x22ed648>: You are using the postgres-pr adapter which does not seem to support async_query. You need to install the compiled postgres db adapter wich can be found here: http://rubyforge.org/projects/ruby-postgres/ Or alternatively you could set ActiveRecord::Base.allow_concurrency to "false" in your backgroundrb start script. Though this could have adverse side effects. Thought this might be helpful to others in the future. Best, Tim
2008 Jan 23
0
allow_concurrency
I see that allow_concurrency is set to false by default. What are the risks and what can I eventually gain by setting it to true in terms of application speed ? TIA, ngw --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk&...
2007 Mar 05
3
postgres barfage revisted
...ostgres causes Backgroundrb to crap out with messages like this: ActiveRecord::StatementInvalid: NoMethodError: undefined method `async_query'' for #<PGconn:0x22ed648>: The author''s suggested solutions were to either use the compiled ruby-postgres, or set ActiveRecord::Base.allow_concurrency to false in a start script. Well, the first option seems tricky to me; I haven''t succeeded in getting that compiled for Mac OS X yet (granted, I haven''t given it too much effort yet), so I figured I''d try the second option. I couldn''t find any start script whe...
2006 Aug 10
2
Software caused connection abort
Hi Zed or anyone that is also looking at Mongrel, Just want to report something that, although doesn''t crash mongrel, is rather annoying. I am running the latest Mongrel 0.3.13.3 - ruby version on cygwin (yeah, poor me). When I start mongrel_rails with ActiveRecord::Base.allow_concurrency = true in environment.rb, I see a lot of "Error sending file /cygdrive/c/[snipped]/[default java scripts].js : Software caused connection abort" While these don''t cause any harm, they are concerning... Also, I see the following error more often as well: Lost connection to M...
2006 Jul 06
6
Mutex::Synchronize with backgroundrb
I have a question concerning where to use the synchronize function. The point of it is to put all of the code blacks passed to this function in a queue. This make sure that code gets ran one at a time. This is required when doing any kind of database activity in backgrondrb and multiple threads. Otherwise I lose the connection to my database. So here is my question: Do I need to do: @lock =
2007 Sep 03
11
MySQL has gone away
Hi, in a production environment we are running into "MySQL server has gone away" errors (see below) when we call rebuild_index in aaf. This happens sporadically. Any suggestions for what might be wrong or workarounds? I guess we try a reconnect before we call rebuild_index? Matthew ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone away: SELECT count(*) AS
2006 May 28
5
Rails, ActionController::Base.allow_concurrency and mongrel
Hello all, Are you aware of the rails ActionController::Base.allow_concurrency option ? If this option is true, rails is able to process simultaneous multiples actions. It appears that rails is thread-safe (if the user application is), and that this option is mostly unknown. Webrick take care of this option in rails-1.1.2/lib/webrick_server.rb at line 80 : REQUEST_MUTEX....
2006 Mar 30
4
Upgrading to 1.1 causes MySQL Lost Connections under WinXP
Ok so I updated my rails to version 1.1 and now all of a sudden I keep getting the dreaded "Mysql::Error: Lost connection to MySQL server during query: SHOW FIELDS FROM ..." I''ve read all the stuff on the net, but none of it is working. I tried installing the mysql.so like suggested here: http://wiki.rubyonrails.org/rails/pages/HowToUseMySQLRubyBindingsOnWin32/ That sort
2008 Jan 15
6
SQLite concurrency, SQLite3::BusyException
I am currently experiencing concurrency issues after moving from MySQL to SQLite. My original program worked fined using MySQL but is now returning "SQLite3::BusyException" errors. The same result happens whether or not I enable the allow_concurrency flag. If I do manually acquire a lock on the SQLite DB the problem would disapear, but I thought that rails was supposed to handle this internally (optimistic locking?) For example the following code (shortened for clarity purposes) caused no exception with MySQL but would not run with SQLite. Is...
2006 Jun 05
3
Mongrel Pre-Release 0.3.13 -- Katana Suicide Concurrency
...new send_file and upload to tempfile works on win32. More tests with big files uploaded on win32 are needed. * Lots of documentation on installing, with more to come. Full Apache documentation and information on writing your own snazzy handlers and filters. * Fran?ois SIMOND suggested a check for allow_concurrency and to avoid locking Rails if that''s set to true. I tried it, had to change the patch but I left it in. Read below. * Moved some of the "change to user/group" code around so that any Mongrel command can use it. * Various code clean-ups and big improvements on the unit test cove...
2006 Jul 11
32
Database Concurrency Without a Web Server?
My Rails application requires a very busy worker process running in the background at all times. I am launching this non-interactive process using script/runner. This process is very busy and is communicating with the MySQL server constantly. As I started putting some load on the system to test, I started running into performance issues. I have since discovered that Rails is only using 1
2006 Aug 17
1
Worker pool worker for page scanners: lost connection to mysql
Hello, I want to scan many URLs simultaneously with a new scanner worker for each URL, but I keep getting Mysql::Error: Lost connection to MySQL. Yes, allow_concurrency=false. Each scanner thread needs access to my ActiveRecord models to store discovered feeds and whatnot. There is a DB table called page_scans that acts as a big queue holding URLs waiting to be scanned. It would be nice to run a worker that spawns up to 10 scanner workers at a time to chi...
2006 Jul 07
3
ActiveRecord thread-safety
Hi, I want to use ActiveRecord outside Rails. The application is multithreaded, so database access has to be thread-safe. I read in a few places ActiveRecord in fact should be thread-safe and I gave it a try, but my findings indicate ActiveRecord is NOT thread-safe. The following test-script fails every with a lost MySQL-connenction: require ''rubygems'' require_gem
2006 Jan 24
3
what this line means exactly? (@@active_connections ||= {})
Hi, I have problem to understand this line does exactly? this is from the class ConnectionSpecficication, methode "active_connections" def self.active_connections #:nodoc: if allow_concurrency Thread.current[''active_connections''] ||= {} else @@active_connections ||= {} end end what the line "@@active_connections ||= {}" means exactly? as I undertands is if the class varaible @@active_connections has a value then return the value, otherwise return...
2006 Jul 31
1
MySQL too many connections?
Does any have any idea why I would get: Mysql::Error: Too many connections I am creating new threads in my background process. I know allow_concurrency is set to true. Does this create a new database connection when a new thread is created? Because what I''m doing is similar to this: @threads[model.id] = Thread.new do end I also kill off these threads and over write some of the @threads keys. Does it clean up the connections for m...
2006 Aug 07
1
:load_rails
if CONFIG[''load_rails''] ActiveRecord::Base.allow_concurrency = true ActiveRecord::Base.establish_connection(YAML.load(ERB.new(IO.read ("#{RAILS_ROOT}/#{CONFIG[''database_yml'']}")).result)[CONFIG[''environment'']]) end if i read the code right, this option doesnt really load rails. wouldnt it be better (for those...
2006 Oct 24
1
Broken thread Safe connection Management on Mysql (Mysql too many connections errors)
...del.find I.E.) - open a console and launch the work 100+ times, an exception will be raised ''too many connection''. The whole system won''t be able to use mysql anymore as mysql socket are not closed In my humble opinion there are two reasons for it: - ActiveRecord::Base.allow_concurrency = true That will make every thread open it''s own socket to mysql - Mysql adapter implementations (RAILS or gems) that close connection on Garbage connexion (using ObjectSpace.define_finalizer ) There is probably a memory leak on connections as the Proc finalizer is not be executed whe...
2013 Oct 20
2
optimize la value of pool in database.yml
...ils 3, ruby 2, postgres, elasticsearch, unicorn, nginx My server : 12 coeurs 24 threads ( I dont know if it is necessary for define pool value) unicorn : worker_processes 24 I have around 1500 pages requested per minutes, and around 200ms per request Is it also useful/necessary to use this ? allow_concurrency: true thanks -- 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 po...