*) added possibility to set YaCy-Priority

-> Linux-startscript has to be updated

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3148 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
auron_x 18 years ago
parent a2daa9f88c
commit 7e12954634

@ -205,6 +205,27 @@
</table> </table>
</form> </form>
<p>
<strong>YaCy Priority Settings:</strong>
</p>
<form action="PerformanceQueues_p.html" method="post" enctype="multipart/form-data">
<fieldset>
<dl>
<dt>YaCy Process Priority:</dt>
<dd><select name="YaCyPriority">
<option value="-20"#(priority_realtime)#:: selected="selected"#(/priority_realtime)#>Realtime</option>
<option value="-15"#(priority_high)#:: selected="selected"#(/priority_high)#>High</option>
<option value="-10"#(priority_above)#:: selected="selected"#(/priority_above)#>Above normal</option>
<option value="0"#(priority_normal)#:: selected="selected"#(/priority_normal)#>Normal</option>
<option value="10"#(priority_below)#:: selected="selected"#(/priority_below)#>Below normal</option>
<option value="20"#(priority_low)#:: selected="selected"#(/priority_low)#>Idle</option>
</select></dd>
<dt><input type="submit" name="PrioritySubmit" value="Set new Priority" /></dt>
<dd>Changes take effect after <strong>restart</strong> of YaCy</dd>
</dl>
</fieldset>
</form>
<p> <p>
<strong>Proxy Performance Settings:</strong> <strong>Proxy Performance Settings:</strong>
</p> </p>

