Excessive sessions

One of the negative side effects of using the classic monit /
mongrel_cluster stack with a URL poll by monit is that Rails generates a
session for every connection. This session is pretty much useless, and
in my case is detrimental to data mining of session activity.

At this point I am likely to look into the new mod_rails, but I am
wondering if there’s any possible way to have external monitors (be it
monit, load balancers, etc) ping a Rails page to verify service, and yet
not create a session? Due to number of apps & Rails instances, I end
up with 10’s of thousands of dummy sessions per day.

I can provide config setup details, if that’s necessary to determine
options, but essentially I have monit call upon a
/public/monit_check.txt file that has no content. this is apparently
enough to still trigger a session via application.rb ?

Rails 1.2.6, OS X Server 10.5.

Thanks.

– gw

Hi Greg

My approach with Monit and sessions was to create a specific
controller & action to poll, and turn sessions off for it.

http://pastie.textmate.org/188359

It does feel like overkill, mind you, and I’m a little surprised that
calling a static file (which is a more elegant solution) creates a
session.


Pat
e: [email protected] || m: 0413 273 337
w: http://freelancing-gods.com || p: 03 9386 0928
discworld: http://ausdwcon.org || skype: patallan

Pat Allan wrote:

My approach with Monit and sessions was to create a specific
controller & action to poll, and turn sessions off for it.
http://pastie.textmate.org/188359
It does feel like overkill, mind you, and I’m a little surprised that
calling a static file (which is a more elegant solution) creates a
session.

I figured something like that but wasn’t sure of the details to pare it
down to the bare essentials. Your code will help. Thanks, I’ll see if
that cures it.

– gw

Greg W. wrote:

One of the negative side effects of using the classic monit /
mongrel_cluster stack with a URL poll by monit is that Rails generates a
session for every connection. This session is pretty much useless, and
in my case is detrimental to data mining of session activity.

Take a look at
http://rails.lighthouseapp.com/projects/8994/tickets/92-feature-more-efficient-session-handling
and http://code.google.com/p/rails-fast-sessions/.

Greg, Pat,

Most people just use a cron job to clean up old sessions, we usually
set it up to run every 15 minutes, how long will you let your sessions
live is up to your business needs.

Take a look at:

http://railsexpress.de/svn/plugins/sql_session_store/trunk/

And remember that Rails 2 default session store is cookie.

I would recommend changing your front end (Apache, Lighttpd, Nginx)
configuration to serve directly the stuff under public/ without
passing the request to the backend rails processes (mongrels, thins,
etc).


Aníbal Rojas
http://hasmanydevelopers.com
http://rubycorner.com
http://anibal.rojas.com

On Apr 29, 5:35 pm, Greg W. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs