-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Too many open files exception
PostPosted: Wed Dec 07, 2011 5:12 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi all,

My sysadmin reported me an exception "too many open files" in my Hibernate Search Project.

I have been searching and I just found this:

Quote:
Why am I getting an IOException that says "Too many open files"?
The number of files that can be opened simultaneously is a system-wide limitation of your operating system. Lucene might cause this problem as it can open quite some files depending on how you use it, but the problem might also be somewhere else.
Always make sure that you explicitly close all file handles you open, especially in case of errors. Use a try/catch/finally block to open the files, i.e. open them in the try block, close them in the finally block. Remember that Java doesn't have destructors, so don't close file handles in a finalize method -- this method is not guaranteed to be executed.
Use the compound file format (it's activated by default starting with Lucene 1.4) by calling IndexWriter's setUseCompoundFile(true)
Don't set IndexWriter's mergeFactor to large values. Large values speed up indexing but increase the number of files that need to be opened simultaneously.
Make sure you only open one IndexSearcher, and share it among all of the threads that are doing searches -- this is safe, and it will minimize the number of files that are open concurently.
Try to increase the number of files that can be opened simultaneously. On Linux using bash this can be done by calling ulimit -n <number>.


anybody had this problem? how can i solve it?


Top
 Profile  
 
 Post subject: Re: Too many open files exception
PostPosted: Wed Dec 07, 2011 9:33 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
that's common when using Linux installations which where not tuned as production servers. As described on the article you've found, use ulimit to raise the limit.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Too many open files exception
PostPosted: Sun Dec 08, 2013 7:45 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi,

Which would be an efficient value for ulimit?

We have 3.4 hibernate search library in a server jboss 6.0. For faceting we use bobo-browse library and for the moment we have to use 1000000 for ulimit. I think that this is too much...should I try to solve this problem...or this is alright?

Thanks in advance,


Top
 Profile  
 
 Post subject: Re: Too many open files exception
PostPosted: Sun Dec 08, 2013 4:20 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
yes a million is definitely too high, looks like you're having a file leak. Version 3.4 is quite old, still looking and JIRA I didn't find documented known issues with file leaks in our library; so I wonder if you can confirm this to be an Hibernate Search problem? which unclosed files are you having?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Too many open files exception
PostPosted: Mon Dec 09, 2013 3:26 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi,

I think I have found the problem...after querying with bobo I left the index opened....I'll let you know any problem...

We are planning to move to the new version of Hibernate Search with Jboss 7...but still I need some time to figure out all dependencies....

Thanks in advance!

Hibernator,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.