event 24 or too many files open

Timo Ewalds <[email protected]> Wed, 11 Feb 2004 22:37:15 -0700
Newsgroups gmane.network.mathopd
Message-ID <[email protected]>
I run a rather large website ( www.enternexus.com ), and am using 
mathopd as the image server. There are about 150,000 images, organized 
into small folders. Recently I've been having trouble with mathopd not 
responding properly to image requests. Quite often it'll return error 
404 instead of the actual picture. The picture does exist, and the url 
is right, and all that stuff. Refreshing often gets it to load properly, 
but not always. Up until today I was running mathopd 1.4p3, and have 
huge strings of errors in the error log in the forms

Thu Feb 12 05:13:21 2004 [3505] poll: unexpected event 24
Thu Feb 12 05:13:35 2004 [3505] error sending to <ip>[4519]
Thu Feb 12 05:13:35 2004 [3505] send: Connection reset by peer

Seeing as I have no idea what event 24 is, and mathopd 1.5 is out, I 
figured I'd try it out. It unfortunately is no better, giving me these 
errors instead

Thu Feb 12 05:13:13 2004 [3496] open: Too many open files
Thu Feb 12 05:13:14 2004 [3496] accept: Too many open files
Thu Feb 12 05:13:14 2004 [3496] cannot open 
/home/enternexus/public_html/users/thumbs/604/604557.jpg

Now it is possible the errors from 1.4p3 are still showing up, but 
seeing as I get these errors dozens of times per second, I haven't 
noticed them.

I figured it might be running out of file descriptors, so I reduced the 
number of connections and the timeout, but that didn't do anything.

My servers are running redhat 9 and fedora (happens on both), all with 
the 2.4.24 kernel, but are otherwise pretty stock.

Does anyone have an explanation of why this might be happening? or how 
to fix it?

The other thing I noticed on my dedicated image box, is that sometimes 
top shows 0% usage and 0% idle, or 33% irq, 33% softirq and 33% iowait. 
This of course makes no sense, and might be either a bug in top or in 
the kernel, but I think it might be related to how mathopd interacts 
with the kernel.

Timo