collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Reducing the load on a server  (Read 3142 times)

0 Members and 1 Guest are viewing this topic.

Offline cyberkov

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Reducing the load on a server
« on: August 28, 2008, 05:22:02 pm »
Hello :)

The server load goes very high when the AoC Servers are offline (like down for maintenance).

So I added a sleep to Bot.php which might be a good idea to add to the svn version if that is possible.

Code: [Select]
cyberkov:~/sources/bebot-aoc/Sources# svn diff Bot.php
Index: Bot.php
===================================================================
--- Bot.php     (Revision 28)
+++ Bot.php     (Arbeitskopie)
@@ -390,7 +390,9 @@

                // Open connection
                $this -> log("LOGIN", "STATUS", "Connecting");
-               $this -> aoc -> connect($server, $port);
+               while (!$this -> aoc -> connect($server, $port)) {
+                       sleep(30);
+               }

                // Authenticate
                $this -> log("LOGIN", "STATUS", "Authenticating");

so long
cyb

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Reducing the load on a server
« Reply #1 on: August 28, 2008, 10:29:35 pm »
Implemented a similar fix.

Though I think the bot should be waiting already if you didn't set the reconnect delay to 0. If it is set to 0 my fix won't help in this case either as I'm using the same timeout.

PS: I've added the fix to the official main bebot svn. Not sure what's the status on the aoc svn is.
« Last Edit: August 28, 2008, 10:31:06 pm by Alreadythere »

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 369
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal