Hi Dave,
Thank you for your quick answer, caught me totally unexpected
I checked config/environment.rb, to see where the server side of
sessions get stored:
Rails::Initializer.run do |config|
config.action_controller.session_store = :active_record_store
end
They get stored in the database. Then I logged into the database and
deleted all records of table sessions.
Browse o the domain and a session gets created.
I run a mongrel cluster of two, so I stopped one. Then it worked!
I started the second mongrel, this time doesn't flip not even after
the second click.
I tail the log files and no differences except for time:
With 1 mongrel:
domain.ie:
Processing AccountsController#change_locale (for x.x.x.x at 2008-05-03
10:19:36) [PUT]
Session ID: xxx
Parameters: {"_method"=>"put", "action"=>"change_locale",
"controller"=>"accounts", "locale"=>"en"}
Redirected to
http://domain.ie/
Completed in 0.00235 (425 reqs/sec) | DB: 0.00032 (13%) | 302 Found
[
http://domain.i/accounts/change_locale/en]
domain.ie:
Processing HomeController#index (for x.x.x.x at 2008-05-03 10:19:36)
[GET]
Session ID: xxx
Parameters: {"action"=>"index", "controller"=>"home"}
Rendering within layouts/application
Rendering home/index
Completed in 0.48042 (2 reqs/sec) | Rendering: 0.42136 (87%) | DB:
0.04836 (10%) | 200 OK [
http://domain.ie/]
With 2 mongrel:
domain.ie:
Processing AccountsController#change_locale (for x.x.x.x at 2008-05-03
10:20:16) [PUT]
Session ID: xxx
Parameters: {"_method"=>"put", "action"=>"change_locale",
"controller"=>"accounts", "locale"=>"en"}
Redirected to
http://domain.ie/
Completed in 0.19691 (5 reqs/sec) | DB: 0.01202 (6%) | 302 Found
[
http://domain.ie/accounts/change_locale/en]
domain.ie:
Processing HomeController#index (for x.x.x.x at 2008-05-03 10:20:17)
[GET]
Session ID: xxx
Parameters: {"action"=>"index", "controller"=>"home"}
Rendering within layouts/application
Rendering home/index
Completed in 0.09887 (10 reqs/sec) | Rendering: 0.07786 (78%) | DB:
0.01113 (11%) | 200 OK [
http://domain.ie/]
You can see that when it fails,the time it takes to complete the home
request is 5 times lower: 0.09887 versus 0.48042; also the PUT takes
100 times higher: 0.19691 versus 0.00235
Does this tells you something?
Dan