Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jul 2016
Posts: 3
Likes: 1
D
Stranger
Stranger
D Offline
Joined: Jul 2016
Posts: 3
Likes: 1
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!

Last edited by DanielH; 10/09/2023 8:52 AM.
Joined: Dec 2003
Posts: 6,630
Likes: 85
Joined: Dec 2003
Posts: 6,630
Likes: 85
If you changed it midstream.
From the CP select clear cache and that should clear it and get it back in sync with your new settings.
I know that new posts and logouts also should run that function.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 16,369
Likes: 126
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,369
Likes: 126
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.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
1 member likes this: isaac
Joined: Jul 2016
Posts: 3
Likes: 1
D
Stranger
Stranger
D Offline
Joined: Jul 2016
Posts: 3
Likes: 1
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

Last edited by DanielH; 10/10/2023 8:42 AM.
1 member likes this: isaac
Joined: Dec 2003
Posts: 6,630
Likes: 85
Joined: Dec 2003
Posts: 6,630
Likes: 85
that works but you still have the issue of ddos attacks which use up your bandwidth and make the site so slow it becomes a aggravation to the Normal users.
You need to circumvent the bad guys from attacking your site.
Some tools are robots.txt , htaccess or use cloudflare to name a few.

With ddos I have found they attack in waves.
So you think you have it under control and as soon as you let your guard down they attack again


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jul 2016
Posts: 3
Likes: 1
D
Stranger
Stranger
D Offline
Joined: Jul 2016
Posts: 3
Likes: 1
Ok thanks for your hints. I will check these. Luckily we still haven't been goal of a ddos attack...


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Profile avatar storage settings
by SenecaFlyer - 12/05/2024 1:24 PM
Not allowing attachment over 2m
by ehill - 12/03/2024 3:16 PM
New Admin Here
by SenecaFlyer - 12/02/2024 4:14 PM
Who's Online Now
2 members (Ruben, Gizmo), 788 guests, and 90 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.1
(Snapshot build 20240918)