PerformanceQueues: disable input for hardcoded httpd performance values

pull/1/head
reger 12 years ago
parent ad71747525
commit 664499bb10

@ -1,180 +1,180 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>YaCy '#[clientname]#': Performance Settings of Queues and Processes</title> <title>YaCy '#[clientname]#': Performance Settings of Queues and Processes</title>
#%env/templates/metas.template%# #%env/templates/metas.template%#
<script type="text/javascript" src="js/html.js"></script> <script type="text/javascript" src="js/html.js"></script>
</head> </head>
<body id="PerformanceQueues"> <body id="PerformanceQueues">
#%env/templates/header.template%# #%env/templates/header.template%#
#%env/templates/submenuConfig.template%# #%env/templates/submenuConfig.template%#
<h2>Performance Settings of Queues and Processes</h2> <h2>Performance Settings of Queues and Processes</h2>
<form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8"> <form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Scheduled tasks overview and waiting time settings:</legend> <fieldset><legend>Scheduled tasks overview and waiting time settings:</legend>
<table border="0" cellpadding="2" cellspacing="1"> <table border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader" valign="bottom"> <tr class="TableHeader" valign="bottom">
<td>Thread</td> <td>Thread</td>
<td>Queue Size</td> <td>Queue Size</td>
<td colspan="2">Total<br />Block Time</td> <td colspan="2">Total<br />Block Time</td>
<td colspan="2">Total<br />Sleep Time</td> <td colspan="2">Total<br />Sleep Time</td>
<td colspan="2">Total<br />Exec Time</td> <td colspan="2">Total<br />Exec Time</td>
<td>Total<br />Cycles</td> <td>Total<br />Cycles</td>
<td>Idle<br />Cycles</td> <td>Idle<br />Cycles</td>
<td>Busy<br />Cycles</td> <td>Busy<br />Cycles</td>
<td>Short Mem<br />Cycles</td> <td>Short Mem<br />Cycles</td>
<td>Sleep Time<br />per Cycle<br />(millis)</td> <td>Sleep Time<br />per Cycle<br />(millis)</td>
<td>Exec Time<br />per Busy-Cycle<br />(millis)</td> <td>Exec Time<br />per Busy-Cycle<br />(millis)</td>
<td>Memory Use<br />per Busy-Cycle<br />(kbytes)</td> <td>Memory Use<br />per Busy-Cycle<br />(kbytes)</td>
<td>Delay between<br />idle loops</td> <td>Delay between<br />idle loops</td>
<td>Delay between<br />busy loops</td> <td>Delay between<br />busy loops</td>
<td>Minimum of<br />Required Memory</td> <td>Minimum of<br />Required Memory</td>
<td>Full Description</td> <td>Full Description</td>
</tr> </tr>
#{table}# #{table}#
<tr class="TableCellDark"> <tr class="TableCellDark">
<td align="left">#(hasurl)##[shortdescr]#::<a href="#[url]#">#[shortdescr]#</a>#(/hasurl)#</td> <td align="left">#(hasurl)##[shortdescr]#::<a href="#[url]#">#[shortdescr]#</a>#(/hasurl)#</td>
<td align="right">#[queuesize]#</td> <td align="right">#[queuesize]#</td>
<td align="right">#[blocktime]#&nbsp;sec</td> <td align="right">#[blocktime]#&nbsp;sec</td>
<td align="right">#[blockpercent]#%</td> <td align="right">#[blockpercent]#%</td>
<td align="right">#[sleeptime]#&nbsp;sec</td> <td align="right">#[sleeptime]#&nbsp;sec</td>
<td align="right">#[sleeppercent]#%</td> <td align="right">#[sleeppercent]#%</td>
<td align="right">#[exectime]#&nbsp;sec</td> <td align="right">#[exectime]#&nbsp;sec</td>
<td align="right">#[execpercent]#%</td> <td align="right">#[execpercent]#%</td>
<td align="right">#[totalcycles]#</td> <td align="right">#[totalcycles]#</td>
<td align="right">#[idlecycles]#</td> <td align="right">#[idlecycles]#</td>
<td align="right">#[busycycles]#</td> <td align="right">#[busycycles]#</td>
<td align="right">#[memscycles]#</td> <td align="right">#[memscycles]#</td>
<td align="right">#[sleeppercycle]#</td> <td align="right">#[sleeppercycle]#</td>
<td align="right">#[execpercycle]#</td> <td align="right">#[execpercycle]#</td>
<td align="right">#[memusepercycle]#</td> <td align="right">#[memusepercycle]#</td>
<td align="right"><input name="#[threadname]#_idlesleep" size="7" maxlength="7" value="#[idlesleep]#" /> milliseconds</td> <td align="right"><input name="#[threadname]#_idlesleep" size="7" maxlength="7" value="#[idlesleep]#" #(disabled)#:: disabled="disabled"#(/disabled)# /> milliseconds</td>
<td align="right"><input name="#[threadname]#_busysleep" size="7" maxlength="7" value="#[busysleep]#" /> milliseconds</td> <td align="right"><input name="#[threadname]#_busysleep" size="7" maxlength="7" value="#[busysleep]#" #(disabled)#:: disabled="disabled"#(/disabled)# /> milliseconds</td>
<td align="right"><input name="#[threadname]#_memprereq" size="7" maxlength="10" value="#[memprereq]#" #(disabled)#:: disabled="disabled"#(/disabled)# /> kbytes</td> <td align="right"><input name="#[threadname]#_memprereq" size="7" maxlength="10" value="#[memprereq]#" #(disabled)#:: disabled="disabled"#(/disabled)# /> kbytes</td>
<td align="left">#[longdescr]##(recommendation)#::<br/>recommended: #[value]# kbytes#(/recommendation)#</td> <td align="left">#[longdescr]##(recommendation)#::<br/>recommended: #[value]# kbytes#(/recommendation)#</td>
</tr> </tr>
#{/table}# #{/table}#
<tr class="TableCellLight"> <tr class="TableCellLight">
<td align="left" colspan="19"> <td align="left" colspan="19">
<input type="submit" name="submitdelay" value="Submit New Delay Values" /> <input type="submit" name="submitdelay" value="Submit New Delay Values" />
Changes take effect immediately<br/> Changes take effect immediately<br/>
</td> </td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>
</form> </form>
<form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8"> <form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Cache Settings:</legend> <fieldset><legend>Cache Settings:</legend>
<table border="0" cellpadding="5" cellspacing="1"> <table border="0" cellpadding="5" cellspacing="1">
<tr valign="top" class="TableHeader"> <tr valign="top" class="TableHeader">
<td></td> <td></td>
<td>RAM Cache</td> <td>RAM Cache</td>
<td>Description</td> <td>Description</td>
</tr> </tr>
<tr valign="top" class="TableCellDark"> <tr valign="top" class="TableCellDark">
<td>Words in RAM cache:<br />(Size in KBytes)</td> <td>Words in RAM cache:<br />(Size in KBytes)</td>
<td>#[wordCacheSize]#<br />(#[wordCacheSizeKBytes]# KB)</td> <td>#[wordCacheSize]#<br />(#[wordCacheSizeKBytes]# KB)</td>
<td> <td>
This is the current size of the word caches. This is the current size of the word caches.
The indexing cache speeds up the indexing process, the DHT cache holds indexes temporary for approval. The indexing cache speeds up the indexing process, the DHT cache holds indexes temporary for approval.
The maximum of this caches can be set below. The maximum of this caches can be set below.
</td> </td>
</tr> </tr>
<tr valign="top" class="TableCellDark"> <tr valign="top" class="TableCellDark">
<td>Maximum URLs currently assigned<br />to one cached word:</td> <td>Maximum URLs currently assigned<br />to one cached word:</td>
<td>#[maxURLinCache]#</td> <td>#[maxURLinCache]#</td>
<td> <td>
This is the maximum size of URLs assigned to a single word cache entry. This is the maximum size of URLs assigned to a single word cache entry.
If this is a big number, it shows that the caching works efficiently. If this is a big number, it shows that the caching works efficiently.
</td> </td>
</tr> </tr>
<tr valign="top" class="TableCellDark"> <tr valign="top" class="TableCellDark">
<td>Maximum age of a word:</td> <td>Maximum age of a word:</td>
<td>#[maxAgeOfCache]#</td> <td>#[maxAgeOfCache]#</td>
<td> <td>
This is the maximum age of a word in an index in minutes. This is the maximum age of a word in an index in minutes.
</td> </td>
</tr> </tr>
<tr valign="top" class="TableCellDark"> <tr valign="top" class="TableCellDark">
<td>Minimum age of a word:</td> <td>Minimum age of a word:</td>
<td>#[minAgeOfCache]#</td> <td>#[minAgeOfCache]#</td>
<td> <td>
This is the minimum age of a word in an index in minutes. This is the minimum age of a word in an index in minutes.
</td> </td>
</tr> </tr>
<tr valign="top" class="TableCellDark"> <tr valign="top" class="TableCellDark">
<td>Maximum number of words in cache:</td> <td>Maximum number of words in cache:</td>
<td> <td>
<input name="wordCacheMaxCount" type="text" size="10" maxlength="100" value="#[wordCacheMaxCount]#" /> <input name="wordCacheMaxCount" type="text" size="10" maxlength="100" value="#[wordCacheMaxCount]#" />
</td> </td>
<td> <td>
This is is the number of word indexes that shall be held in the This is is the number of word indexes that shall be held in the
ram cache during indexing. When YaCy is shut down, this cache must be ram cache during indexing. When YaCy is shut down, this cache must be
flushed to disc; this may last some minutes. flushed to disc; this may last some minutes.
</td> </td>
</tr> </tr>
<tr valign="top" class="TableCellLight"> <tr valign="top" class="TableCellLight">
<td colspan="4"> <td colspan="4">
<input type="submit" name="cacheSizeSubmit" value="Enter New Cache Size" /> <input type="submit" name="cacheSizeSubmit" value="Enter New Cache Size" />
Changes take effect immediately</td> Changes take effect immediately</td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>
</form> </form>
<form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8"> <form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Balancer Settings:</legend> <fieldset><legend>Balancer Settings:</legend>
<p> <p>
This is the time delta between accessing of the same domain during a crawl. The crawl balancer tries to avoid that domains are This is the time delta between accessing of the same domain during a crawl. The crawl balancer tries to avoid that domains are
accessed too often, but if the balancer fails (i.e. if there are only links left from the same domain), then these minimum accessed too often, but if the balancer fails (i.e. if there are only links left from the same domain), then these minimum
delta times are ensured. delta times are ensured.
</p> </p>
<table border="0" cellpadding="2" cellspacing="1"> <table border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader" valign="bottom"> <tr class="TableHeader" valign="bottom">
<td>Crawler Domain</td> <td>Crawler Domain</td>
<td>Minimum Access Time Delta</td> <td>Minimum Access Time Delta</td>
</tr> </tr>
<tr class="TableCellDark"> <tr class="TableCellDark">
<td>local (intranet) crawls</td> <td>local (intranet) crawls</td>
<td align="right"><input id="minimumLocalDelta" name="minimumLocalDelta" type="text" size="20" maxlength="100" value="#[minimumLocalDelta]#" /></td> <td align="right"><input id="minimumLocalDelta" name="minimumLocalDelta" type="text" size="20" maxlength="100" value="#[minimumLocalDelta]#" /></td>
</tr> </tr>
<tr class="TableCellDark"> <tr class="TableCellDark">
<td>global (internet) crawls</td> <td>global (internet) crawls</td>
<td align="right"><input id="minimumGlobalDelta" name="minimumGlobalDelta" type="text" size="20" maxlength="100" value="#[minimumGlobalDelta]#" /></td> <td align="right"><input id="minimumGlobalDelta" name="minimumGlobalDelta" type="text" size="20" maxlength="100" value="#[minimumGlobalDelta]#" /></td>
</tr> </tr>
<tr class="TableCellLight"> <tr class="TableCellLight">
<td align="left" colspan="2"><input type="submit" name="minimumDeltaSubmit" value="Enter New Parameters" /> <td align="left" colspan="2"><input type="submit" name="minimumDeltaSubmit" value="Enter New Parameters" />
Changes take effect immediately</td> Changes take effect immediately</td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>
</form> </form>
<form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8"> <form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset><legend>Thread Pool Settings:</legend> <fieldset><legend>Thread Pool Settings:</legend>
<table border="0" cellpadding="2" cellspacing="1"> <table border="0" cellpadding="2" cellspacing="1">
<tr class="TableHeader" valign="bottom"> <tr class="TableHeader" valign="bottom">
<td>Thread Pool</td> <td>Thread Pool</td>
<td>maximum Active</td> <td>maximum Active</td>
<td>current Active</td> <td>current Active</td>
</tr> </tr>
#{pool}# #{pool}#
<tr class="TableCellDark"> <tr class="TableCellDark">
<td align="left">#[name]#</td> <td align="left">#[name]#</td>
<td align="right"><input name="#[name]#_maxActive" type="text" size="8" maxlength="8" value="#[maxActive]#" /></td> <td align="right"><input name="#[name]#_maxActive" type="text" size="8" maxlength="8" value="#[maxActive]#" /></td>
<td align="right">#[numActive]#</td> <td align="right">#[numActive]#</td>
</tr> </tr>
#{/pool}# #{/pool}#
<tr class="TableCellLight"> <tr class="TableCellLight">
<td align="left" colspan="7"> <td align="left" colspan="7">
<input type="submit" name="poolConfig" value="Enter new Threadpool Configuration" /> <input type="submit" name="poolConfig" value="Enter new Threadpool Configuration" />
Changes take effect immediately</td> Changes take effect immediately</td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>
</form> </form>
#%env/templates/footer.template%# #%env/templates/footer.template%#
</body> </body>
</html> </html>

