2006-10-08 Strace Oddmuse

Today I ran `strace` on a command-line invocation of Oddmuse running this site. Then I grepped for all open calls, and grouped files. Here’s what I got:

Oddmuse

Total: 105 files loaded.

So:

1. Using FCGI would hopefully save us 37 + 24 file loads (more than half)

2. Just concatenating all the config stuff into one would already save 21 file loads (20%)

I’ll try ​#2 first.

​#Oddmuse

Comments

(Please contact me if you want to remove your comment.)

2 cents: Maybe you could cache the configuration and modules into one file, update of the cache based on modification date, or require the admin to use action=version after an update and update the cache then.

Maybe in another cache, the oddmuse initialization files.

Maybe some perl modules are allways loaded but not used (rss?) and their import could be made conditional?

– PierreGaston 2006-10-08 17:10 UTC

---

Well, what I did for the modules was simple: `mkdir -p source; mv *.pl source; cat source/*.pl > concat.pl` – so basically all modules are concatenated into one. Installing a new module now means adding the module file and running `cat source/*.pl > concat.pl` again.

I think most of the Perl stuff under my control is well conditionalized. I think the only thing I could do is get rid of referrer tracking which would prevent `LWP::UserAgent` from being loaded:

aschroeder@thinkmo:~$ grep "open.*perl" strace.alex.concatenated-modules
open("/usr/share/perl/5.8/CGI.pm", O_RDONLY|O_LARGEFILE) = 4
open("/usr/share/perl/5.8/Carp.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl/5.8/Exporter.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl/5.8/CGI/Util.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl/5.8/strict.pm", O_RDONLY|O_LARGEFILE) = 6
open("/usr/share/perl/5.8/vars.pm", O_RDONLY|O_LARGEFILE) = 6
open("/usr/share/perl/5.8/warnings/register.pm", O_RDONLY|O_LARGEFILE) = 7
open("/usr/share/perl/5.8/warnings.pm", O_RDONLY|O_LARGEFILE) = 7
open("/usr/share/perl/5.8/constant.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl/5.8/overload.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl/5.8/CGI/Carp.pm", O_RDONLY|O_LARGEFILE) = 4
open("/usr/share/perl/5.8/File/Spec.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl/5.8/File/Spec/Unix.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/lib/perl/5.8/File/Glob.pm", O_RDONLY|O_LARGEFILE) = 4
open("/usr/lib/perl/5.8/XSLoader.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/lib/perl/5.8/auto/File/Glob/Glob.so", O_RDONLY) = 4
open("/usr/share/perl/5.8/Text/ParseWords.pm", O_RDONLY|O_LARGEFILE) = 3
open("/usr/share/perl5/LWP/UserAgent.pm", O_RDONLY|O_LARGEFILE) = 4
open("/usr/share/perl5/HTTP/Request.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl5/HTTP/Message.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl5/HTTP/Headers.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl5/URI.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl5/URI/Escape.pm", O_RDONLY|O_LARGEFILE) = 6
open("/usr/share/perl5/HTTP/Response.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl5/HTTP/Status.pm", O_RDONLY|O_LARGEFILE) = 6
open("/usr/share/perl5/HTTP/Date.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl/5.8/Time/Local.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/lib/perl/5.8/Config.pm", O_RDONLY|O_LARGEFILE) = 6
open("/usr/share/perl/5.8/integer.pm", O_RDONLY|O_LARGEFILE) = 6
open("/usr/share/perl5/LWP.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl5/LWP/Debug.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl5/LWP/Protocol.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl5/LWP/MemberMixin.pm", O_RDONLY|O_LARGEFILE) = 5
open("/usr/share/perl/5.8/CGI/Cookie.pm", O_RDONLY|O_LARGEFILE) = 3
open("/usr/share/perl/5.8/PerlIO.pm", O_RDONLY|O_LARGEFILE) = 3
open("/usr/lib/perl/5.8/PerlIO/scalar.pm", O_RDONLY|O_LARGEFILE) = 3
open("/usr/lib/perl/5.8/auto/PerlIO/scalar/scalar.so", O_RDONLY) = 3

– Alex Schroeder 2006-10-08 17:43 UTC

Alex Schroeder