|
Performance and a new moduleBy Markus Sandy at 06/02/2007 - 09:00
I have been manually cleaning out the sessions table for some time now. We get about 8000 records per hour and so it does not take long to reach several hundred thousand records. Things start to bog down then. The system becomes very slow, especially if we are displaying the "Who's online" block on the home page, which is something we like to do. Also, the query to delete old session records can take quite a while to perform (up to 18 minutes that I have seen). Now there is a setting in the sites/default/settings.php to control cleanup of session records, but this setting applies to all sessions and we like to leave the ones tied to authorized (logged in) users. There are various Drupal.org threads on this. For example, http://lists.drupal.org/pipermail/support/2006-July/003048.html and I had been thinking about setting up a hook_cron method to do this. Then I read this page: and I decided to go for it. I created a new module called ourmedia for site specific tasks like this and added the following method: <?phpTo do: tie the value to the setting for the "Who's online" block or at least provide access to the defaults inside of the Drupal admin settings. Links:
Comments and discussion: |
Recent comments
2 years 33 weeks ago
2 years 36 weeks ago
2 years 38 weeks ago
2 years 39 weeks ago
2 years 41 weeks ago
2 years 42 weeks ago
2 years 45 weeks ago
2 years 46 weeks ago