# Two rails questions

**URL:** <https://www.ruby-forum.com/t/two-rails-questions/74047>\
**Category:** Ruby\
**Created:** [October 29, 2006, 2:36pm UTC](https://www.ruby-forum.com/t/two-rails-questions/74047 "2006-10-29T14:36:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![simplydope](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d26b3c/32.png) [@simplydope](https://www.ruby-forum.com/u/simplydope)\
**Post date:** [October 29, 2006, 2:36pm UTC](https://www.ruby-forum.com/t/two-rails-questions/74047/1 "2006-10-29T14:36:49Z")

</div>

Hi guys,

I’ve been trying to work out answers to the following problems for hours  
but have reached the limit of my ruby knowledge! Any help will be  
massively appreciated:

1. When deploying a rails app to a web server (lightHTTP) and a FastCGI  
server with say 20 processes, do each of the processes run their own  
ruby instance? The reason I ask is using Globalize ruby (great package  
btw) accesses Local.set() which is a class method. Therefore if  
requests intertwine (can’t happen with threads as they don’t occur in  
ruby but could if processes running on same ruby instance?) users  
Locales will get messed up.

2. Depending on the user logged in will depend on the database where  
their data is stored (different physical machine). How can I get a  
rails model to realize this? Using an ApplicationController I can  
connect to the correct database (we know the number in the session), but  
this causes a new connection on every request - not exactly efficient.  
Ideally I’d like connections to all the user clusters established and  
the model just uses the one it requires.

Thanks in advance for any help,

George
