From 6c036b0a1bd1aa06094a146734e5bdac81a0ae56 Mon Sep 17 00:00:00 2001 From: Znote Date: Sat, 7 Jan 2017 03:37:23 +0100 Subject: [PATCH] Log IP performance issue workaround. 1000 latest records should suffice for the system to function properly. An OT server had issues when ip logger saved over 250 000 IPs (probably some sort of ddos attack), which got loaded into memory in each page render. --- engine/function/general.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/function/general.php b/engine/function/general.php index 694086e..f781c15 100644 --- a/engine/function/general.php +++ b/engine/function/general.php @@ -132,7 +132,7 @@ function setCache($time) { // Get visitor basic data function znote_visitors_get_data() { - return mysql_select_multi("SELECT `ip`, `value` FROM `znote_visitors`"); + return mysql_select_multi("SELECT `ip`, `value` FROM `znote_visitors` ORDER BY `id` DESC LIMIT 1000;"); } // Set visitor basic data