- changed default memory to 500m

- now xms is lower than xmx (lets try what happens)
- removed default path for intranet crawl starts to avoid confusion as seen on linuxtag
- added time-out to upnp request (i have a new router which may need that)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6916 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 0f3a3e34e1
commit 353a924760

@ -603,7 +603,7 @@ cleanup.deletionPublishedNews = true
# -Xmx<size> and -Xms<size> maximum/init Java heap size # -Xmx<size> and -Xms<size> maximum/init Java heap size
# both values should be equal, # both values should be equal,
# othervise the YaCy-internal memory supervision does not work # othervise the YaCy-internal memory supervision does not work
javastart_Xmx=Xmx180m javastart_Xmx=Xmx600m
javastart_Xms=Xms180m javastart_Xms=Xms180m
# YaCy is able to use RAM copies of database tables. This needs a lot of RAM # YaCy is able to use RAM copies of database tables. This needs a lot of RAM

@ -26,7 +26,6 @@
import de.anomic.crawler.CrawlProfile; import de.anomic.crawler.CrawlProfile;
import de.anomic.http.server.RequestHeader; import de.anomic.http.server.RequestHeader;
import de.anomic.search.Switchboard;
import de.anomic.search.SwitchboardConstants; import de.anomic.search.SwitchboardConstants;
import de.anomic.server.serverObjects; import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch; import de.anomic.server.serverSwitch;
@ -35,17 +34,17 @@ public class CrawlStart_p {
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();
// define visible variables // define visible variables
String a = sb.peers.mySeed().getPublicAddress(); //String a = sb.peers.mySeed().getPublicAddress();
boolean intranet = sb.getConfig(SwitchboardConstants.NETWORK_NAME, "").equals("intranet"); //boolean intranet = sb.getConfig(SwitchboardConstants.NETWORK_NAME, "").equals("intranet");
String repository = "http://" + ((a == null) ? "localhost:" + sb.getConfig("port", "8080") : a) + "/repository/"; //String repository = "http://" + ((a == null) ? "localhost:" + sb.getConfig("port", "8080") : a) + "/repository/";
prop.put("starturl", (intranet) ? repository : "http://"); prop.put("starturl", /*(intranet) ? repository :*/ "http://");
prop.put("proxyPrefetchDepth", env.getConfig("proxyPrefetchDepth", "0")); prop.put("proxyPrefetchDepth", env.getConfig("proxyPrefetchDepth", "0"));
prop.put("crawlingDepth", env.getConfig("crawlingDepth", "0")); prop.put("crawlingDepth", env.getConfig("crawlingDepth", "0"));
prop.put("mustmatch", (intranet) ? repository + ".*" : CrawlProfile.MATCH_ALL); prop.put("mustmatch", /*(intranet) ? repository + ".*" :*/ CrawlProfile.MATCH_ALL);
prop.put("mustnotmatch", CrawlProfile.MATCH_NEVER); prop.put("mustnotmatch", CrawlProfile.MATCH_NEVER);
prop.put("crawlingIfOlderCheck", "0"); prop.put("crawlingIfOlderCheck", "0");

@ -84,14 +84,13 @@ public class PerformanceQueues_p {
} }
} }
if (post.containsKey("Xmx")) { if (post.containsKey("Xmx")) {
int xmx = 180; // default maximum heap size int xmx = post.getInt("Xmx", 500); // default maximum heap size
try { xmx = Integer.parseInt(post.get("Xmx", Integer.toString(xmx))); } catch (final NumberFormatException e){} if (OS.isWin32) xmx = Math.min(2000, xmx);
if (!(OS.isWin32 && xmx >= 2000)){ int xms = xmx / 4;
sb.setConfig("javastart_Xmx", "Xmx" + xmx + "m"); sb.setConfig("javastart_Xmx", "Xmx" + xmx + "m");
sb.setConfig("javastart_Xms", "Xms" + xmx + "m"); sb.setConfig("javastart_Xms", "Xms" + xms + "m");
prop.put("setStartupCommit", "1"); prop.put("setStartupCommit", "1");
} }
}
if(post.containsKey("diskFree")) { if(post.containsKey("diskFree")) {
int diskFree = 3000; // default int diskFree = 3000; // default
try { diskFree = Integer.parseInt(post.get("diskFree", Integer.toString(diskFree))); } catch (final NumberFormatException e){} try { diskFree = Integer.parseInt(post.get("diskFree", Integer.toString(diskFree))); } catch (final NumberFormatException e){}
@ -354,9 +353,9 @@ public class PerformanceQueues_p {
prop.put("priority_low",(curr_prio==20) ? "1" : "0"); prop.put("priority_low",(curr_prio==20) ? "1" : "0");
// parse initialization memory settings // parse initialization memory settings
final String Xmx = sb.getConfig("javastart_Xmx", "Xmx120m").substring(3); final String Xmx = sb.getConfig("javastart_Xmx", "Xmx500m").substring(3);
prop.put("Xmx", Xmx.substring(0, Xmx.length() - 1)); prop.put("Xmx", Xmx.substring(0, Xmx.length() - 1));
final String Xms = sb.getConfig("javastart_Xms", "Xms120m").substring(3); final String Xms = sb.getConfig("javastart_Xms", "Xms500m").substring(3);
prop.put("Xms", Xms.substring(0, Xms.length() - 1)); prop.put("Xms", Xms.substring(0, Xms.length() - 1));
final String diskFree = sb.getConfig(SwitchboardConstants.DISK_FREE, "3000"); final String diskFree = sb.getConfig(SwitchboardConstants.DISK_FREE, "3000");

@ -45,6 +45,9 @@
* on behalf of SuperBonBon Industries. For more information on * on behalf of SuperBonBon Industries. For more information on
* SuperBonBon Industries, please see <http://www.sbbi.net/>. * SuperBonBon Industries, please see <http://www.sbbi.net/>.
*/ */
// [MC] (C) (also) by Michael Christen: added timeout for discovery
package net.sbbi.upnp; package net.sbbi.upnp;
import java.io.IOException; import java.io.IOException;
@ -104,8 +107,14 @@ public final class DiscoveryAdvertisement implements Runnable {
private java.net.MulticastSocket skt; private java.net.MulticastSocket skt;
private DatagramPacket input; private DatagramPacket input;
private int timeout;
private DiscoveryAdvertisement() { private DiscoveryAdvertisement() {
this.timeout = 3000;
}
private DiscoveryAdvertisement(int timeout) {
this.timeout = timeout;
} }
public final static DiscoveryAdvertisement getInstance() { public final static DiscoveryAdvertisement getInstance() {
@ -231,7 +240,7 @@ public final class DiscoveryAdvertisement implements Runnable {
inService = true; inService = true;
while ( inService ) { while ( inService ) {
try { try {
listenBroadCast(); listenBroadCast(this.timeout);
} catch ( SocketTimeoutException ex ) { } catch ( SocketTimeoutException ex ) {
// ignoring // ignoring
} catch ( IOException ioEx ) { } catch ( IOException ioEx ) {
@ -253,8 +262,9 @@ public final class DiscoveryAdvertisement implements Runnable {
} }
} }
private void listenBroadCast() throws IOException { private void listenBroadCast(int timeout) throws IOException {
skt.setSoTimeout(timeout); // added by [MC]
skt.receive( input ); skt.receive( input );
InetAddress from = input.getAddress(); InetAddress from = input.getAddress();
String received = new String( input.getData(), input.getOffset(), input.getLength() ); String received = new String( input.getData(), input.getOffset(), input.getLength() );

Loading…
Cancel
Save