1

For a side project I aim to run my php application completely in memory, using PHP 5.5+ OpCache and Redis as persistent storage. Now I am using include and file_exists() as the two calls which possibly perform a stat call.

With a scripts like ocp.php I can check the files hits/misses. I wonder however, how could I check whether there are any stat calls made (like, file_exists() too) and when & where they are made?

I would like to profile my deployment this way to tune any possible php configuration to run the app completely in memory.

Jurian Sluiman
  • 13,498
  • 3
  • 67
  • 99
  • 1
    Are you already using Xdebug? If not, maybe the Profiler (docs: http://www.xdebug.org/docs/profiler) can help you out. – Bjorn Jan 03 '15 at 23:52
  • 1
    I'm posting this as a comment, not an answer because it's probably not exactly the solution you want, but you could `strace` the script, maybe: `strace -etrace=stat64 PID_HERE` or `strace PID_HERE 2>&1 | grep stat` – Kevin Jan 03 '15 at 23:52
  • @Bjorn yes I have the profiler. Haven't thought about it (as it does not show any system calls) but it notified my that Slim was calling `is_file()` twice in `Slim\View::render()`! – Jurian Sluiman Jan 04 '15 at 10:49
  • @Kevin thanks for the response! Now using strace with `strace -tfp {PID} 2>&1` like I found in [this answer](http://stackoverflow.com/a/24309424/434223) which gives me quite good results. If I went through all the output, I will post some more info here with interesting results! – Jurian Sluiman Jan 04 '15 at 10:50

0 Answers0