Server issue Spam cleaner fails to execute on a large number of posts

DragonByte Tech

Well-known member
Affected version
2.2.2
Currently, our site is being attacked by spammers that post an obscenely large amount of posts and immediately delete the posts. When searching for their posts, they have 7 pages á 20 posts per page.

Attempting to run the spam cleaner on this amount of posts not only fails to work, but also crashes PHP-FPM or Apache, needing a restart of these services in order to restore site functionality.
 
I don't know, there was only a MySQL "table lock wait timeout exceeded" in the error logs. There were no PHP-specific errors in the logs.

I have a LOT of this on my server. And it's a fully dedicated one. A very powerful machine. But try to run the Spam Cleaner for users who have more than 1k posts or more. It's a mess. Turn down my entire site.

When i open the support thread for this exactly problem, the answer given was that my server had bad configuration or some thing about that.

Maybe is a way to sell the Elastic Search. Should help. But i really don't have money for this, and some others forums system, the ES is provided for free.
 
I have a LOT of this on my server.
You shouldn’t; that sounds like a bad add-on and is probably unrelated unless it’s exclusively a result of the spam cleaner.

Maybe is a way to sell the Elastic Search. Should help.
You’re not going to hit a deadlock without a write somewhere, so ES won’t help.

There were no PHP-specific errors in the logs.
Are you able to monitor it in htop/top to see whether it’s memory?
 
You shouldn’t; that sounds like a bad add-on and is probably unrelated unless it’s exclusively a result of the spam cleaner.
You’re not going to hit a deadlock without a write somewhere, so ES won’t help.

I have the impression that the deadlock error happens when i try to find (for deleting) very old posts, like one year or more, that's why ES was my first thought.

Yes, it shoudn't happen and i need a proper hosting company for my XF. My database doesn't seen to be corrupted in any way.
 
I have the impression that the deadlock error happens when i try to find (for deleting) very old posts, like one year or more, that's why ES was my first thought.
Unfortunately, ES can't be used in that scenario. When you're fetching data for use during modification, XF can't rely on ES to provide a consistent view of the database. ES is only used for read-only operations, meaning that there has to be no intend to mutate the data in any way (deletions included). This is tangential to the issue for which this thread was created, though; I think the similarities are largely superficial, and you either have a configuration issue or a bad add-on. It could be an issue with how XF utilizes transactions, but it's unlikely to be related to the spam cleaner issue.

After talking to a few people, it sounds like the issue at play here is just that the spam cleaner is meant to remove relatively new accounts without much content. It doesn't attempt to queue or batch the operation. It'll just load all the data into memory in one shot and work from there. When used on accounts with a lot of content, it's going to break.
 
As it stands, I don't think there's really much to change here. The spam cleaner is designed to only deal with a certain amount of content, which is part of the reason why there are limits in the options (though also to prevent triggering it on legit users). Any change to approach here would be really fundamental and not something planned at this time.

Really deleting around ~100 posts should go through, though it may take a fair amount of time as there can be a fair amount of work cleaning that up. There are a lot of variables based on server configuration though. There's no reason any of this should cause a crash of PHP/the web server. If it does, that certainly feels like some sort of cascading failure style-issue, potentially related to increased load.
 
As it stands, I don't think there's really much to change here. The spam cleaner is designed to only deal with a certain amount of content, which is part of the reason why there are limits in the options (though also to prevent triggering it on legit users). Any change to approach here would be really fundamental and not something planned at this time.

Really deleting around ~100 posts should go through, though it may take a fair amount of time as there can be a fair amount of work cleaning that up. There are a lot of variables based on server configuration though. There's no reason any of this should cause a crash of PHP/the web server. If it does, that certainly feels like some sort of cascading failure style-issue, potentially related to increased load.

Dear Mike,

Thanks for the explanation about the Spam Cleaner. I really don't have to much problems on deleting ~100 posts, but...

But even if i not use the Spam Cleaner option, when i have to delete some very old posts, i get the same errors and issues on that.

I already contracted some 'specialists' to fine tune my server settings, and the problem persists. I have a medium-big Forum, and many users try to delete some very old posts and get this error.

Is a very old issue for me, and i already switched my hosting companies like 3 times and the problem still persists, even with a fully dedicated server.
 
Top Bottom