Too many open files in system

#1
Hello,
I'm writing this thread because I'm facing issue with OLS web server. From time to time I get this error:
Code:
failed to open stream: Too many open files in system
And then I have to restart OLS and then PHP to get the websites working again.

I have checked how many files are opened by OLS and this was the result:

Code:
20575 (/usr/local/lsws/bin/openlitespeed): 57
20584 (/usr/local/lsws/bin/openlitespeed): 4
20586 (/usr/local/lsws/bin/openlitespeed): 3223
20587 (/usr/local/lsws/bin/openlitespeed): 3580
20588 (/usr/local/lsws/bin/openlitespeed): 4076
20589 (/usr/local/lsws/bin/openlitespeed): 4622
20590 (/usr/local/lsws/bin/openlitespeed): 6526
20591 (/usr/local/lsws/bin/openlitespeed): 8695
20592 (/usr/local/lsws/bin/openlitespeed): 10939
20593 (/usr/local/lsws/bin/openlitespeed): 15502
Then I have checked what files was opened for last two PIDs and most of it was cache-related:
Example:
Code:
litespeed 20592 nobody   66u      REG              253,0      191 139971076 /usr/local/lsws/cachedata/priv/f/f/0/ff0b4539b651dcd8.tmp (deleted)
litespeed 20592 nobody   67u      REG              253,0      175     73213 /usr/local/lsws/cachedata/priv/3/9/7/397363495dff5a49.tmp (deleted)
litespeed 20592 nobody   68u      REG              253,0      189 201356487 /usr/local/lsws/cachedata/priv/2/3/5/2356711412abcc5e.tmp (deleted)
litespeed 20592 nobody   69u      REG              253,0      200  70234732 /usr/local/lsws/cachedata/priv/9/1/3/913d976038d5ca6d.tmp (deleted)
litespeed 20592 nobody   70u      REG              253,0      203     73287 /usr/local/lsws/cachedata/priv/d/a/f/daffa89a3caffd05.tmp (deleted)
(big amount of opened files was already deleted)

litespeed 20592 nobody *946u      REG              253,0      204 205075850 /usr/local/lsws/cachedata/priv/6/5/8/658562817e4951f7.tmp
litespeed 20592 nobody *947u      REG              253,0      195 140090096 /usr/local/lsws/cachedata/priv/9/3/f/93fa7bf3cf92eecb.tmp
litespeed 20592 nobody *948u      REG              253,0      197 140997648 /usr/local/lsws/cachedata/priv/0/7/f/07f9e5beeb9777c3.tmp

litespeed 20592 nobody  958u     unix 0xffff8f3e9fae9f80      0t0   3651230 /tmp/lshttpd/XXX.sock
litespeed 20592 nobody  959u     unix 0xffff8f44c2da4c80      0t0   3640990 /tmp/lshttpd/XXX.sock
litespeed 20592 nobody  960u     unix 0xffff8f3e678b3f00      0t0   3634560 /tmp/lshttpd/XXX.sock
litespeed 20592 nobody  961u     unix 0xffff8f3eea12e780      0t0   3651902 /tmp/lshttpd/XXX.sock
litespeed 20592 nobody  962u     unix 0xffff8f3f20582880      0t0   3595179 /tmp/lshttpd/XXX.sock
litespeed 20592 nobody  963u     unix 0xffff8f40965c5e80      0t0   3671106 /tmp/lshttpd/XXX.sock
(same socks that were repeatly opened)
Is there a fix for problem like this?

PS. Right now I have increased Max connections to 100k, before it was set at 10k
 
Top