Thread Like Summary
isaac
Total Likes: 2
Original Post (Thread Starter)
by DanielH
DanielH
Hi,
we use 7.7.3, and since some days we get database errors "The table 'ubbt_ONLINE' is full". So I emptied the table as suggested in other posts. But I can watch the table grow. My understanding is that there is an algorithm that deletes the entries that are older than [actual time - online time] (function clear_online() in libs/ubbthreads.inc.php):

PHP Code
function clear_online() {
	global $dbh, $config, $html;

	// Delete the inactive users
	if (!isset($config['ONLINE_TIME'])) {
		$config['ONLINE_TIME'] = 10;
	}

	$Outdated = $html->get_date() - ($config['ONLINE_TIME'] * 60);
	$query = "
		DELETE FROM {$config['TABLE_PREFIX']}ONLINE
		WHERE ONLINE_LAST_ACTIVITY < ?
	";
	$dbh->do_placeholder_query($query, array($Outdated), __LINE__, __FILE__);

} 


I have set the "ONLINE_TIME" to 2 minutes. But the table entry with the oldest date in ONLINE_LAST_ACTIVITY has "1696835913", which is 5 hours ago counted from now. Why don't get these old entries deleted?

When is clear_online() triggered? It seems as if it won't be triggered or the variable $Outdated has a bad value.


What I've seen is that we have a lot of visits from a spider:
Mozilla/5.0 (Linux; Android 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Mobile Safari/537.36 (compatible; Bytespider; spider-feedback@bytedance.com)
This is the reason for the fast growing, but nevertheless old entries should be deleted.


Thanks in advance for some hints...

Daniel
Forum: www.gefahrgut-foren.de


EDIT: I just saw that automatic deletion is working. But one question still remains: What is the trigger for the automatic deletion?
Thanks!
Liked Replies
by Gizmo
Gizmo
Quote
When is clear_online() triggered? It seems as if it won't be triggered or the variable $Outdated has a bad value.
clear_online (deleting inactive users from the _ONLINE table) is triggered:
When the Cache is cleared
When a post is added
When a user logs out
When the who's online page is accessed
When debugging is turned on and the My Cookies page is accessed


I would advise you take the official fix (the v8 approach) here and set the _ONLINE table to NOT be a memory table and instead write to the disk, more information can be gleaned here.
1 member likes this
by DanielH
DanielH
Now I understand the problem: When the table is full (DDoS attack or a big number of crawlers), a DB error is thrown and users can't access any page. Which means, that none of the triggers won't be activated.

I've changed the ENGINE type to MyISAM now. So I think this problem will no longer occur!

Thanks a lot,
Daniel
1 member likes this
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Version 7.7.5 Images suddenly not displaying
by Stovebolt - 05/04/2024 11:19 AM
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Who's Online Now
2 members (ahmed047, Nightcrawler), 558 guests, and 167 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)