Re: Why client connection's port changed always when server support Keep-alive?

2008-12-24 Thread alin()
:27:29,963 DEBUG wire:78 -  Content-Type:
text/javascript;charset=UTF-8[EOL]
10:27:29,963 DEBUG wire:78 -  Content-Length: 85[EOL]
10:27:29,963 DEBUG wire:78 -  Vary: Accept-Encoding[EOL]
10:27:29,963 DEBUG wire:78 -  Keep-Alive: timeout=15, max=99[EOL]
10:27:29,963 DEBUG wire:78 -  Connection: Keep-Alive[EOL]
10:27:29,963 DEBUG headers:237 -  HTTP/1.1 200 OK
10:27:29,963 DEBUG headers:240 -  Date: Thu, 25 Dec 2008 02:26:40 GMT
10:27:29,963 DEBUG headers:240 -  Server: Apache-Coyote/1.1
10:27:29,963 DEBUG headers:240 -  X-Powered-By: Servlet 2.4;
JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5
10:27:29,963 DEBUG headers:240 -  Content-Type:
text/javascript;charset=UTF-8
10:27:29,963 DEBUG headers:240 -  Content-Length: 85
10:27:29,963 DEBUG headers:240 -  Vary: Accept-Encoding
10:27:29,963 DEBUG headers:240 -  Keep-Alive: timeout=15, max=99
10:27:29,963 DEBUG headers:240 -  Connection: Keep-Alive
10:27:29,963 DEBUG DefaultRequestDirector:463 - Connection can be kept alive
for 15000 ms
10:27:29,963 DEBUG wire:78 - 
{rsp:{users:[{buyer_credit:{good_num:1,level:0,score:1,total_num:1}}]}}
10:27:29,963 DEBUG ThreadSafeClientConnManager:221 - Released connection is
reusable.
10:27:29,963 DEBUG ConnPoolByRoute:374 - Releasing connection
[HttpRoute[{}-http://192.168.208.110]][null]
10:27:29,963 DEBUG ConnPoolByRoute:394 - Pooling connection [HttpRoute[{}-
http://192.168.208.110]][null]; keep alive for 15000 MILLISECONDS
10:27:29,963 DEBUG IdleConnectionHandler:78 - Adding connection at:
1230172049963
10:27:29,963 DEBUG ConnPoolByRoute:631 - Notifying no-one, there are no
waiting threads

total duration:328
httpclient4.x0--firstDuration:281
httpclient4.x0--successDuration:47,successTimes:1


On Wed, Dec 24, 2008 at 8:57 PM, Oleg Kalnichevski ol...@apache.org wrote:

 On Wed, 2008-12-24 at 09:32 +0800, alin(王霖) wrote:
  Dear Oleg:
  Thanks for your reply. And here is my simple code (usging
  httpclient4.0-beta2):
 
  private void initHttpClient() {
  SchemeRegistry schemeRegistry = new SchemeRegistry();
  schemeRegistry.register(
  new Scheme(http, PlainSocketFactory.getSocketFactory(),
  80));
  httpParams = new BasicHttpParams();
  HttpProtocolParams.setVersion(httpParams, HttpVersion.HTTP_1_1);
  this.setMaxTotalConnections(DEFAULT_MAX_TOTAL_CONNECTIONS);
  this.setReadTimeout(DEFAULT_READ_TIMEOUT);
  ClientConnectionManager cm = new ThreadSafeClientConnManager(
  httpParams, schemeRegistry);
  httpClient = new DefaultHttpClient(cm, httpParams);
  }
 

 The code looks all right to me, but it is of little use. I need to see a
 _complete_ wire / context log of the HTTP session to be able to tell why
 connections are not kept alive.

 Oleg


 
  On Tue, Dec 23, 2008 at 10:51 PM, Oleg Kalnichevski ol...@apache.org
 wrote:
 
   On Mon, 2008-12-22 at 17:46 +0800, alin(王霖) wrote:
HI:
I use httpclient3 and httpclient4 for a multi-thread load test,  and
always set http request header with Connection:Keep-Alive.
When i input command netstat -na | grep myserverhost:myserverport
 in
console(My system is windows xp + cygwin) ,  output  like following:
   
C:\Documents and Settings\lin.wanglnetstat -na | grep
   192.168.208.110:80
  TCP10.1.26.82:4159192.168.208.110:80 ESTABLISHED
  TCP10.1.26.82:4160192.168.208.110:80 ESTABLISHED
   
But the ports of client connections(here is 10.1.26.82)  is changing
   while
load test is running.
through log4j, httpclient4 told me:
   
17:33:33,049 DEBUG DefaultRequestDirector:463 - Connection can be
 kept
   alive
for 15000 ms
17:33:33,065 DEBUG ThreadSafeClientConnManager:221 - Released
 connection
   is
reusable.
17:33:33,065 DEBUG ConnPoolByRoute:374 - Releasing connection
[HttpRoute[{}-http://192.168.208.110]][null]
17:33:33,065 DEBUG ConnPoolByRoute:394 - Pooling connection
   [HttpRoute[{}-
http://192.168.208.110]][null]; keep alive for 15000 MILLISECONDS
   
Who can tell me why this is?
   
   
  
  
   It is just not possible to tell from 16 milliseconds of logs.
  
   Oleg
  
  
   -
   To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
   For additional commands, e-mail: httpclient-users-h...@hc.apache.org
  
  
 
 


 -
 To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
 For additional commands, e-mail: httpclient-users-h...@hc.apache.org




-- 
Yours alin
msn  alin_...@hotmail.com
phone  88155188-17496
mobile   13858061999


Re: Why client connection's port changed always when server support Keep-alive?

2008-12-23 Thread alin()
Dear Oleg:
Thanks for your reply. And here is my simple code (usging
httpclient4.0-beta2):

private void initHttpClient() {
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(
new Scheme(http, PlainSocketFactory.getSocketFactory(),
80));
httpParams = new BasicHttpParams();
HttpProtocolParams.setVersion(httpParams, HttpVersion.HTTP_1_1);
this.setMaxTotalConnections(DEFAULT_MAX_TOTAL_CONNECTIONS);
this.setReadTimeout(DEFAULT_READ_TIMEOUT);
ClientConnectionManager cm = new ThreadSafeClientConnManager(
httpParams, schemeRegistry);
httpClient = new DefaultHttpClient(cm, httpParams);
}


On Tue, Dec 23, 2008 at 10:51 PM, Oleg Kalnichevski ol...@apache.orgwrote:

 On Mon, 2008-12-22 at 17:46 +0800, alin(王霖) wrote:
  HI:
  I use httpclient3 and httpclient4 for a multi-thread load test,  and
  always set http request header with Connection:Keep-Alive.
  When i input command netstat -na | grep myserverhost:myserverport in
  console(My system is windows xp + cygwin) ,  output  like following:
 
  C:\Documents and Settings\lin.wanglnetstat -na | grep
 192.168.208.110:80
TCP10.1.26.82:4159192.168.208.110:80 ESTABLISHED
TCP10.1.26.82:4160192.168.208.110:80 ESTABLISHED
 
  But the ports of client connections(here is 10.1.26.82)  is changing
 while
  load test is running.
  through log4j, httpclient4 told me:
 
  17:33:33,049 DEBUG DefaultRequestDirector:463 - Connection can be kept
 alive
  for 15000 ms
  17:33:33,065 DEBUG ThreadSafeClientConnManager:221 - Released connection
 is
  reusable.
  17:33:33,065 DEBUG ConnPoolByRoute:374 - Releasing connection
  [HttpRoute[{}-http://192.168.208.110]][null]
  17:33:33,065 DEBUG ConnPoolByRoute:394 - Pooling connection
 [HttpRoute[{}-
  http://192.168.208.110]][null]; keep alive for 15000 MILLISECONDS
 
  Who can tell me why this is?
 
 


 It is just not possible to tell from 16 milliseconds of logs.

 Oleg


 -
 To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
 For additional commands, e-mail: httpclient-users-h...@hc.apache.org




-- 
Yours sincerely
alin


Why client connection's port changed always when server support Keep-alive?

2008-12-22 Thread alin()
HI:
I use httpclient3 and httpclient4 for a multi-thread load test,  and
always set http request header with Connection:Keep-Alive.
When i input command netstat -na | grep myserverhost:myserverport in
console(My system is windows xp + cygwin) ,  output  like following:

C:\Documents and Settings\lin.wanglnetstat -na | grep 192.168.208.110:80
  TCP10.1.26.82:4159192.168.208.110:80 ESTABLISHED
  TCP10.1.26.82:4160192.168.208.110:80 ESTABLISHED

But the ports of client connections(here is 10.1.26.82)  is changing while
load test is running.
through log4j, httpclient4 told me:

17:33:33,049 DEBUG DefaultRequestDirector:463 - Connection can be kept alive
for 15000 ms
17:33:33,065 DEBUG ThreadSafeClientConnManager:221 - Released connection is
reusable.
17:33:33,065 DEBUG ConnPoolByRoute:374 - Releasing connection
[HttpRoute[{}-http://192.168.208.110]][null]
17:33:33,065 DEBUG ConnPoolByRoute:394 - Pooling connection [HttpRoute[{}-
http://192.168.208.110]][null]; keep alive for 15000 MILLISECONDS

Who can tell me why this is?


-- 

best Regards
alin