I have a box running 4.8-STABLE with mysqld and an in-house developed app.
The problem is as follows:-
My dev people noticed that both mysqld and our application run out of
file descriptors after a few hours, when checking with sysctl, I noticed
that the number of open files reaches the 32K limit and that none of these
files gets closed.
We traced it back to kqueue/libc_r, I checked the newsgroups and freebsd
bugs DB, but nothing like that appears or seems relevant.
We have an older box with 4.6.2-RELEASE-p7, where this problem does not
happen. Was there any modifications to libc between 4.6.2 and 4.8?
Right now what I did is write a script that checks KQUEUE (from lsof output)
and restarts mysqld when the number reaches 16000, but I would really like
to find a more "scientific" solution for this.