PDA

View Full Version : Board Optimization - FractalizeR: Search limits


FractalizeR
06-29-2009, 10:00 PM
Introduction
Some time ago I received several messages from my server about database error. They are described here (http://www.vbulletin.com/forum/showthread.php?t=309233). It looked like malicious server overload or hack attempt. It seemed to me like some hacker found the way to flood my server with expensive queries. Some time after I found the reason (http://www.vbulletin.com/forum/project.php?issueid=28376).

This is not an engine bug, at least it doesn't look like one. But until devs will make a decision (I guess they are too busy with VB4), I wanted my forum to be protected. So, I made this addon. It should be compatible with vb 3.6.x, 3.7.x and 3.8.x

Engine specifics
As far as I can understand, on search, Vbulletin makes at least two additional queries for each word you searched for (one per word table, second - for post table to find posts for that word). If some words ORed - results joined. If they are ANDed - an intersection is calculated in PHP via array_intersect. Those queries are without any LIMIT clause and can make a load on server. Actually, that is why search is so resource-intensive.

What does it do?
It limits the amount of search operators and overall search query word count to prevent high server load.

Hack is disabled after installation and you need to setup limits in Vbulletin options after installation.

How to install/upgrade?
Just import/reimport product xml.

What are the recommended settings for big boards?
I think, you can limit overal operators to 4 and a number of search words to 7-10. I don't think regular users will push the limits.

Version history:
1.0
Initial release

Kolbi
06-30-2009, 11:05 AM
I donĀ“t clearly understand you plugin.

I mean, which user uses OR or NOT ?

But the maximum of words in search querys is a good thing.

FractalizeR
06-30-2009, 11:25 AM
When you enter search query, you may type the following:
"Vbulletin OR forum -IPB"
Which means to search for posts containing word "Vbulletin" OR word "forum" AND NOT word "IPB".

Kolbi
06-30-2009, 07:34 PM
:) Thank you.

Do you think many user use this? Or do you think the search engines are causing this problem?

FractalizeR
07-01-2009, 05:11 AM
No. I don't think regular users use this at all. Search is abused only with intention.

Kolbi
07-01-2009, 11:32 AM
You mean to attack a site? Or to slow down?

Can it is a very useful plugin.

FractalizeR
07-01-2009, 11:46 AM
To slow down. There is no security hole here.

Kolbi
07-01-2009, 12:04 PM
Okay, thank you.

FractalizeR
07-01-2009, 12:24 PM
Welcome ;)

Kolbi
07-01-2009, 12:35 PM
Am I allowed to publish the German translation?

FractalizeR
07-01-2009, 01:04 PM
Of course ;) Attach it and I will reattach it to first post. Of course you will be credited.

cad2go
07-12-2009, 02:13 PM
Thanks Fractalizer

FractalizeR
07-12-2009, 06:34 PM
You are welcome ;)

xorex
10-02-2011, 06:32 AM
"Global maximum for search operators" not working for me

I set it to 5 and try search

test OR test2 OR test3 OR worlds OR test234 NOT testing NOT verify NOT appleresults:

test OR test2 OR test3 OR worlds OR test234, -testing, -verify, -appleMaximum number of OR operators allowed - 4

Maximum number of NOT operators allowed - 4

Or "Global maximum for search operators" should be equal to or more both settings above ?

webmastersitesi
01-23-2012, 08:31 PM
Very clever and lovely plugin. I thank you so much for this.