From: <th...@us...> - 2010-04-13 16:22:20
|
Revision: 1812 http://azsmrc.svn.sourceforge.net/azsmrc/?rev=1812&view=rev Author: the8472 Date: 2010-04-13 16:22:14 +0000 (Tue, 13 Apr 2010) Log Message: ----------- looks like connection attempts are the actual bottleneck, adjust limits accordingly Modified Paths: -------------- mldht/trunk/DHTIndexer.jar mldht/trunk/lbms/plugins/mldht/indexer/TorrentFinder.java Modified: mldht/trunk/DHTIndexer.jar =================================================================== (Binary files differ) Modified: mldht/trunk/lbms/plugins/mldht/indexer/TorrentFinder.java =================================================================== --- mldht/trunk/lbms/plugins/mldht/indexer/TorrentFinder.java 2010-04-13 02:21:57 UTC (rev 1811) +++ mldht/trunk/lbms/plugins/mldht/indexer/TorrentFinder.java 2010-04-13 16:22:14 UTC (rev 1812) @@ -38,7 +38,9 @@ } - public static final int MAX_CONCURRENT_METADATA_CONNECTIONS = 30; + public static final int MAX_CONCURRENT_METADATA_CONNECTIONS = 90; + public static final int MAX_PREFETCH = 30; + AtomicInteger activeLookups = new AtomicInteger(); AtomicInteger activeConnections = new AtomicInteger(); ConcurrentLinkedQueue<FetchTask> tasks = new ConcurrentLinkedQueue<FetchTask>(); @@ -63,7 +65,7 @@ maxConcurrentLookups = newMaxLookups; - while(tasks.size() < MAX_CONCURRENT_METADATA_CONNECTIONS && activeLookups.get() < maxConcurrentLookups && doLookup()); + while(tasks.size() < MAX_PREFETCH && activeLookups.get() < maxConcurrentLookups && doLookup()); while(activeConnections.get() < MAX_CONCURRENT_METADATA_CONNECTIONS && tasks.size() > 0 && fetchMetadata()); } }, 20, 3, TimeUnit.SECONDS); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |