XF 2.1 xf_session_activity is full

developr

Active member
After a few days I get an error xf_session_activity is full and then the forum isn't working.

Maybe because I set the parameter $config['pageCache']['recordSessionActivity'] = true; in config.php?

If I restart MySQL it solve the problem for few days.
 
I increased max_heap_table_size from 32M to 64M but the table is full after a few days and the errors is shown again.

Is there no cron do prune old sessions after a specific time? onlineStatusTimeout is set to 60 minutes.

I found threads with the same problem but without any solution:
 
Last edited:
I created a cronjob to truncate the table if the error is shown.

You have to edit "sitename" and "dbname".

Bash:
#!/bin/bash

cd /var/html/sitename/

if php index.php | grep -q "An error occurred while the page was being generated"
then
    # if the keyword is in the conent
    mysql -e 'truncate dbname.xf_session_activity'
    echo "xf_session_activity is full. truncate table."
fi
 
Why isn't that default solved by XenForo Team it self? I don't want to have the time right now to do some custom changes, for just keeping my site up. Right now I have to truncate the table by hand over phpmyadmin, which feels wrong and a very very dirty workarround for this kinda fundamental problem. Using a cronjob doesn't feel right nor like a undirty solving eighter.. is there nothing which I can acutally change? I mean like it is like having cancer and just treating the pain instead of the main cause of the problem? Or?
 
Back
Top Bottom