Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 95695 invoked from network); 4 Sep 2008 13:33:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2008 13:33:51 -0000 Received: (qmail 11972 invoked by uid 500); 4 Sep 2008 13:33:47 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 11956 invoked by uid 500); 4 Sep 2008 13:33:47 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 11945 invoked by uid 99); 4 Sep 2008 13:33:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 06:33:47 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tomek.maciejewski@gmail.com designates 209.85.217.11 as permitted sender) Received: from [209.85.217.11] (HELO mail-gx0-f11.google.com) (209.85.217.11) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 13:32:47 +0000 Received: by gxk4 with SMTP id 4so6236330gxk.22 for ; Thu, 04 Sep 2008 06:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Z6UjvjW1SzWxflQ1vO0v3J8GupOLjM/Q5voiku5xJvM=; b=c5D0ETCsuLiEjbLIybE8/5kR7wu68+m6dgF8DYT1sbagT/Fcnd330/aq/KhhHlYt5U v5zDJFnRPaRWQpON4Bu27GG4UCRFg3XnKgoVu0r1nQc9txvJZsOJ4aj7ZvRmTuMOem2I py+7tEyTxjC15KF7L1X2qB0syy866SsWcpDfk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=uaT7Ef0Exb2p0GGs2smPWHw1nCf15VdM4uRp6AR7tK1Nf5+Wa4Z47kL7W4qHyff8ZS pWT9t4WwfKg3aGG2z2Sw//K1qayndyBTyzBxIczV2VzBFYXJXpKGScj9lzvZcyBht41U vs3rSAhwK+jDaNj16S6pnf8SiucRTDU/LuNfE= Received: by 10.151.78.15 with SMTP id f15mr14475143ybl.99.1220535136973; Thu, 04 Sep 2008 06:32:16 -0700 (PDT) Received: from ?137.122.147.13? ( [137.122.147.13]) by mx.google.com with ESMTPS id p31sm15762188qbp.18.2008.09.04.06.32.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Sep 2008 06:32:15 -0700 (PDT) Message-ID: <48BFE3A5.7040903@gmail.com> Date: Thu, 04 Sep 2008 09:33:25 -0400 From: Tomek Maciejewski User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: HttpClient User Discussion Subject: Re: BindException problem in multithreaded http client References: <1220379100.22582.6.camel@ubuntu> <48BD9E26.7020103@gmail.com> <1220389158.30120.6.camel@ubuntu> <48BDB6CB.8070700@gmail.com> <1220437631.6655.5.camel@ubuntu> <1220445092.6655.17.camel@ubuntu> <48BEED92.2070501@gmail.com> <1220475322.6245.13.camel@ubuntu> In-Reply-To: <1220475322.6245.13.camel@ubuntu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks Oleg, I supposed it could be a problem. I will change crawler architecture a little, to generate less connections simultaneously. So OS will have more time to release the sockets. I saw that it is possible to change the number of client ports in WinXP but I'm not sure if it would be a proper way to deal with this kind of problem. Cheers, Tomek Oleg Kalnichevski wrote: > On Wed, 2008-09-03 at 16:03 -0400, Tomek Maciejewski wrote: > >> Hi Oleg, >> >> Thank for your reply. I have got the latest code from repository, but >> the problem didn't disappear. I saved the logs here: >> http://pentium.hopto.org/~thinred/files/output.zip >> At the end of the crawler execution I started to get BindException. I >> would appreciate if you could see this logs, because actually I don't >> understand what is a relation between not reused connections and this >> bind exception. What is the nature of this problem, and why it tries to >> bind to 'address already in use'? Is there any way to solve this problem? >> >> Cheers, >> Tomek >> >> >> > > It is all pretty simple. Please examine response messages in the log. > Most of them (if not all) have "Connection: close" header, which means > the server does not want the connection to be kept alive. As a result > connections do not get reused. Every time a new request is executed, a > new socket has to be open. Every time a new socket is open, a client > port has to be allocated. Windows (per default) allocates the range from > 1024 to 5000 for client ports. It usually takes a while before a used > client port gets released back to the pool. If you execute 4000 requests > in a tight loop you are pretty much bound to run out of client ports and > end up with a bunch of BindExceptions > > Hope this helps > > Oleg > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org > For additional commands, e-mail: httpclient-users-help@hc.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org