@ -256,6 +256,10 @@ public class PerformanceQueues_p {
switchboard.setConfig("stacker.MinIdleThreads",minIdle); switchboard.setConfig("stacker.MinIdleThreads",minIdle);
} }
if ((post != null) && (post.containsKey("PrioritySubmit"))) {
switchboard.setConfig("javastart_priority",post.get("YaCyPriority","0"));
}
if ((post != null) && (post.containsKey("proxyControlSubmit"))) { if ((post != null) && (post.containsKey("proxyControlSubmit"))) {
int onlineCautionDelay = post.getInt("onlineCautionDelay", 30000); int onlineCautionDelay = post.getInt("onlineCautionDelay", 30000);
switchboard.setConfig("onlineCautionDelay", Integer.toString(onlineCautionDelay)); switchboard.setConfig("onlineCautionDelay", Integer.toString(onlineCautionDelay));
@ -308,7 +312,15 @@ public class PerformanceQueues_p {
prop.put("pool_2_minIdle",stackerPoolConfig.minIdle); prop.put("pool_2_minIdle",stackerPoolConfig.minIdle);
prop.put("pool_2_numActive",switchboard.sbStackCrawlThread.getNumActiveWorker()); prop.put("pool_2_numActive",switchboard.sbStackCrawlThread.getNumActiveWorker());
prop.put("pool_2_numIdle",switchboard.sbStackCrawlThread.getNumIdleWorker()); prop.put("pool_2_numIdle",switchboard.sbStackCrawlThread.getNumIdleWorker());
prop.put("pool",3); prop.put("pool",3);
long curr_prio = switchboard.getConfigLong("javastart_priority",0);
prop.put("priority_realtime",(curr_prio==-20)?1:0);
prop.put("priority_high",(curr_prio==-15)?1:0);
prop.put("priority_above",(curr_prio==-10)?1:0);
prop.put("priority_normal",(curr_prio==0)?1:0);
prop.put("priority_below",(curr_prio==10)?1:0);
prop.put("priority_low",(curr_prio==20)?1:0);
// return rewrite values for templates // return rewrite values for templates
return prop; return prop;

@ -12,12 +12,14 @@ REM Please change the "javastart" settings in the web-interface "Basic Configura
set jmx= set jmx=
set jms= set jms=
set javacmd=-Xmx64m -Xms10m set javacmd=-Xmx64m -Xms10m
if exist DATA\SETTINGS\httpProxy.conf GoTo :GETJAVACMD set priority=/NORMAL
if exist DATA\SETTINGS\httpProxy.conf GoTo :GETSTARTOPTS
:STARTJAVA :STARTJAVA
Rem Starting YaCy Rem Starting YaCy
Echo Generated classpath:%CLASSPATH% Echo Generated classpath:%CLASSPATH%
Echo JRE Parameters:%javacmd% Echo JRE Parameters:%javacmd%
Echo Priority:%priority%
Echo ****************** YaCy Web Crawler/Indexer ^& Search Engine ******************* Echo ****************** YaCy Web Crawler/Indexer ^& Search Engine *******************
Echo **** (C) by Michael Peter Christen, usage granted under the GPL Version 2 **** Echo **** (C) by Michael Peter Christen, usage granted under the GPL Version 2 ****
@ -28,20 +30,28 @@ Echo JRE Parameters:%javacmd%
Echo ******************************************************************************* Echo *******************************************************************************
Echo ^>^> YaCy started as daemon process. Administration at http://localhost:%port% ^<^< Echo ^>^> YaCy started as daemon process. Administration at http://localhost:%port% ^<^<
java %javacmd% -classpath %CLASSPATH% yacy start "YaCy" %priority% java %javacmd% -classpath %CLASSPATH% yacy
GoTo :END GoTo :END
Rem This target is used to read java runtime parameters out of the yacy config file Rem This target is used to read java runtime parameters out of the yacy config file
:GETJAVACMD :GETSTARTOPTS
for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\httpProxy.conf) do ( for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\httpProxy.conf) do (
if "%%i"=="javastart_Xmx" set jmx=%%j if "%%i"=="javastart_Xmx" set jmx=%%j
if "%%i"=="javastart_Xms" set jms=%%j if "%%i"=="javastart_Xms" set jms=%%j
if "%%i"=="port" set port=%%j if "%%i"=="port" set port=%%j
if "%%i"=="javastart_priority" set priolvl=%%j
) )
if defined jmx set javacmd=-%jmx% if defined jmx set javacmd=-%jmx%
if defined jms set javacmd=-%jms% %javacmd% if defined jms set javacmd=-%jms% %javacmd%
if not defined port set port=8080 if not defined port set port=8080
if defined priolvl (
if %priolvl% == 20 set priority=/LOW
if %priolvl% == 10 set priority=/BELOWNORMAL
if %priolvl% == -10 set priority=/ABOVENORMAL
if %priolvl% == -15 set priority=/HIGH
if %priolvl% == -20 set priority=/REALTIME
)
GoTo :STARTJAVA GoTo :STARTJAVA
@ -51,5 +61,3 @@ Set CLASSPATH=%CLASSPATH%;%2
Rem Target needed to jump to the end of the file Rem Target needed to jump to the end of the file
:END :END

@ -1,4 +1,6 @@
@Echo Off @Echo Off
title YaCy
If %1.==CPGEN. GoTo :CPGEN If %1.==CPGEN. GoTo :CPGEN
Rem Generating the proper classpath unsing loops and labels Rem Generating the proper classpath unsing loops and labels
@ -6,28 +8,39 @@ Set CLASSPATH=classes;htroot
For %%X in (lib/*.jar) Do Call %0 CPGEN lib\%%X For %%X in (lib/*.jar) Do Call %0 CPGEN lib\%%X
For %%X in (libx/*.jar) Do Call %0 CPGEN libx\%%X For %%X in (libx/*.jar) Do Call %0 CPGEN libx\%%X
REM Please change the "javastart" settings in the web-interface "Basic Configuration" -> "Advanced"
set jmx= set jmx=
set jms= set jms=
set javacmd=-Xmx64m -Xms10m set javacmd=-Xmx64m -Xms10m
if exist DATA\SETTINGS\httpProxy.conf GoTo :GETJAVACMD set priority=/NORMAL
if exist DATA\SETTINGS\httpProxy.conf GoTo :GETSTARTOPTS
:STARTJAVA :STARTJAVA
Rem Starting yacy Rem Starting YaCy
Echo Generated Classpath:%CLASSPATH% Echo Generated classpath:%CLASSPATH%
Echo JRE Parameters:%javacmd% Echo JRE Parameters:%javacmd%
javaw %javacmd% -classpath %CLASSPATH% yacy Echo Priority:%priority%
Echo You can close the console safely start %priority% javaw %javacmd% -classpath %CLASSPATH% yacy
Echo You can close the console safely now.
GoTo :END GoTo :END
Rem This target is used to read java runtime parameters out of the yacy config file Rem This target is used to read java runtime parameters out of the yacy config file
:GETJAVACMD :GETSTARTOPTS
for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\httpProxy.conf) do ( for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\httpProxy.conf) do (
if "%%i"=="javastart_Xmx" set jmx=%%j if "%%i"=="javastart_Xmx" set jmx=%%j
if "%%i"=="javastart_Xms" set jms=%%j if "%%i"=="javastart_Xms" set jms=%%j
if "%%i"=="javastart_priority" set priolvl=%%j
) )
if defined jmx set javacmd=-%jmx% if defined jmx set javacmd=-%jmx%
if defined jms set javacmd=-%jms% %javacmd% if defined jms set javacmd=-%jms% %javacmd%
if defined priolvl (
if %priolvl% == 20 set priority=/LOW
if %priolvl% == 10 set priority=/BELOWNORMAL
if %priolvl% == -10 set priority=/ABOVENORMAL
if %priolvl% == -15 set priority=/HIGH
if %priolvl% == -20 set priority=/REALTIME
)
GoTo :STARTJAVA GoTo :STARTJAVA
@ -36,4 +49,4 @@ Rem This target is used to concatenate the classpath parts
Set CLASSPATH=%CLASSPATH%;%2 Set CLASSPATH=%CLASSPATH%;%2
Rem Target needed to jump to the end of the file Rem Target needed to jump to the end of the file
:END :END

@ -568,7 +568,7 @@ ramCacheProfiles = 8192
ramCacheProfiles_time= 500 ramCacheProfiles_time= 500
# default memory settings for startup of yacy # default memory settings for startup of yacy
# is only valid in unix/shell environments and # is valid in unix/shell and windows environments but
# not for first startup of YaCy # not for first startup of YaCy
# -Xmx<size> set maximum Java heap size # -Xmx<size> set maximum Java heap size
@ -577,6 +577,13 @@ javastart_Xmx=Xmx96m
# -Xms<size> set initial Java heap size # -Xms<size> set initial Java heap size
javastart_Xms=Xms96m javastart_Xms=Xms96m
# priority of the yacy-process
# is valid in unix/shell and windows environments but
# not for first startup of YaCy
# UNIX: corresponds to the nice-level
# WIN: -20=realtime;-15=high;-10=above;0=normal;10=below;20=low
javastart_priority=0
# performance properties for the word index cache # performance properties for the word index cache
# wordCacheMaxLow/High is the number of word indexes that shall be held in the # wordCacheMaxLow/High 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

Loading…
Cancel
Save