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 ?
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.
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.
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.
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).