Perrin Harkins wrote:
Are you sure about that? On Linux, prefork is likely to perform better. Threads will use up a lot more memory, and be slow to spawn. I think you should try a little benchmarking before you put a lot more time into using threads.
You are correct in that performance (cpu usage) might be worse with the threaded workers. However, scalability is definately much better.
For comparison, a server with one gig of memory can run roughly 600 preforked workers with some spare memory left for disk caching. Any more than this, and performance drops as disk access increases.
With threaded processes, I can easily have the same machine run 5x the number of threads, with some 400-500 perl interpreters available. This is very helpful when you need to be able to serve a large amount of concurrent slow(ish) clients.
Obviously the configuration I have uses 'PerlInterpScope handler' to maximize the benefit from the interpreters-to-threads ratio.
If it turns out you do need to get threads to work, the next step in fixing segfaults is typically to get a backtrace. There are instructions for doing this in the mod_perl docs.
Are you sure that this would help in this case? From what I can see, the cause of the segfaults appears to be memory corruption, which is likely to happen earlier than the actual segfault. If this is the case, would the backtrace likely not show any useful information?
The reason I ask this is because setting up a full-blown debugging environment could be a bit tricky. I might be able to compile a debug-enabled version of mod_perl, but doing the same for Apache and/or Perl could be a problem. Or are there debug-enabled versions available from Debian somewhere?
I have been creating a stripped-down-model of this setup in a test environment, in an attempt to be able to pin point what exactly causes the crashes. Unfortunately I haven't yet been able to create a setup which would duplicate the segfaults, despite that fact that the test environment already implements nearly 100% of the functionality that the production system has. I'll keep on trying though.
Thanks, -- Jani