Ticket #217 (closed defect: invalid)

Opened 2 years ago

Last modified 1 year ago

Use of IndexSeacher in Statement is not thread-safe

Reported by: ebrown Assigned to: ebrown
Priority: critical Milestone:
Component: topaz Version: 0.5-SNAPSHOT
Keywords: search Cc:
Blocking: Blocked By:

Dependency Graph

Change History

11/22/06 11:23:50 changed by ebrown

  • status changed from new to assigned.
  • milestone changed from TBD to November27.

11/26/06 22:43:07 changed by ebrown

I'm having second thoughts. I'm not sure I need to do anything here. Interesting article: http://www.telio.be/blog/2006/05/07/lucene-indexsearcher/ ...

We launched a new version of one of our websites that was rewritten in Java (formerly in Perl).

The site drains quite a lot of traffic and I had made very few benchmarks during development phase. When I finally started load testing I realized that the site was performing well in the beginning but after a few minutes it was getting slower and slower ..

I isolated the problem in the Lucene search section. After reading a little more about the IndexSearcher? object it finally hit me.

A new IndexSearcher? object was created for every search which is definately not the correct way of using it. IndexSearcher? is a heavy object and can (and should) be shared by multiple clients (it is threadsafe). The only thing you should of course, is recreate it when the index changes (on index updates and deletes).

After this little incident, I must say I am really amazed at the overall performance of the site, it runs like a charm on Tomcat 5.5 with MySQL behind using a classical JSP 2.0 Struts - IBatis - stack, nothing fancy, no spring, no hibernate, etc ..

11/27/06 00:59:16 changed by ebrown

  • status changed from assigned to closed.
  • resolution set to invalid.

I don't think this is an issue. Testing will bear it out.

10/29/07 21:12:56 changed by

  • milestone deleted.

Milestone November27 deleted