MongoDB, passenger and performance issues with fusion passenger

I just stumbled upon positioning in the mongodb user list, where the issue of passenger and forking when using mongoDB with MongoMapper was discussed.

I just wanted to remind you that Rails developers need to set up their 'environment.rb' if they use MongoDB with Passenger.

By default, Passenger starts Ruby processes with fork (). And, as fork () shares the file descriptors, the Rails application should resume the connection for MongoDB in a new new "process."

http://groups.google.com/group/mongodb-user/browse_thread/thread/f31e2d23de38136a

Does anyone know if there are still problems with mongoDB and the passenger, or what is the best way to service the mongoDB-rails application with the passenger?

+4
source share
1 answer

I think this โ€œproblemโ€ still exists, but I think that the fix was provided both in the stream you linked to (link in the first post) and in essence by John Nunemaker ( http: //gist.github .com / 232953 ).

I believe that the corresponding bit of information is in the following block of code that you put in the intializer:

if defined?(PhusionPassenger) PhusionPassenger.on_event(:starting_worker_process) do |forked| # if using older than 0.6.5 of MM then you want database instead of connection # MongoMapper.database.connect_to_master if forked MongoMapper.connection.connect_to_master if forked end end 
+1
source

All Articles