MODX Community

Modx_session table very large

I noticed that on some of my sites, the modx_session table is very large even after optimizing the table. Right now, one of my sites has a 14MB session table

Does anyone know if it is ok to empty this table?

Thanks.

14mb really isn’t much :wink: I’ve seen gigabytes on my own sites.

If you’re worried about the session data not keeping itself small, check the oldest session record in there. Grab the lowest value from the access column, convert that online to a timestamp, and see how old it is. If it’s older than, say a month or two, then your server might not have session garbage control enabled and it’s worth correcting that.

That said, yes, it’s safe to empty the sessions table. You’ll just cause everyone to be logged out and lose any session info.

Thanks markh! I was able to empty the table. I will look into the hosting’s session control status.

Cheers.

1 Like