@ -1,355 +1,356 @@
//PerformaceQueues_p.java //PerformaceQueues_p.java
//----------------------- //-----------------------
//part of YaCy //part of YaCy
//(C) by Michael Peter Christen; mc@yacy.net //(C) by Michael Peter Christen; mc@yacy.net
//first published on http://www.anomic.de //first published on http://www.anomic.de
//Frankfurt, Germany, 2004, 2005 //Frankfurt, Germany, 2004, 2005
//last major change: 16.02.2005 //last major change: 16.02.2005
// //
//This program is free software; you can redistribute it and/or modify //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 //it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2 of the License, or //the Free Software Foundation; either version 2 of the License, or
//(at your option) any later version. //(at your option) any later version.
// //
//This program is distributed in the hope that it will be useful, //This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of //but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details. //GNU General Public License for more details.
// //
//You should have received a copy of the GNU General Public License //You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software //along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//You must compile this file with //You must compile this file with
//javac -classpath .:../classes Network.java //javac -classpath .:../classes Network.java
//if the shell's current path is HTROOT //if the shell's current path is HTROOT
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import net.yacy.cora.protocol.HeaderFramework; import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.RequestHeader;
import net.yacy.kelondro.util.FileUtils; import net.yacy.kelondro.util.FileUtils;
import net.yacy.kelondro.util.Formatter; import net.yacy.kelondro.util.Formatter;
import net.yacy.kelondro.util.MemoryControl; import net.yacy.kelondro.util.MemoryControl;
import net.yacy.kelondro.util.OS; import net.yacy.kelondro.util.OS;
import net.yacy.kelondro.workflow.BusyThread; import net.yacy.kelondro.workflow.BusyThread;
import net.yacy.kelondro.workflow.WorkflowThread; import net.yacy.kelondro.workflow.WorkflowThread;
import net.yacy.search.Switchboard; import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants; import net.yacy.search.SwitchboardConstants;
import net.yacy.search.index.Segment; import net.yacy.search.index.Segment;
import net.yacy.server.serverCore; import net.yacy.server.serverCore;
import net.yacy.server.serverObjects; import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch; import net.yacy.server.serverSwitch;
public class PerformanceQueues_p { public class PerformanceQueues_p {
/** /**
* list of pre-defined settings: filename -> description * list of pre-defined settings: filename -> description
*/ */
private final static Map<String, String> performanceProfiles = new HashMap<String, String>(4, 0.9f); private final static Map<String, String> performanceProfiles = new HashMap<String, String>(4, 0.9f);
static { static {
// no sorted output! // no sorted output!
performanceProfiles.put("defaults/yacy.init", "default (crawl)"); performanceProfiles.put("defaults/yacy.init", "default (crawl)");
performanceProfiles.put("defaults/performance_dht.profile", "prefer DHT"); performanceProfiles.put("defaults/performance_dht.profile", "prefer DHT");
} }
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) { public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
// return variable that accumulates replacements // return variable that accumulates replacements
final Switchboard sb = (Switchboard) env; final Switchboard sb = (Switchboard) env;
final serverObjects prop = new serverObjects(); final serverObjects prop = new serverObjects();
File defaultSettingsFile = new File(sb.getAppPath(), "defaults/yacy.init"); File defaultSettingsFile = new File(sb.getAppPath(), "defaults/yacy.init");
// get segment // get segment
Segment indexSegment = sb.index; Segment indexSegment = sb.index;
if(post != null) { if(post != null) {
if(post.containsKey("defaultFile")){ if(post.containsKey("defaultFile")){
// TODO check file-path! // TODO check file-path!
final File value = new File(sb.getAppPath(), post.get("defaultFile", "defaults/yacy.init")); final File value = new File(sb.getAppPath(), post.get("defaultFile", "defaults/yacy.init"));
// check if value is readable file // check if value is readable file
if(value.exists() && value.isFile() && value.canRead()) { if(value.exists() && value.isFile() && value.canRead()) {
defaultSettingsFile = value; defaultSettingsFile = value;
} }
} }
if (post.containsKey("Xmx")) { if (post.containsKey("Xmx")) {
int xmx = post.getInt("Xmx", 600); // default maximum heap size int xmx = post.getInt("Xmx", 600); // default maximum heap size
if (OS.isWin32) xmx = Math.min(2000, xmx); if (OS.isWin32) xmx = Math.min(2000, xmx);
int xms = xmx; //Math.min(xmx, Math.max(90, xmx / 10)); int xms = xmx; //Math.min(xmx, Math.max(90, xmx / 10));
sb.setConfig("javastart_Xmx", "Xmx" + xmx + "m"); sb.setConfig("javastart_Xmx", "Xmx" + xmx + "m");
sb.setConfig("javastart_Xms", "Xms" + xms + "m"); sb.setConfig("javastart_Xms", "Xms" + xms + "m");
prop.put("setStartupCommit", "1"); prop.put("setStartupCommit", "1");
} }
if(post.containsKey("diskFree")) { if(post.containsKey("diskFree")) {
sb.setConfig(SwitchboardConstants.DISK_FREE, post.getInt("diskFree", 3000)); sb.setConfig(SwitchboardConstants.DISK_FREE, post.getInt("diskFree", 3000));
} }
if(post.containsKey("diskFreeHardlimit")) { if(post.containsKey("diskFreeHardlimit")) {
sb.setConfig(SwitchboardConstants.DISK_FREE_HARDLIMIT, post.getInt("diskFreeHardlimit", 1000)); sb.setConfig(SwitchboardConstants.DISK_FREE_HARDLIMIT, post.getInt("diskFreeHardlimit", 1000));
} }
if(post.containsKey("memoryAcceptDHT")) { if(post.containsKey("memoryAcceptDHT")) {
sb.setConfig(SwitchboardConstants.MEMORY_ACCEPTDHT, post.getInt("memoryAcceptDHT", 50)); sb.setConfig(SwitchboardConstants.MEMORY_ACCEPTDHT, post.getInt("memoryAcceptDHT", 50));
} }
if(post.containsKey("resetObserver")) { if(post.containsKey("resetObserver")) {
MemoryControl.resetProperState(); MemoryControl.resetProperState();
} }
} }
final Map<String, String> defaultSettings = ((post == null) || (!(post.containsKey("submitdefault")))) ? null : FileUtils.loadMap(defaultSettingsFile); final Map<String, String> defaultSettings = ((post == null) || (!(post.containsKey("submitdefault")))) ? null : FileUtils.loadMap(defaultSettingsFile);
Iterator<String> threads = sb.threadNames(); Iterator<String> threads = sb.threadNames();
String threadName; String threadName;
BusyThread thread; BusyThread thread;
final boolean xml = (header.get(HeaderFramework.CONNECTION_PROP_PATH)).endsWith(".xml"); final boolean xml = (header.get(HeaderFramework.CONNECTION_PROP_PATH)).endsWith(".xml");
prop.setLocalized(!xml); prop.setLocalized(!xml);
// calculate totals // calculate totals
long blocktime_total = 0, sleeptime_total = 0, exectime_total = 0; long blocktime_total = 0, sleeptime_total = 0, exectime_total = 0;
while (threads.hasNext()) { while (threads.hasNext()) {
threadName = threads.next(); threadName = threads.next();
thread = sb.getThread(threadName); thread = sb.getThread(threadName);
blocktime_total += thread.getBlockTime(); blocktime_total += thread.getBlockTime();
sleeptime_total += thread.getSleepTime(); sleeptime_total += thread.getSleepTime();
exectime_total += thread.getExecTime(); exectime_total += thread.getExecTime();
} }
if (blocktime_total == 0) blocktime_total = 1; if (blocktime_total == 0) blocktime_total = 1;
if (sleeptime_total == 0) sleeptime_total = 1; if (sleeptime_total == 0) sleeptime_total = 1;
if (exectime_total == 0) exectime_total = 1; if (exectime_total == 0) exectime_total = 1;
// set templates for latest news from the threads // set templates for latest news from the threads
long blocktime, sleeptime, exectime; long blocktime, sleeptime, exectime;
long idlesleep, busysleep, memuse, memprereq; long idlesleep, busysleep, memuse, memprereq;
int queuesize; int queuesize;
threads = sb.threadNames(); threads = sb.threadNames();
int c = 0; int c = 0;
long idleCycles, busyCycles, memshortageCycles; long idleCycles, busyCycles, memshortageCycles;
// set profile? // set profile?
final double multiplier = (post != null) && post.containsKey("profileSpeed") ? 100.0 / post.getFloat("profileSpeed", 100.0f) : 1.0; final double multiplier = (post != null) && post.containsKey("profileSpeed") ? 100.0 / post.getFloat("profileSpeed", 100.0f) : 1.0;
final boolean setProfile = (post != null && post.containsKey("submitdefault")); final boolean setProfile = (post != null && post.containsKey("submitdefault"));
final boolean setDelay = (post != null) && (post.containsKey("submitdelay")); final boolean setDelay = (post != null) && (post.containsKey("submitdelay"));
// save used settings file to config // save used settings file to config
if (setProfile && post != null){ if (setProfile && post != null){
sb.setConfig("performanceProfile", post.get("defaultFile", "defaults/yacy.init")); sb.setConfig("performanceProfile", post.get("defaultFile", "defaults/yacy.init"));
sb.setConfig("performanceSpeed", post.getInt("profileSpeed", 100)); sb.setConfig("performanceSpeed", post.getInt("profileSpeed", 100));
} }
while (threads.hasNext()) { while (threads.hasNext()) {
threadName = threads.next(); threadName = threads.next();
thread = sb.getThread(threadName); thread = sb.getThread(threadName);
// set values to templates // set values to templates
prop.put("table_" + c + "_threadname", threadName); prop.put("table_" + c + "_threadname", threadName);
prop.putHTML("table_" + c + "_hasurl_shortdescr", thread.getShortDescription()); prop.putHTML("table_" + c + "_hasurl_shortdescr", thread.getShortDescription());
if(thread.getMonitorURL() == null) { if(thread.getMonitorURL() == null) {
prop.put("table_"+c+"_hasurl", "0"); prop.put("table_"+c+"_hasurl", "0");
}else{ }else{
prop.put("table_"+c+"_hasurl", "1"); prop.put("table_"+c+"_hasurl", "1");
prop.put("table_" + c + "_hasurl_url", thread.getMonitorURL()); prop.put("table_" + c + "_hasurl_url", thread.getMonitorURL());
} }
prop.putHTML("table_" + c + "_longdescr", thread.getLongDescription()); prop.putHTML("table_" + c + "_longdescr", thread.getLongDescription());
queuesize = thread.getJobCount(); queuesize = thread.getJobCount();
prop.put("table_" + c + "_queuesize", (queuesize == Integer.MAX_VALUE) ? "unlimited" : Formatter.number(queuesize, !xml)); prop.put("table_" + c + "_queuesize", (queuesize == Integer.MAX_VALUE) ? "unlimited" : Formatter.number(queuesize, !xml));
blocktime = thread.getBlockTime(); blocktime = thread.getBlockTime();
sleeptime = thread.getSleepTime(); sleeptime = thread.getSleepTime();
exectime = thread.getExecTime(); exectime = thread.getExecTime();
memuse = thread.getMemoryUse(); memuse = thread.getMemoryUse();
idleCycles = thread.getIdleCycles(); idleCycles = thread.getIdleCycles();
busyCycles = thread.getBusyCycles(); busyCycles = thread.getBusyCycles();
memshortageCycles = thread.getOutOfMemoryCycles(); memshortageCycles = thread.getOutOfMemoryCycles();
prop.putNum("table_" + c + "_blocktime", blocktime / 1000); prop.putNum("table_" + c + "_blocktime", blocktime / 1000);
prop.putNum("table_" + c + "_blockpercent", 100 * blocktime / blocktime_total); prop.putNum("table_" + c + "_blockpercent", 100 * blocktime / blocktime_total);
prop.putNum("table_" + c + "_sleeptime", sleeptime / 1000); prop.putNum("table_" + c + "_sleeptime", sleeptime / 1000);
prop.putNum("table_" + c + "_sleeppercent", 100 * sleeptime / sleeptime_total); prop.putNum("table_" + c + "_sleeppercent", 100 * sleeptime / sleeptime_total);
prop.putNum("table_" + c + "_exectime", exectime / 1000); prop.putNum("table_" + c + "_exectime", exectime / 1000);
prop.putNum("table_" + c + "_execpercent", 100 * exectime / exectime_total); prop.putNum("table_" + c + "_execpercent", 100 * exectime / exectime_total);
prop.putNum("table_" + c + "_totalcycles", idleCycles + busyCycles + memshortageCycles); prop.putNum("table_" + c + "_totalcycles", idleCycles + busyCycles + memshortageCycles);
prop.putNum("table_" + c + "_idlecycles", idleCycles); prop.putNum("table_" + c + "_idlecycles", idleCycles);
prop.putNum("table_" + c + "_busycycles", busyCycles); prop.putNum("table_" + c + "_busycycles", busyCycles);
prop.putNum("table_" + c + "_memscycles", memshortageCycles); prop.putNum("table_" + c + "_memscycles", memshortageCycles);
prop.putNum("table_" + c + "_sleeppercycle", ((idleCycles + busyCycles) == 0) ? -1 : sleeptime / (idleCycles + busyCycles)); prop.putNum("table_" + c + "_sleeppercycle", ((idleCycles + busyCycles) == 0) ? -1 : sleeptime / (idleCycles + busyCycles));
prop.putNum("table_" + c + "_execpercycle", (busyCycles == 0) ? -1 : exectime / busyCycles); prop.putNum("table_" + c + "_execpercycle", (busyCycles == 0) ? -1 : exectime / busyCycles);
prop.putNum("table_" + c + "_memusepercycle", (busyCycles == 0) ? -1 : memuse / busyCycles / 1024); prop.putNum("table_" + c + "_memusepercycle", (busyCycles == 0) ? -1 : memuse / busyCycles / 1024);
// load with old values // load with old values
idlesleep = sb.getConfigLong(threadName + "_idlesleep" , 1000); idlesleep = sb.getConfigLong(threadName + "_idlesleep" , 1000);
busysleep = sb.getConfigLong(threadName + "_busysleep", 100); busysleep = sb.getConfigLong(threadName + "_busysleep", 100);
memprereq = sb.getConfigLong(threadName + "_memprereq", 0); memprereq = sb.getConfigLong(threadName + "_memprereq", 0);
if (setDelay && post != null) { if (setDelay && post != null) {
// load with new values // load with new values
idlesleep = post.getLong(threadName + "_idlesleep", idlesleep); idlesleep = post.getLong(threadName + "_idlesleep", idlesleep);
busysleep = post.getLong(threadName + "_busysleep", busysleep); busysleep = post.getLong(threadName + "_busysleep", busysleep);
memprereq = post.getLong(threadName + "_memprereq", memprereq) * 1024l; memprereq = post.getLong(threadName + "_memprereq", memprereq) * 1024l;
if (memprereq == 0) memprereq = sb.getConfigLong(threadName + "_memprereq", 0); if (memprereq == 0) memprereq = sb.getConfigLong(threadName + "_memprereq", 0);
// check values to prevent short-cut loops // check values to prevent short-cut loops
if (idlesleep < 1000) idlesleep = 1000; if (idlesleep < 1000) idlesleep = 1000;
if (threadName.equals("10_httpd")) { idlesleep = 0; busysleep = 0; memprereq = 0; } if (threadName.equals("10_httpd")) { idlesleep = 0; busysleep = 0; memprereq = 0; }
sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq); sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq);
idlesleep = sb.getConfigLong(threadName + "_idlesleep", idlesleep); idlesleep = sb.getConfigLong(threadName + "_idlesleep", idlesleep);
busysleep = sb.getConfigLong(threadName + "_busysleep", busysleep); busysleep = sb.getConfigLong(threadName + "_busysleep", busysleep);
} }
if (setProfile) { if (setProfile) {
if (threadName.equals(SwitchboardConstants.PEER_PING) || if (threadName.equals(SwitchboardConstants.PEER_PING) ||
threadName.equals(SwitchboardConstants.SEED_UPLOAD) || threadName.equals(SwitchboardConstants.SEED_UPLOAD) ||
threadName.equals(SwitchboardConstants.CLEANUP)) { threadName.equals(SwitchboardConstants.CLEANUP)) {
/* do not change any values */ /* do not change any values */
} else { } else {
// load with new values // load with new values
idlesleep = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_idlesleep"), String.valueOf(idlesleep))) * multiplier); idlesleep = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_idlesleep"), String.valueOf(idlesleep))) * multiplier);
busysleep = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_busysleep"), String.valueOf(busysleep))) * multiplier); busysleep = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_busysleep"), String.valueOf(busysleep))) * multiplier);
//memprereq = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_memprereq"), String.valueOf(memprereq))) * multiplier); //memprereq = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_memprereq"), String.valueOf(memprereq))) * multiplier);
// check values to prevent short-cut loops // check values to prevent short-cut loops
if (idlesleep < 1000) idlesleep = 1000; if (idlesleep < 1000) idlesleep = 1000;
if (threadName.equals("10_httpd")) { idlesleep = 0; busysleep = 0; memprereq = 0; } if (threadName.equals("10_httpd")) { idlesleep = 0; busysleep = 0; memprereq = 0; }
//if (threadName.equals(plasmaSwitchboardConstants.CRAWLJOB_LOCAL_CRAWL) && (busysleep < 50)) busysleep = 50; //if (threadName.equals(plasmaSwitchboardConstants.CRAWLJOB_LOCAL_CRAWL) && (busysleep < 50)) busysleep = 50;
sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq); sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq);
} }
} }
prop.put("table_" + c + "_idlesleep", idlesleep); prop.put("table_" + c + "_idlesleep", idlesleep);
prop.put("table_" + c + "_busysleep", busysleep); prop.put("table_" + c + "_busysleep", busysleep);
prop.put("table_" + c + "_memprereq", memprereq / 1024); prop.put("table_" + c + "_memprereq", memprereq / 1024);
// disallow setting of memprereq for indexer to prevent db from throwing OOMs // disallow setting of memprereq for indexer to prevent db from throwing OOMs
prop.put("table_" + c + "_disabled", /*(threadName.endsWith("_indexing")) ? 1 :*/ "0"); // prop.put("table_" + c + "_disabled", /*(threadName.endsWith("_indexing")) ? 1 :*/ "0");
prop.put("table_" + c + "_recommendation", threadName.endsWith("_indexing") ? "1" : "0"); prop.put("table_" + c + "_disabled", threadName.equals("10_httpd") ? "1" : "0" ); // httpd hardcoded defaults
prop.putNum("table_" + c + "_recommendation_value", threadName.endsWith("_indexing") ? (indexSegment.termIndex().minMem() / 1024) : 0); prop.put("table_" + c + "_recommendation", threadName.endsWith("_indexing") ? "1" : "0");
c++; prop.putNum("table_" + c + "_recommendation_value", threadName.endsWith("_indexing") ? (indexSegment.termIndex().minMem() / 1024) : 0);
} c++;
prop.put("table", c); }
prop.put("table", c);
// performance profiles
c = 0; // performance profiles
final String usedfile = sb.getConfig("performanceProfile", "defaults/yacy.init"); c = 0;
for(final String filename: performanceProfiles.keySet()) { final String usedfile = sb.getConfig("performanceProfile", "defaults/yacy.init");
prop.put("profile_" + c + "_filename", filename); for(final String filename: performanceProfiles.keySet()) {
prop.put("profile_" + c + "_description", performanceProfiles.get(filename)); prop.put("profile_" + c + "_filename", filename);
prop.put("profile_" + c + "_used", usedfile.equalsIgnoreCase(filename) ? "1" : "0"); prop.put("profile_" + c + "_description", performanceProfiles.get(filename));
c++; prop.put("profile_" + c + "_used", usedfile.equalsIgnoreCase(filename) ? "1" : "0");
} c++;
prop.put("profile", c); }
prop.put("profile", c);
c = 0;
final int[] speedValues = {200,150,100,50,25,10}; c = 0;
final int usedspeed = sb.getConfigInt("performanceSpeed", 100); final int[] speedValues = {200,150,100,50,25,10};
for(final int speed: speedValues){ final int usedspeed = sb.getConfigInt("performanceSpeed", 100);
prop.put("speed_" + c + "_value", speed); for(final int speed: speedValues){
prop.put("speed_" + c + "_label", speed + " %"); prop.put("speed_" + c + "_value", speed);
prop.put("speed_" + c + "_used", (speed == usedspeed) ? "1" : "0"); prop.put("speed_" + c + "_label", speed + " %");
c++; prop.put("speed_" + c + "_used", (speed == usedspeed) ? "1" : "0");
} c++;
prop.put("speed", c); }
prop.put("speed", c);
if ((post != null) && (post.containsKey("cacheSizeSubmit"))) {
final int wordCacheMaxCount = post.getInt("wordCacheMaxCount", 20000); if ((post != null) && (post.containsKey("cacheSizeSubmit"))) {
sb.setConfig(SwitchboardConstants.WORDCACHE_MAX_COUNT, Integer.toString(wordCacheMaxCount)); final int wordCacheMaxCount = post.getInt("wordCacheMaxCount", 20000);
indexSegment.termIndex().setBufferMaxWordCount(wordCacheMaxCount); sb.setConfig(SwitchboardConstants.WORDCACHE_MAX_COUNT, Integer.toString(wordCacheMaxCount));
} indexSegment.termIndex().setBufferMaxWordCount(wordCacheMaxCount);
}
if ((post != null) && (post.containsKey("poolConfig"))) {
if ((post != null) && (post.containsKey("poolConfig"))) {
/*
* configuring the crawler pool /*
*/ * configuring the crawler pool
// get the current crawler pool configuration */
int maxBusy = post.getInt("Crawler Pool_maxActive", 8); // get the current crawler pool configuration
int maxBusy = post.getInt("Crawler Pool_maxActive", 8);
// storing the new values into configfile
sb.setConfig(SwitchboardConstants.CRAWLER_THREADS_ACTIVE_MAX,maxBusy); // storing the new values into configfile
//switchboard.setConfig("crawler.MinIdleThreads",minIdle); sb.setConfig(SwitchboardConstants.CRAWLER_THREADS_ACTIVE_MAX,maxBusy);
//switchboard.setConfig("crawler.MinIdleThreads",minIdle);
/*
* configuring the http pool /*
*/ * configuring the http pool
final WorkflowThread httpd = sb.getThread("10_httpd"); */
try { final WorkflowThread httpd = sb.getThread("10_httpd");
maxBusy = post.getInt("httpd Session Pool_maxActive", 8); try {
} catch (final NumberFormatException e) { maxBusy = post.getInt("httpd Session Pool_maxActive", 8);
maxBusy = 8; } catch (final NumberFormatException e) {
} maxBusy = 8;
}
((serverCore)httpd).setMaxSessionCount(maxBusy);
((serverCore)httpd).setMaxSessionCount(maxBusy);
// storing the new values into configfile
sb.setConfig("httpdMaxBusySessions",maxBusy); // storing the new values into configfile
sb.setConfig("httpdMaxBusySessions",maxBusy);
}
}
if ((post != null) && (post.containsKey("PrioritySubmit"))) {
sb.setConfig("javastart_priority",post.get("YaCyPriority","0")); if ((post != null) && (post.containsKey("PrioritySubmit"))) {
} sb.setConfig("javastart_priority",post.get("YaCyPriority","0"));
}
if ((post != null) && (post.containsKey("onlineCautionSubmit"))) {
sb.setConfig(SwitchboardConstants.PROXY_ONLINE_CAUTION_DELAY, Integer.toString(post.getInt("crawlPauseProxy", 30000))); if ((post != null) && (post.containsKey("onlineCautionSubmit"))) {
sb.setConfig(SwitchboardConstants.LOCALSEACH_ONLINE_CAUTION_DELAY, Integer.toString(post.getInt("crawlPauseLocalsearch", 30000))); sb.setConfig(SwitchboardConstants.PROXY_ONLINE_CAUTION_DELAY, Integer.toString(post.getInt("crawlPauseProxy", 30000)));
sb.setConfig(SwitchboardConstants.REMOTESEARCH_ONLINE_CAUTION_DELAY, Integer.toString(post.getInt("crawlPauseRemotesearch", 30000))); sb.setConfig(SwitchboardConstants.LOCALSEACH_ONLINE_CAUTION_DELAY, Integer.toString(post.getInt("crawlPauseLocalsearch", 30000)));
} sb.setConfig(SwitchboardConstants.REMOTESEARCH_ONLINE_CAUTION_DELAY, Integer.toString(post.getInt("crawlPauseRemotesearch", 30000)));
}
if ((post != null) && (post.containsKey("minimumDeltaSubmit"))) {
final int minimumLocalDelta = post.getInt("minimumLocalDelta", sb.crawlQueues.noticeURL.getMinimumLocalDelta()); if ((post != null) && (post.containsKey("minimumDeltaSubmit"))) {
final int minimumGlobalDelta = post.getInt("minimumGlobalDelta", sb.crawlQueues.noticeURL.getMinimumGlobalDelta()); final int minimumLocalDelta = post.getInt("minimumLocalDelta", sb.crawlQueues.noticeURL.getMinimumLocalDelta());
sb.setConfig("minimumLocalDelta", minimumLocalDelta); final int minimumGlobalDelta = post.getInt("minimumGlobalDelta", sb.crawlQueues.noticeURL.getMinimumGlobalDelta());
sb.setConfig("minimumGlobalDelta", minimumGlobalDelta); sb.setConfig("minimumLocalDelta", minimumLocalDelta);
sb.crawlQueues.noticeURL.setMinimumDelta(minimumLocalDelta, minimumGlobalDelta); sb.setConfig("minimumGlobalDelta", minimumGlobalDelta);
} sb.crawlQueues.noticeURL.setMinimumDelta(minimumLocalDelta, minimumGlobalDelta);
}
// delta settings
prop.put("minimumLocalDelta", sb.crawlQueues.noticeURL.getMinimumLocalDelta()); // delta settings
prop.put("minimumGlobalDelta", sb.crawlQueues.noticeURL.getMinimumGlobalDelta()); prop.put("minimumLocalDelta", sb.crawlQueues.noticeURL.getMinimumLocalDelta());
prop.put("minimumGlobalDelta", sb.crawlQueues.noticeURL.getMinimumGlobalDelta());
// table cache settings
prop.putNum("wordCacheSize", indexSegment.RWIBufferCount()); // table cache settings
prop.putNum("wordCacheSizeKBytes", indexSegment.termIndex().getBufferSizeBytes()/1024); prop.putNum("wordCacheSize", indexSegment.RWIBufferCount());
prop.putNum("maxURLinCache", indexSegment.termIndex().getBufferMaxReferences()); prop.putNum("wordCacheSizeKBytes", indexSegment.termIndex().getBufferSizeBytes()/1024);
prop.putNum("maxAgeOfCache", indexSegment.termIndex().getBufferMaxAge() / 1000 / 60); // minutes prop.putNum("maxURLinCache", indexSegment.termIndex().getBufferMaxReferences());
prop.putNum("minAgeOfCache", indexSegment.termIndex().getBufferMinAge() / 1000 / 60); // minutes prop.putNum("maxAgeOfCache", indexSegment.termIndex().getBufferMaxAge() / 1000 / 60); // minutes
prop.putNum("maxWaitingWordFlush", sb.getConfigLong("maxWaitingWordFlush", 180)); prop.putNum("minAgeOfCache", indexSegment.termIndex().getBufferMinAge() / 1000 / 60); // minutes
prop.put("wordCacheMaxCount", sb.getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 20000)); prop.putNum("maxWaitingWordFlush", sb.getConfigLong("maxWaitingWordFlush", 180));
prop.put("crawlPauseProxy", sb.getConfigLong(SwitchboardConstants.PROXY_ONLINE_CAUTION_DELAY, 30000)); prop.put("wordCacheMaxCount", sb.getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 20000));
prop.put("crawlPauseLocalsearch", sb.getConfigLong(SwitchboardConstants.LOCALSEACH_ONLINE_CAUTION_DELAY, 30000)); prop.put("crawlPauseProxy", sb.getConfigLong(SwitchboardConstants.PROXY_ONLINE_CAUTION_DELAY, 30000));
prop.put("crawlPauseRemotesearch", sb.getConfigLong(SwitchboardConstants.REMOTESEARCH_ONLINE_CAUTION_DELAY, 30000)); prop.put("crawlPauseLocalsearch", sb.getConfigLong(SwitchboardConstants.LOCALSEACH_ONLINE_CAUTION_DELAY, 30000));
prop.putNum("crawlPauseProxyCurrent", (System.currentTimeMillis() - sb.proxyLastAccess) / 1000); prop.put("crawlPauseRemotesearch", sb.getConfigLong(SwitchboardConstants.REMOTESEARCH_ONLINE_CAUTION_DELAY, 30000));
prop.putNum("crawlPauseLocalsearchCurrent", (System.currentTimeMillis() - sb.localSearchLastAccess) / 1000); prop.putNum("crawlPauseProxyCurrent", (System.currentTimeMillis() - sb.proxyLastAccess) / 1000);
prop.putNum("crawlPauseRemotesearchCurrent", (System.currentTimeMillis() - sb.remoteSearchLastAccess) / 1000); prop.putNum("crawlPauseLocalsearchCurrent", (System.currentTimeMillis() - sb.localSearchLastAccess) / 1000);
prop.putNum("crawlPauseRemotesearchCurrent", (System.currentTimeMillis() - sb.remoteSearchLastAccess) / 1000);
// table thread pool settings
prop.put("pool_0_name","Crawler Pool"); // table thread pool settings
prop.put("pool_0_maxActive", sb.getConfigLong("crawler.MaxActiveThreads", 0)); prop.put("pool_0_name","Crawler Pool");
prop.put("pool_0_numActive",sb.crawlQueues.workerSize()); prop.put("pool_0_maxActive", sb.getConfigLong("crawler.MaxActiveThreads", 0));
prop.put("pool_0_numActive",sb.crawlQueues.workerSize());
final WorkflowThread httpd = sb.getThread("10_httpd");
prop.put("pool_1_name", "httpd Session Pool"); final WorkflowThread httpd = sb.getThread("10_httpd");
prop.put("pool_1_maxActive", ((serverCore)httpd).getMaxSessionCount()); prop.put("pool_1_name", "httpd Session Pool");
prop.put("pool_1_numActive", ((serverCore)httpd).getJobCount()); prop.put("pool_1_maxActive", ((serverCore)httpd).getMaxSessionCount());
prop.put("pool_1_numActive", ((serverCore)httpd).getJobCount());
prop.put("pool", "2");
prop.put("pool", "2");
final long curr_prio = sb.getConfigLong("javastart_priority",0);
prop.put("priority_normal",(curr_prio == 0) ? "1" : "0"); final long curr_prio = sb.getConfigLong("javastart_priority",0);
prop.put("priority_below",(curr_prio == 10) ? "1" : "0"); prop.put("priority_normal",(curr_prio == 0) ? "1" : "0");
prop.put("priority_low",(curr_prio == 20) ? "1" : "0"); 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", "Xmx600m").substring(3); // parse initialization memory settings
prop.put("Xmx", Xmx.substring(0, Xmx.length() - 1)); final String Xmx = sb.getConfig("javastart_Xmx", "Xmx600m").substring(3);
final String Xms = sb.getConfig("javastart_Xms", "Xms600m").substring(3); prop.put("Xmx", Xmx.substring(0, Xmx.length() - 1));
prop.put("Xms", Xms.substring(0, Xms.length() - 1)); final String Xms = sb.getConfig("javastart_Xms", "Xms600m").substring(3);
prop.put("Xms", Xms.substring(0, Xms.length() - 1));
final long diskFree = sb.getConfigLong(SwitchboardConstants.DISK_FREE, 3000L);
final long diskFreeHardlimit = sb.getConfigLong(SwitchboardConstants.DISK_FREE_HARDLIMIT, 1000L); final long diskFree = sb.getConfigLong(SwitchboardConstants.DISK_FREE, 3000L);
final long memoryAcceptDHT = sb.getConfigLong(SwitchboardConstants.MEMORY_ACCEPTDHT, 50000L); final long diskFreeHardlimit = sb.getConfigLong(SwitchboardConstants.DISK_FREE_HARDLIMIT, 1000L);
final boolean observerTrigger = !MemoryControl.properState(); final long memoryAcceptDHT = sb.getConfigLong(SwitchboardConstants.MEMORY_ACCEPTDHT, 50000L);
prop.put("diskFree", diskFree); final boolean observerTrigger = !MemoryControl.properState();
prop.put("diskFreeHardlimit", diskFreeHardlimit); prop.put("diskFree", diskFree);
prop.put("memoryAcceptDHT", memoryAcceptDHT); prop.put("diskFreeHardlimit", diskFreeHardlimit);
if(observerTrigger) prop.put("observerTrigger", "1"); prop.put("memoryAcceptDHT", memoryAcceptDHT);
if(observerTrigger) prop.put("observerTrigger", "1");
// return rewrite values for templates
return prop; // return rewrite values for templates
} return prop;
}
private static String d(final String a, final String b) {
return (a == null) ? b : a; private static String d(final String a, final String b) {
} return (a == null) ? b : a;
} }
}

Loading…
Cancel
Save