In my code there is loop which builds the Futures, which is way to slow. It takes about hundreds of milliseconds to build just 1 Future. I'am just talking about setting up the Future object and not about getting the Reponse. Here's the code:
while(settings.getCrawlerQueue().size() < settings.getCrawlerQueueSize()) {
Task task = taskQueue.poll();
task = setFutureInTask(assignment, task);
}
And the setFutureInTask()
code:
public Task setFutureInTask(String assignment, Task task) {
task.setParserAssignment(assignment);
switch(assignment){
case "stuff":
task.setFuture(asyncClientStandard
.prepareGet("http://"+task.getDomain())
.execute()
);
break;
[...]
I tried different Java JDKs and versions as suggest in some stuff that I read (can't find it :/ ), but that doesn't help. Also tried JDKAsyncHttpProvider
instead of the default NettyAsyncHttpProvider
, which is way faster, but also provides very much Flase-Negatives (it seems to cancel very(!) often valid domains).
What I have noticed is: I live in Germany and german .de-domains are noticeable faster than domains from orther countries like Spain.
Any wild guess is highly appreciated! :)
[EDIT]
Simply switching to another DNS server solved the problem.