From 5280ad638d97cfd0e225e53ff9e6074a0d05b4d4 Mon Sep 17 00:00:00 2001 From: lotus Date: Wed, 3 Dec 2008 14:10:01 +0000 Subject: [PATCH] added basic performance page other performance settings can be found on advanced settings git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5375 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- defaults/yacy.init | 3 - htroot/PerformanceMemory_p.html | 436 ++++++++++---------- htroot/PerformanceMemory_p.java | 15 - htroot/PerformanceQueues_p.html | 75 +--- htroot/PerformanceQueues_p.java | 29 +- htroot/Performance_p.html | 109 +++++ htroot/Performance_p.java | 37 ++ htroot/Settings_p.html | 5 + htroot/env/templates/submenuConfig.template | 4 +- locales/de.lng | 61 +-- 10 files changed, 418 insertions(+), 356 deletions(-) create mode 100644 htroot/Performance_p.html create mode 100644 htroot/Performance_p.java diff --git a/defaults/yacy.init b/defaults/yacy.init index 7531c5570..972604e05 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -818,9 +818,6 @@ svnRevision=0 currentSkin=default -# hide some tables -enableSimpleConfig=true - # temporary flag for new database structure. set only true for testing # ALL DATA THAT IS CREATED WITH THIS FLAG ON WILL BE VOID IN A FINAL VERSION # table-types: RAM = 0, TREE = 1, FLEX = 2; diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.html index 6be1f854a..717a4f836 100644 --- a/htroot/PerformanceMemory_p.html +++ b/htroot/PerformanceMemory_p.html @@ -5,7 +5,7 @@ #%env/templates/metas.template%# - + - + #%env/templates/header.template%# #%env/templates/submenuConfig.template%#

Performance Settings of Queues and Processes

-
Use Default Profile: -

- - and use - - of the defined performance. -

-

Changes take effect immediately

-
- - show expert settings - -
-
Scheduled tasks overview and waiting time settings: @@ -219,57 +197,6 @@ - - - -
Online Caution Settings: -

