On Fri, Sep 18, 2009 at 4:45 PM, Peter De Berdt <[email protected]> wrote: > No it won't. It has randomization code that causes it to not run > _most of the time_. This is exactly how session gc should be handled. > It will ramp up proportionally with traffic. > > Actually that could be never or always, relying on random numbers to make > decisions on whether to do something "most of the time" is a bad idea.
No it's not. It's not relying on random numbers in the sense you are implying. The random numbers are just a way to implement a mod percentage, as in not doing it "most of the time". Look at the way PHP does session garbage collection for example. You set a callback function that only works _some of the time_. http://us.php.net/manual/en/function.session-set-save-handler.php http://us.php.net/manual/en/session.configuration.php#ini.session.gc-divisor http://us.php.net/manual/en/session.configuration.php#ini.session.gc-probability When using db driven sessions you don't want to clear out all the old sessions all of the time. You just want a rolling table setup that clears itself based on traffic flow. -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

