Gavin Ellis Mendel-Gleason
2006-Mar-13 13:50 UTC
[Xapian-discuss] Problems with file descriptors
I'm using the xapian php4 bindings for a small website. We are doing a fairly large number of xapian searches and repeatedly run out of file descriptors. It can take quite a long time before the computer can get the file descriptors back which causes the whole site to go down. I have experienced this on debian woody and debian sarge. There was a similar message concerning file descriptors on Xapian discuss by Arjen van der Meijden on Mon Jan 31 11:05:33 GMT 2005. I think that I may be experiencing the same problem. The php4 bindings do not allow you to delete the database without encountering a segmentation fault. So I can't delete the database manually. My guess is that for some reason the database objects aren't being garbage collected and for this reason the file descriptors can not be reclaimed. I'm using $database = null; after every query, but this doesn't seem to help. Does anyone have any ideas on how to fix this problem? Gavin
On Mon, Mar 13, 2006 at 01:47:25PM +0000, Gavin Ellis Mendel-Gleason wrote:> Does anyone have any ideas on how to fix this problem?Outside Xapian, if you're using apache you could make your web server child processes recycle faster using MaxRequestsPerChild. File handles should be released cleanly on process exit. (Dropping MaxRequestsPerChild does reduce your scalability, though - if someone can offer a 'correct' solution that deals with the Xapian issue, this is preferred.) J -- /--------------------------------------------------------------------------\ James Aylett xapian.org james@tartarus.org uncertaintydivision.org
On Mon, Mar 13, 2006 at 01:47:25PM +0000, Gavin Ellis Mendel-Gleason wrote:> I'm using > > $database = null; > > after every query, but this doesn't seem to help.Hmm, that's what I was about to suggest. What Xapian version are you using? Cheers, Olly