From 7cfc5b085e9efe72cd64eaf4e3c3a2a53a869f76 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 5 Apr 2014 03:38:58 -0500 Subject: [PATCH] (Performance Adjustment) Removed AsyncLoadVariables from InterserverTimer.Check() in both zone and world. By watching the MySQL general.log file on mass zone idle activity, you can see that the query 'SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= timestamp' is called every 10 seconds. This function is loading variables that are initially loaded on World and Zone bootup. When running a large amount of zone servers, the amount of MySQL chatter that is produced is enormous and unnecessary. For example, if I ran 400 zone servers, I would see 3,456,000 unnecessary queries from all idle or active zone processes in a 24 hour interval. --- changelog.txt | 5 ++++- world/net.cpp | 2 +- zone/net.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 4bd4d8eaa..87229d5dc 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,10 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 04/05/2014 == -Akkadius: BOOGABOOGABOOGA +Akkadius: (Performance Adjustment) Removed AsyncLoadVariables from InterserverTimer.Check() in both zone and world. By watching the MySQL general.log file on mass zone idle activity, you can + see that the query 'SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= timestamp' is called every 10 seconds. This function is loading + variables that are initially loaded on World and Zone bootup. When running a large amount of zone servers, the amount of MySQL chatter that is produced is enormous and + unnecessary. For example, if I ran 400 zone servers, I would see 3,456,000 unnecessary queries from all idle or active zone processes in a 24 hour interval. == 04/01/2014 == demonstar55: Implemented ability for a merchant to open and close shop. diff --git a/world/net.cpp b/world/net.cpp index 057367b00..3c5df74a2 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -461,7 +461,7 @@ int main(int argc, char** argv) { if (InterserverTimer.Check()) { InterserverTimer.Start(); database.ping(); - AsyncLoadVariables(dbasync, &database); + // AsyncLoadVariables(dbasync, &database); ReconnectCounter++; if (ReconnectCounter >= 12) { // only create thread to reconnect every 10 minutes. previously we were creating a new thread every 10 seconds ReconnectCounter = 0; diff --git a/zone/net.cpp b/zone/net.cpp index d870ee550..15e108e42 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -447,7 +447,7 @@ int main(int argc, char** argv) { if (InterserverTimer.Check()) { InterserverTimer.Start(); database.ping(); - AsyncLoadVariables(dbasync, &database); + // AsyncLoadVariables(dbasync, &database); entity_list.UpdateWho(); if (worldserver.TryReconnect() && (!worldserver.Connected())) worldserver.AsyncConnect();