Hi all,
We've been using DirectSolrConnection in an application with low
overall load, but proportionally a lot of updates (nearly as many
updates as searches). While I love the fact that I don't have to deal
with HTTP, we're seeing a couple of problems.
After a while we start getting exceptions thrown because of a timeout
in acquiring write.lock. It's quite possible that this occurs
whenever two updates are attempted at the same time - is
DirectSolrConnection intended to be thread safe?
The other problem is that after some time we get a "Too Many Open
Files" error when autocommit fires. Usually this happens once or
twice and then stops and things rock along as usual. It's quite
possible this is actually us leaking file handles from elsewhere or
it could be because of the way we're using DirectSolrConnection or it
just could be we need to optimize more. Any hints on how to decide
which of those it is?
At the moment, we create a single DirectSolrConnection instance and
use it for all searches and updates. Previously we've created a new
DirectSolrConnection for each thread and the same problems occured.
The entire tomcat instance is automatically restarted every 12 hours
to deploy updates to the application.
I could of course switch to using the Solr webapp since we're running
in Tomcat anyway, however I really like the ability to have a single
WAR file that contains everything and also not have to worry about
actually making HTTP requests and the complexity that adds.
Any hints would be greatly appreciated, it looks like
DirectSolrConnection isn't heavily used but it is a really cool idea
that I'd suggest is worth pursuing.
Thanks in advance,
Adrian Sutton
http://www.symphonious.net