Register Arama Bugünkü Mesajlar Mark Forums Read

Reply
 
Thread Tools
Delay reindexing as necessary to control server load
vB.Org Poster
vB.Org Poster has disabled reputation
Kayıt Tarihi: Jul 2018
Mesajlar: 298

Show Printable Version Email this Page
Makale: vBulletin 4 Makaleleri, yazar vB.Org Poster 09 Jul 2018, 23:32

It is sometimes necessary to rebuild the search index, and it can be quite resource-intensive and time-consuming with larger boards. It takes a few hours on my forums, so I just came up with the following code to keep the server load from spinning out of cotrol. It should work under most linux distributions, as long as you have access to /proc/loadavg from PHP (if not, see notes below).

In /admincp/misc.php, find the following lines (around line 184 in the latest vB 4.1 PL1 build):


Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

Right after, add this code:

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.


The idea is that this only adds a delay to redirects when/if server load exceeds some value (8 in this example).
The only downside I can see is checking the load average after each redirect... But it seems to work much better than the default reindexing on my server.


I hope it helps someone.


Notes:
If you do not have access to /proc/loadavg from PHP, you can try to execute `uptime` instead, or just add the "usleep ..." line to delay each redirect (even though it's a crude solution as it would slow down reindexing by a lot regardless of server load).

The uptime code variant of the above should be something like:
$load = explode(' ', `uptime`)
$load_5min = $load[count($load)-1];
if ($load_5min > 8) { .....
Views: 15
Reply With Quote
Reply

Thread Tools

Şunları Yapabilirsin
Yeni Konu Açmak
Konuya Cevap Yazmak
Eklenti Eklemek
Düzenleme Yapabilmek

Forum Atla


New To Site? Need Help?

All times are GMT +3. The time now is 15:38.

Tasarım Özelliği | Genişlik: Geniş Renk: Delay reindexing as necessary to control server load Delay reindexing as necessary to control server load Delay reindexing as necessary to control server load Delay reindexing as necessary to control server load Delay reindexing as necessary to control server load