Solved: 1 Year, 10 Months, 3 Weeks ago 'mybb_sessions' in database is increasing rapidly after the update to 1.8.22
#4
Solved: 1 Year, 10 Months, 3 Weeks ago
If you can identify repetitive records for specific bots, try adding them in Configuration → Spiders / Bots → Add New Bot - e.g. User Agent String set to trendictionbot should match the one from your example.
These sessions should be limited to one record.

Otherwise, to make MyBB purge session records faster, you can create a custom task inc/tasks/clearsessions.php:
<?php

function task_clearsessions($task)
{
    global $db;

    $timeHours = 3;

    $cutoff = TIME_NOW - ($timeHours * 3600);

    $db->delete_query("sessions", "time < " . $cutoff);

	add_task_log($task, "The custom clear sessions task successfully ran.");
}

This would delete sessions that haven't been active for more than 3 hours. Once saved, you should be able to select the new file in Tools & Maintenance → Task Manager → Add New Task; with Time: Minutes set to 0 and the settings below unchanged, it would run every hour.
devilshakerz.com/pgp (DF3A 34D9 A627 42E5 BC6A 6750 1F2F B8AA 28FF E1BC) ▪ keybase.io/devilshakerz
Reply


Messages In This Thread
RE: 'mybb_sessions' in database is increasing rapidly after the update to 1.8.22 - by Devilshakerz - 2020-01-03, 11:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)