Welcome Guest, Not a member yet? Register   Sign In
Why does my session table have 40 million records?
#1

(This post was last modified: 07-23-2018, 06:06 PM by sneakyimp.)

I recently launched a site built on CodeIgniter. Today I learned that the session table has over 40 MILLION records in it. These are my session-related settings in the config file:
Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci-session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_session';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
The earliest session record dates from before our site launch and its ip corresponds to my ip address.

What's the issue here? It's my understanding that the CI Session class periodically garbage collects this table, but it does not appear to be working properly. This query says there are 549706 distinct ip addresses in that able:
Code:
SELECT COUNT(DISTINCT ip_address) FROM `ci_session`
Reply


Messages In This Thread
Why does my session table have 40 million records? - by sneakyimp - 07-23-2018, 05:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB