Mod_perl shares RAM on systems with correctly implemented copy to write. Upload your Perl hash to the BEGIN block of your mod_perl program, and all forked instances of mod_perl will share memory if there are no entries on the pages storing your hash. This does not work perfectly (some pages will be written), but on my servers and data it reduces memory usage by 70-80%.
Mod_perl also speeds up your server by eliminating Perl compilation time on subsequent web requests. The disadvantage of mod_perl is that you must program carefully and avoid programs that modify global variables, since these variables, such as the hash, are shared by all instances of mod_perl. Itβs worth learning enough Perl so you donβt have to change global variables!
Performance from mod_perl is fantastic, but mod_perl is not available on many shared hosts. It is easy to drown out and difficult to debug while you study it. I only use it when my customers value performance improvements to justify my development pain.
source share