httpclient - Facing issue while implementing connection pooling with solr -
I say this requirement is where I want to limit the number of concurrent calls to Solr that 50 I apply I am trying to connect to the HTTP client pooling which is then used in the Solt object HttpSolrServer. Please find the code below ` I was hoping to make only 50 connections for solar from my application and then maybe there is some slow experience until the old relation was released. Even though there is a new connection at every regular interval there are connections waiting in the Solr end and those connections are never used again. Example output Where is the 109 IP where I am running my application and there is 241 IP where SLL is running. In this case ffff: 192.168.0.109: 47382 Never again will not be used and it ended at the end What am I ever wrong? Will highly appreciate any help HttpSolrServer should Akltn HttpSolrServer create only one instance per Solr Url
HttpClient httpclient = new DefaultHttpClient ();
httpclient.getParams () setParameter (HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 50). Httpclient.getParams () SetParameter (HttpClientUtil.PROP_MAX_CONNECTIONS, 50); HttpSolrServer httpSolrServer = New HttpSolrServer ("solr url", httpclient); SolrQuery solrQuery = new SolrQuery ("*: *"); For (int i = 0; i & LT; 100000000, i ++) {long numFound = httpSolrServer.query (solrQuery) .getResults () .getNumFound (); Println (numFound); } `
TCP 0 192.168. 0.241: 22 192.168.0.109:54120 established TCP 0 0 :: ffff: 192.168.0.241: 8190 :: ffff: 192.168.0.109: 47,382 TIME_WAIT tcp 0 0 :: ffff: 192.168.0.241: 8190 :: ffff: 192.168.0.109 : 47383 established TCP 0 0 :: ffff: 192.168.0.241: 8190 :: ffff: 192.168.0.109: 47371 TIME_WAIT tcp 0 0 :: ffff: 192.168.0.241: 8190 :: ffff: 192.168.0.109: 47,381 TIME_WAIT
Comments
Post a Comment