In the last episode (Aug 27), Chad Arimura said:
> The search function for our ecommerce site has worked great up until
> the other day, but now when a search is ran the whole system just
> hangs. Here is what I have found:
> A process is started (search.cgi) that stays open until all of the
> memory is used up (sometimes two same-named processes). Then, it
> fills up ALL of the swap space until the system is basically unsable.
> After about 30 seconds of filling up space and hanging the system,
> the process dies and the memory and swap are released, returning the
> system to normal condition.
> I ran "mysqladmin processlist" while the system was still responding
> (before all swap filled), and all I found was a new mysql process
> sleeping, but not doing anything.
> I tried the exact same code with a backed-up version of the database
> from a week ago, and the search worked fine. Something in our DB
> changed and messed stuff up, but so much is going on it's tough to
> figure out.
> My question is, does anyone have a suggestion for pinpointing the
Sounds like a problem in the CGI, where a particular field value or
error condition is not handled correctly, and it starts allocating
memory out of control. Add some printf()s to your code, or attach to
the process with gdb and get a stack trace, or kill -9 the CGI and gdb