This post originated from an RSS feed registered with Ruby Buzz
by Kurt Schrader.
Original Post: Don't Forget to Clear Your Rails Session Data
Feed Title: Schrade.Blog
Feed URL: http://kurt.karmalab.org/atom.xml
Feed Description: Tech and Business Ramblings by Kurt Schrader
For the last year or so, this blog has been running slow, slow, slow.
From time to time, I tried to figure out what was going on, but I figured that Typo upgrades were just causing things to slow down and use more and more memory.
Until tonight.
Tonight I did a database dump and it came to 44 MB.
There is no way I have 44 MB of content in this blog.
So I had a look at the dump and realized that I had close to 100000 sessions in the sessions table, and there was a table for Sitealizer plugin that's no longer part of typo.
So after a quick drop of the Sitealizer table and a
rake db:sessions:clear
Typo is now using 20% of the memory it was using before, running much, much faster, and a database dump comes to a slim 476 KB in size.
So this is my reminder to myself (and everyone else) to be sure to clear out your sessions table from time to time.