added performance profiles (to be fine-tuned)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4910 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
danielr 17 years ago
parent ed24eab737
commit 48f87db7f1

@ -0,0 +1,51 @@
###
### YaCy Init File with background performance-settings
###
# current: 10 times of yacy.init
# performance-settings
# delay-times for permanent loops (milliseconds)
# the idlesleep is the pause that an proces sleeps if the last call to the
# process job was without execution of anything;
# the busysleep is the pause after a full job execution
# the prereq-value is a memory pre-requisite: that much bytes must
# be available/free in the heap; othervise the loop is not executed
# and another idlesleep is performed
20_dhtdistribution_idlesleep=300000
20_dhtdistribution_busysleep=100000
20_dhtdistribution_memprereq=6291456
30_peerping_idlesleep=1200000
30_peerping_busysleep=1200000
30_peerping_memprereq=1048576
40_peerseedcycle_idlesleep=18000000
40_peerseedcycle_busysleep=12000000
40_peerseedcycle_memprereq=2097152
50_localcrawl_idlesleep=20000
50_localcrawl_busysleep=5000
50_localcrawl_busysleep__pro=500
50_localcrawl_memprereq=4194304
50_localcrawl_isPaused=false
60_remotecrawlloader_idlesleep=600000
60_remotecrawlloader_idlesleep__pro=100000
60_remotecrawlloader_busysleep=400000
60_remotecrawlloader_busysleep__pro=20000
60_remotecrawlloader_memprereq=2097152
60_remotecrawlloader_isPaused=false
62_remotetriggeredcrawl_idlesleep=100000
62_remotetriggeredcrawl_busysleep=10000
62_remotetriggeredcrawl_memprereq=6291456
62_remotetriggeredcrawl_isPaused=false
70_cachemanager_idlesleep=10000
70_cachemanager_busysleep=1000
70_cachemanager_memprereq=1048576
80_indexing_idlesleep=10000
80_indexing_busysleep=100
80_indexing_busysleep__pro=10
80_indexing_memprereq=6291456
82_crawlstack_idlesleep=50000
82_crawlstack_busysleep=100
82_crawlstack_memprereq=1048576
90_cleanup_idlesleep=3000000
90_cleanup_busysleep=3000000
90_cleanup_memprereq=0

@ -0,0 +1,51 @@
###
### YaCy Init File with background performance-settings
###
# current: 3 times of yacy.init
# performance-settings
# delay-times for permanent loops (milliseconds)
# the idlesleep is the pause that an proces sleeps if the last call to the
# process job was without execution of anything;
# the busysleep is the pause after a full job execution
# the prereq-value is a memory pre-requisite: that much bytes must
# be available/free in the heap; othervise the loop is not executed
# and another idlesleep is performed
20_dhtdistribution_idlesleep=90000
20_dhtdistribution_busysleep=30000
20_dhtdistribution_memprereq=6291456
30_peerping_idlesleep=360000
30_peerping_busysleep=360000
30_peerping_memprereq=1048576
40_peerseedcycle_idlesleep=5400000
40_peerseedcycle_busysleep=3600000
40_peerseedcycle_memprereq=2097152
50_localcrawl_idlesleep=6000
50_localcrawl_busysleep=150
50_localcrawl_busysleep__pro=3
50_localcrawl_memprereq=4194304
50_localcrawl_isPaused=false
60_remotecrawlloader_idlesleep=180000
60_remotecrawlloader_idlesleep__pro=30000
60_remotecrawlloader_busysleep=120000
60_remotecrawlloader_busysleep__pro=6000
60_remotecrawlloader_memprereq=2097152
60_remotecrawlloader_isPaused=false
62_remotetriggeredcrawl_idlesleep=30000
62_remotetriggeredcrawl_busysleep=3000
62_remotetriggeredcrawl_memprereq=6291456
62_remotetriggeredcrawl_isPaused=false
70_cachemanager_idlesleep=3000
70_cachemanager_busysleep=3
70_cachemanager_memprereq=1048576
80_indexing_idlesleep=3000
80_indexing_busysleep=30
80_indexing_busysleep__pro=3
80_indexing_memprereq=6291456
82_crawlstack_idlesleep=15000
82_crawlstack_busysleep=3
82_crawlstack_memprereq=1048576
90_cleanup_idlesleep=900000
90_cleanup_busysleep=900000
90_cleanup_memprereq=0

@ -57,9 +57,15 @@
#{/table}#
<tr class="TableCellLight">
<td align="left" colspan="19">
<input type="submit" name="submitdelay" value="Submit New Delay Values" />&nbsp;&nbsp;&nbsp;
<input type="submit" name="submitdefault" value="Reset To Default Values" />&nbsp;&nbsp;&nbsp;
Changes take effect immediately</td>
<input type="submit" name="submitdelay" value="Submit New Delay Values" />&nbsp;&nbsp;&nbsp;
Changes take effect immediately<br/>
<input type="submit" name="submitdefault" value="Use Default Profile:" />
<select type="submit" name="defaultFile">
#{profile}#
<option value="#[filename]#">#[description]#</option>
#{/profile}#
</select>
</td>
</tr>
</table>
</form>

@ -44,6 +44,7 @@
//if the shell's current path is HTROOT
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@ -58,12 +59,31 @@ import de.anomic.server.serverThread;
import de.anomic.tools.yFormatter;
public class PerformanceQueues_p {
/**
* list of pre-defined settings: filename -> description
*/
private final static Map<String, String> performanceProfiles = new HashMap<String, String>(4, 0.9f);
static {
// no sorted output!
performanceProfiles.put("defaults/background.settings", "slow (background)");
performanceProfiles.put("defaults/normal.settings", "not so fast");
performanceProfiles.put("defaults/yacy.init", "fast (YaCy only)");
}
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch<?> sb) {
// return variable that accumulates replacements
plasmaSwitchboard switchboard = (plasmaSwitchboard) sb;
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;
}
}
Map<String, String> defaultSettings = ((post == null) || (!(post.containsKey("submitdefault")))) ? null : serverFileUtils.loadHashMap(defaultSettingsFile);
Iterator<String> threads = switchboard.threadNames();
String threadName;
@ -182,6 +202,15 @@ public class PerformanceQueues_p {
}
prop.put("table", c);
// performance profiles
c = 0;
for(String filename: performanceProfiles.keySet()) {
prop.put("profile_" + c + "_filename", filename);
prop.put("profile_" + c + "_description", performanceProfiles.get(filename));
c++;
}
prop.put("profile", c);
if ((post != null) && (post.containsKey("cacheSizeSubmit"))) {
int wordCacheMaxCount = post.getInt("wordCacheMaxCount", 20000);
switchboard.setConfig(plasmaSwitchboard.WORDCACHE_MAX_COUNT, Integer.toString(wordCacheMaxCount));

Loading…
Cancel
Save