XF 2.2 Opps - problem - session_activity full

pattycake2

Active member
Licensed customer
I am getting the "Opps" message several imes a week and it essentially shuts the entire site down. Almost alwasy, the server log shows:
  • xf_session_activity' is full
Is there a cron entry to empty this table or perhaps an add-on that will prevent the site from ****ting down?
 
Is there a cron entry to empty this table
I haven't seen a cron specific to this. but you can truncate it manually from phpmyadmin.

or perhaps an add-on that will prevent the site from ****ting down?
I haven't seen such an add-on myself. You can request one though at the Add-on requests board.

Most likely this is being caused by bots that are crawling your forum like crazy which is causing the aforementioned table to max out. Personally I would advice, if I may, to expand/increase the size of the mysql sessions table, but this is possible only if you run your own dedicated vps or dedicated box. If you are on a shared host you can't do that yourself.
 
truncate is the same as "empty" in phpadmin?
Yes, that's correct.
Is there a cron entry to empty this table or perhaps an add-on that will prevent the site from ****ting down?
Regarding this part, I can develop an add-on for you that will be of help to you with this situation. Provided you are willing to fund its development please feel free to hit me up in private with a dm. (direct message)
 
You are getting that message because you have too many visitors looking at your site within an hours time. Take a look at Members | Current Visitors. You will probably see thousands of visitors and most of them will be Guests or Bots. Known bots can sometimes be a problem but if you look at the Guests IP Addresses you will see a lot of them are amazon servers. Those are most likely AI training themselves on your forums. If you are only seeing 3 or 4 thousand guests then what you can do is increase the table size that Xenforo uses for the xf_session_activity table.

Add the below code to

/etc/my.cnf.d/server.cnf
After [mariadb]
This is what solved the problem for us.


Code:
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

#xenforo uses in-memory tables; default is 16M and these tend to fill up quick, so we need to boost their size. -DD26
tmp_table_size = 64M
max_heap_table_size = 64M
tmp_disk_table_size = 64M

Restart Mariadb after making this change.

Note this will not help (but you should still increase the size) if you are getting tens of thousands of guests visiting.

Second Note there is a Cron job that runs hourly. Mine runs at 10 after the hour every hour. If you run that job it will clean out the xf_session_activity table. This doesn't solve your problem but gives you a quick way to fix it until you change the sizes in the code.

1775956143746.webp
 
Back
Top Bottom