'Solr connection timeout during indexing?

I have solrj client with infinite timeout(Solr4)

server.server.setSoTimeout(0)
server.server.setConnectionTimeout(0)

When I index my data I have many timeouts on server side. Where can I update server side timeouts in solrconfig.xml or possible tomcat config?

Client side exception:

Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

Server side exception:

 Jan 31, 2013 8:55:54 PM org.apache.solr.common.SolrException log
    SEVERE: org.apache.solr.common.SolrException: Read timed out
        at org.apache.solr.handler.loader.XMLLoader.load(XMLLoader.java:159)
        at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92)
        at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1699)
Caused by: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:751)


Solution 1:[1]

We had the same problem with Solr 4. We solved this after reading a blog post by Uwe Schindler (a Solr commiter).

With Solr 4 and several Solr 3 versions, you have to let an important share of your RAM free so that the system can use properly the mmap system call. This can be subtle depending on your system configuration (the blog post gives a plenty of informations on that point). In our case, this solved the problem: we could finally index without any more timeout issue.

Solution 2:[2]

the info for tomcat server.xml config will solve this. we got same stack trace and the below solved it for us: http://forums.alfresco.com/ja/node/8458

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Jaimini Ram