- This is the time that the crawler idles when the proxy is accessed, or a local or remote search is done. - The delay is extended by this time each time the proxy is accessed afterwards. - This shall improve performance of the affected process (proxy or search). - (current delta is #[crawlPauseProxyCurrent]#/#[crawlPauseLocalsearchCurrent]#/#[crawlPauseRemotesearchCurrent]# - seconds since last proxy/local-search/remote-search access.) -

-
- - - - - - - - - - - - - - - - - - - -
Online Caution Caseindexer delay (milliseconds) after case occurency
Proxy:
Local Search:
Remote Search:
- Changes take effect immediately
-
- - -
-
YaCy Priority Settings -
-
:
-
-
-
Changes take effect after restart of YaCy
-
-
-
- #%env/templates/footer.template%# diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java index 76c2aa089..72b07c667 100644 --- a/htroot/PerformanceQueues_p.java +++ b/htroot/PerformanceQueues_p.java @@ -56,12 +56,21 @@ public class PerformanceQueues_p { final plasmaSwitchboard switchboard = (plasmaSwitchboard) sb; final serverObjects prop = new serverObjects(); File defaultSettingsFile = new File(switchboard.getRootPath(), "defaults/yacy.init"); - if(post != null && post.containsKey("defaultFile")) { - // TODO check file-path! - final File value = new File(switchboard.getRootPath(), post.get("defaultFile", "defaults/yacy.init")); - // check if value is readable file - if(value.exists() && value.isFile() && value.canRead()) { - defaultSettingsFile = value; + if(post != null) { + if(post.containsKey("defaultFile")){ + // TODO check file-path! + final File value = new File(switchboard.getRootPath(), post.get("defaultFile", "defaults/yacy.init")); + // check if value is readable file + if(value.exists() && value.isFile() && value.canRead()) { + defaultSettingsFile = value; + } + } + if (post.containsKey("Xmx")) { + int xmx = 120; // default maximum heap size + try { xmx = Integer.valueOf(post.get("Xmx", "120")).intValue(); } catch (final NumberFormatException e){} + sb.setConfig("javastart_Xmx", "Xmx" + xmx + "m"); + sb.setConfig("javastart_Xms", "Xms" + xmx + "m"); + prop.put("setStartupCommit", "1"); } } final Map defaultSettings = ((post == null) || (!(post.containsKey("submitdefault")))) ? null : serverFileUtils.loadHashMap(defaultSettingsFile); @@ -72,8 +81,6 @@ public class PerformanceQueues_p { final boolean xml = (header.get("PATH")).endsWith(".xml"); prop.setLocalized(!xml); - prop.put("enableSimpleConfig", sb.getConfigBool("enableSimpleConfig", true) ? "1" : "0"); - // calculate totals long blocktime_total = 0, sleeptime_total = 0, exectime_total = 0; while (threads.hasNext()) { @@ -315,6 +322,12 @@ public class PerformanceQueues_p { prop.put("priority_below",(curr_prio==10) ? "1" : "0"); prop.put("priority_low",(curr_prio==20) ? "1" : "0"); + // parse initialization memory settings + final String Xmx = sb.getConfig("javastart_Xmx", "Xmx120m").substring(3); + prop.put("Xmx", Xmx.substring(0, Xmx.length() - 1)); + final String Xms = sb.getConfig("javastart_Xms", "Xms120m").substring(3); + prop.put("Xms", Xms.substring(0, Xms.length() - 1)); + // return rewrite values for templates return prop; } diff --git a/htroot/Performance_p.html b/htroot/Performance_p.html new file mode 100644 index 000000000..48476495c --- /dev/null +++ b/htroot/Performance_p.html @@ -0,0 +1,109 @@ + + + + YaCy '#[clientname]#': Performance Settings + #%env/templates/metas.template%# + + + + + #%env/templates/header.template%# + #%env/templates/submenuConfig.template%# +

Performance Settings

+ +

PerformanceGraph

+

+ + +
+
+ Memory Settings +
+
+
MByte  +   + #(setStartupCommit)#::
Accepted change. This will take effect after restart of YaCy
::
#(/setStartupCommit)# +
+
+
+
+ +
+
Use Default Profile: +

+ + and use + + of the defined performance. +

+

Changes take effect immediately

+
+
+ +
+
YaCy Priority Settings +
+
:
+
+
+
Changes take effect after restart of YaCy
+
+
+
+ +
+
Online Caution Settings: +

+ This is the time that the crawler idles when the proxy is accessed, or a local or remote search is done. + The delay is extended by this time each time the proxy is accessed afterwards. + This shall improve performance of the affected process (proxy or search). + (current delta is #[crawlPauseProxyCurrent]#/#[crawlPauseLocalsearchCurrent]#/#[crawlPauseRemotesearchCurrent]# + seconds since last proxy/local-search/remote-search access.) +

+ + + + + + + + + + + + + + + + + + + + +
Online Caution Caseindexer delay (milliseconds) after case occurency
Proxy:
Local Search:
Remote Search:
+ Changes take effect immediately
+
+
+ + #%env/templates/footer.template%# + + diff --git a/htroot/Performance_p.java b/htroot/Performance_p.java new file mode 100644 index 000000000..bd312e193 --- /dev/null +++ b/htroot/Performance_p.java @@ -0,0 +1,37 @@ +//Performace_p.java +//----------------------- +//part of YaCy +//(C) by Michael Peter Christen; mc@yacy.net +//first published on http://www.anomic.de +//Frankfurt, Germany, 2004, 2005 +//last major change: 16.02.2005 +// +//This program is free software; you can redistribute it and/or modify +//it under the terms of the GNU General Public License as published by +//the Free Software Foundation; either version 2 of the License, or +//(at your option) any later version. +// +//This program is distributed in the hope that it will be useful, +//but WITHOUT ANY WARRANTY; without even the implied warranty of +//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//GNU General Public License for more details. +// +//You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +//You must compile this file with +//javac -classpath .:../classes Network.java +//if the shell's current path is HTROOT + +import de.anomic.http.httpRequestHeader; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; + +public class Performance_p { + + public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch sb) { + return PerformanceQueues_p.respond(header, post, sb); + } + +} diff --git a/htroot/Settings_p.html b/htroot/Settings_p.html index 0fe8266a8..337b97306 100644 --- a/htroot/Settings_p.html +++ b/htroot/Settings_p.html @@ -28,6 +28,11 @@ but forgot your administration password, you must stop the proxy, delete the file 'DATA/SETTINGS/yacy.conf' in the YaCy application root folder and start YaCy again.

+
  • Server Access Settings
  • Proxy Access Settings
  • diff --git a/htroot/env/templates/submenuConfig.template b/htroot/env/templates/submenuConfig.template index 68d3397cd..e3f15a664 100644 --- a/htroot/env/templates/submenuConfig.template +++ b/htroot/env/templates/submenuConfig.template @@ -10,9 +10,7 @@