For deployment reasons, it is slightly easier for me to use symlinks, but these would be for all of my websites core files and configurations which will be accessed 10’s of thousands of times a day.
Am I more sensible to move the documents to the correct positions on the server (slightly more problematic deployment) rather than using symlinks for everything (slight performance degradation?)
I have created a file
testfile.txtwith 1000 lines ofblablablain it, and created a local symlink (testfile.link.txt) to it:(The
-nswitch is only there to hide my super-secret username.:))And then executed 10 rounds of
cating into/dev/null1000 times for both files.(Results are in seconds.)
Accessing the file directly:
Accessing through symlink:
Measured on (a rather old install of) Ubuntu:
Of course it’s a dumbed-down example, but based on this I wouldn’t expect too much of a performance degradation when using symlinks.
I personally think, that using symlinks is more practical:
my_web_files.v1,my_web_files.v2), and use the “official” name in the symlink (e.g.my_web_files) pointing to the “live” version. If you want to change the version, just re-link to another versioned directory.