in reply to Re^3: How to determine what the memory-limits of a CGI app are?
in thread How to determine what the memory-limits of a CGI app are? [SOLVED]

Carefully repeating your process, and with the -Sv parameter of ulimit (I must have tried a different one...), I was able to produce a failure ... but in this situation the program “simply failed.” It did not produce the “error-page” output that the same program does in the CGI environment.

The command used is:

ulimit -Sv 32767 strace -otrace_err ./spe-cgi.pl
and, as I said, the program “simply ends” without producing any output. It does not produce the error-page or anything else. (So I really haven't cleanly reproduced the same failure scenario... yet.)

Nevertheless, the trace output does produce four mmap() calls in a row that each throw ENOMEM.

Replies are listed 'Best First'.
Re^5: How to determine what the memory-limits of a CGI app are?
by almut (Canon) on Mar 03, 2009 at 23:22 UTC
    But if there's a way to strace the thing in the CGI world where it now fails,...

    It's as simple as writing a shell wrapper, and have Apache call that instead of directly calling the CGI program. (Use strace's option -o, so the output doesn't end up in the error log...)

    Have you done that? What was the result?

Re^5: How to determine what the memory-limits of a CGI app are?
by almut (Canon) on Mar 03, 2009 at 23:31 UTC
    I really haven't cleanly reproduced the same failure scenario... yet

    Just play with different memory limits... I'm pretty sure there will be one which produces the same failure you observe in the CGI environment.

      And now the problem really becomes what to do about it. I need to discover the “wasteful” memory-allocations wherever they might be found...

      Heck, I guess I gotta start by finding memory-allocations, period ...

      What would you advise me to do here, to “trim the fat” and get this app quickly into operational condition? Truth be told, I guess I haven't had to deal with “a real memory limit” in a very long time. But it's also pretty obvious that the app is a pig.   :-D