3 ms·
Ugh, you're bringing up bad memories for me. I was once bit badly by the require_once/realpath() problem. require_once("/foo/bar/baz/random/crap/foo.php"); T
by spudlyo 15y ago
Ugh, you're bringing up bad memories for me. I was once bit badly by the require_once/realpath() problem.
require_once("/foo/bar/baz/random/crap/foo.php");
The above requires 5 lstat(2) system calls thanks to realpath() and a typical WordPress-MU page load for us was calling lstat over 5k times. Over NFS that's 5k round trips to the server for every page load. Thankfully there is a knob you can tune in PHP 5.1.x (realpath_cache_size) that caches all those lstats, but as usual, the default is (16K) is too small to be of any use.