2

As the title says, it strikes me that if I have an old mason webapp which is basically a few hundred perl scripts and components on disk, would it not run quicker if I made the documentroot a tmpfs?

I know mason does some caching, but there's little explanation on how complete this is, and I've also assumed apache doesn't just load every file into ram when you start it.

apache2 on debian if relevant.

pacifist
  • 181
  • 6

1 Answers1

3

Of course this is not a problem, and if you are serving lots of static content it should yield a substantial performance increase (the amount is determined mainly by the speed of your RAM versus the slowness of your disks).

If you do it, there is no point at all caching the same content in RAM too.

Since your content is mainly dynamic (all those perl scripts), most of your overhead comes from instantiating workers and running the perl interpreter, and from the things the perl scripts are doing. Keeping the perl scripts in memory would help only slightly, and linux (I assume you are using linux) will often cache stuff like this on its own anyway.

If you are incorporating your static content by reference from the documentroot you may see load times improve up to network performance for those resources.

Apache most definitely does not immediately load all of its static content into RAM automatically on startup, though it can be configured to cache it there during runtime.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92