Hi Yonik, thanks for reply.
Currently I have more than 50 classes and every class have their own SolrServer server = new CommonsHttpSolrServer(" http://localhost:8080/solr/core0"); Majority of classes connect to core0 however there are many cores which is connecting from different classes. My senario is expecting 400000 to 500000 hit on server every day and the server is deployed on tomcat 6.20 with 12GB heap size to catalina. My OS is Red hat Linux (production) and using Ubuntu as development server. Logically I can make a common class for connecting solr server but now question is : 1. If I using a common class then I must have to use max connection on httpclient what will the ideal default setting for my current problem. 2. I am expecting concurrent connection at pick time is minimum 5000 hits to solr server. 3. If I will use SolrServer server = new CommonsHttpSolrServer(" http://localhost:8080/solr/core0"); using common class across all classes then will it help to resolve current problem with the current load I dont want my user experience slow response from solr server to get result. 4. As other users overcome with this issue to increase or to make unlimited TCP/IP setting on OS level. Is it right approach? As I am newly shift to Java language so any piece of code will much appreciated and will much easier for me to understand. thanks. regards Jonty On Wed, Oct 26, 2011 at 1:37 AM, Yonik Seeley <yo...@lucidimagination.com>wrote: > On Tue, Oct 25, 2011 at 4:03 PM, Jonty Rhods <jonty.rh...@gmail.com> > wrote: > > Hi, > > > > I am using solrj and for connection to server I am using instance of the > > solr server: > > > > SolrServer server = new CommonsHttpSolrServer(" > > http://localhost:8080/solr/core0"); > > Are you reusing the server object for all of your requests? > By default, Solr and SolrJ use persistent connections, meaning that > sockets are reused and new ones are not opened for every request. > > -Yonik > http://www.lucidimagination.com > > > > I noticed that after few minutes it start throwing exception > > java.net.SocketException: Too many open files. > > It seems that it related to instance of the HttpClient. How to resolved > the > > instances to a certain no. Like connection pool in dbcp etc.. > > > > I am not experienced on java so please help to resolved this problem. > > > > solr version: 3.4 > > > > regards > > Jonty > > >