1

I have been playing with this a while now and I thought maybe I would ask the community.

Log::write("perf", "start" );
for($i=0;$i<100000000;$i++) {}
Log::write("perf", "finish");

As you can see its a basic log write; then a cpu bound computation for 0 to 100 million.

If I execute this program on the command line it resolves in about 2.2 seconds, and if I execute this file with hhvm it resolves in 0.326 seconds. Considerably faster!

However, when I run this same exact setup in my web instance in the middle of the application (note I use the perf log guards so I know the other's are not affecting it)... the same program section runs in a whopping 5 seconds under FCGI apache2.

For the life of me I can't figure out why it would be so slow? As a note; waiting for the JIT 20 notifications to finish does not speed up the program...

Any idea what I might be doing wrong here?

As a note, this is running on Ubuntu 16.04 on an AWS c4 instance.

scrowler
  • 24,273
  • 9
  • 60
  • 92
Lance Bryant
  • 158
  • 12

0 Answers0