After a few months, my web app was running increasingly slower. The statistics said that the SQL statement with the slowest response time is the one than gets the user session info.
I’m using the ActiveRecord session storage. The problem is Rails doesn’t delete old session records, so there were more than 200.000 in the table. I’ve decided to keep only the last week records, adding the following cron task:
Problem solved by now.