What performance issues are there with using symlinks for your Apache docroot

apache-2.2performancesymlink

I tried to find an existing question for this already, but couldn't find a good match.

As part of my deploy process for my public facing sites, I am using symlinks to swap between versions of the web application.

For instance, I have a vhost abc.com which has a docroot here: /var/www/abc.com

The docroot itself (/var/www/abc.com) is a symlink to the application's web-accesible directory (/var/www/package/buildX/web)

When I deploy a new build, I simply swap out the symlink and replace with another symlink to the new build.

The question I have is, what is the performance overhead (or concerns I should have) with using symlinks for an Apache docroot

Best Answer

The first issue is, are all of these files in the same filesystem or physical storage device? If so, the difference between a direct reference and a symlink will be nearly impossible to detect.

You need to think in orders of magnitude here. Your application is probably underpinned by a scripting language and a database. Those elements of the application will be the limiting factor, not a minor filesystem feature. Jeff Atwood explains this best in this blog post.

Related Topic