Browse Source

Merge pull request #1310 from jmaddux-techempower/master

Fix HHVM
Mike Smith 10 years ago
parent
commit
5596e59760

+ 9 - 9
frameworks/PHP/hhvm/README.md

@@ -4,15 +4,15 @@ This is the [HHVM](http://github.com/facebook/hhvm) portion of a [benchmarking t
 
 Supports the Following Benmarking URLs
 
-* http://localhost:8080/json
-* http://localhost:8080/db
-* http://localhost:8080/db?queries=10
-* http://localhost:8080/queries
-* http://localhost:8080/queries?queries=10
-* http://localhost:8080/fortunes
-* http://localhost:8080/updates
-* http://localhost:8080/updates?queries=10
-* http://localhost:8080/plaintext
+* http://localhost:8080/json.php
+* http://localhost:8080/db.php
+* http://localhost:8080/db.php?queries=10
+* http://localhost:8080/queries.php
+* http://localhost:8080/queries.php?queries=10
+* http://localhost:8080/fortunes.php
+* http://localhost:8080/updates.php
+* http://localhost:8080/updates.php?queries=10
+* http://localhost:8080/plaintext.php
 
 ### 1. Plaintext Test
 

+ 9 - 9
frameworks/PHP/hhvm/URLs

@@ -1,10 +1,10 @@
-http://localhost:8080/json
-http://localhost:8080/db
-http://localhost:8080/db?queries=10
-http://localhost:8080/queries
-http://localhost:8080/queries?queries=10
-http://localhost:8080/fortunes
-http://localhost:8080/updates
-http://localhost:8080/updates?queries=10
-http://localhost:8080/plaintext
+http://localhost:8080/json.php
+http://localhost:8080/db.php
+http://localhost:8080/db.php?queries=10
+http://localhost:8080/queries.php
+http://localhost:8080/queries.php?queries=10
+http://localhost:8080/fortunes.php
+http://localhost:8080/updates.php
+http://localhost:8080/updates.php?queries=10
+http://localhost:8080/plaintext.php
 

+ 2 - 0
frameworks/PHP/hhvm/bash_profile.sh

@@ -5,3 +5,5 @@ export PHP_HOME=${IROOT}/php-5.5.17
 export PHP_FPM=$PHP_HOME/sbin/php-fpm
 
 export PATH="$PHP_HOME/bin:$PHP_HOME/sbin:$PATH"
+
+export NGINX_HOME=${IROOT}/nginx

+ 6 - 6
frameworks/PHP/hhvm/benchmark_config

@@ -4,12 +4,12 @@
     [{
       "default": {
         "setup_file"     : "setup_hhvm",
-        "json_url"       : "/json",
-        "db_url"         : "/db",
-        "query_url"      : "/queries?queries=",
-        "fortune_url"    : "/fortunes",
-        "update_url"     : "/updates?queries=",
-        "plaintext_url"  : "/plaintext",
+        "json_url"       : "/json.php",
+        "db_url"         : "/db.php",
+        "query_url"      : "/queries.php?queries=",
+        "fortune_url"    : "/fortunes.php",
+        "update_url"     : "/updates.php?queries=",
+        "plaintext_url"  : "/plaintext.php",
         "port"           : 8080,
         "approach"       : "Realistic",
         "classification" : "Platform",

+ 2 - 1
frameworks/PHP/hhvm/deploy/config-debug.hdf

@@ -5,7 +5,8 @@ PidFile = /tmp/FrameworkBenchmarks/hhvm/hhvm.pid
 
 # Server settings
 Server {
-  Port = 8080
+  Port = 9001
+  Type = fastcgi
   SourceRoot = /tmp/FrameworkBenchmarks/hhvm
   DefaultDocument = index.php
 }

+ 2 - 1
frameworks/PHP/hhvm/deploy/config.hdf

@@ -5,7 +5,8 @@ PidFile = /tmp/FrameworkBenchmarks/hhvm/hhvm.pid
 
 # Server settings
 Server {
-  Port = 8080
+  Port = 9001
+  Type = fastcgi
   SourceRoot = /tmp/FrameworkBenchmarks/hhvm
   DefaultDocument = index.php
 }

+ 34 - 0
frameworks/PHP/hhvm/deploy/nginx.conf

@@ -0,0 +1,34 @@
+worker_processes  8;
+error_log stderr error;
+
+events {
+    worker_connections  1024;
+}
+
+http {
+    include       /usr/local/nginx/conf/mime.types;
+    default_type  application/octet-stream;
+    access_log off;
+
+    sendfile        on;
+    keepalive_timeout  65;
+    upstream fastcgi_backend {
+        server 127.0.0.1:9001;
+        keepalive 32;
+    }
+
+    server {
+        listen       8080;
+        server_name  localhost;
+        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9001
+        location ~ \.(hh|php)$ {
+            root TEST_ROOT;
+            #fastcgi_keep_conn on;
+            fastcgi_pass   fastcgi_backend;
+            #fastcgi_pass   127.0.0.1:9001;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
+            include        /usr/local/nginx/conf/fastcgi_params;
+        }
+    }
+}

+ 1 - 1
frameworks/PHP/hhvm/install.sh

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-fw_depends php hhvm
+fw_depends nginx php hhvm

+ 2 - 0
frameworks/PHP/hhvm/run-debug.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
 hhvm --config ./deploy/config-debug.hdf -m server
+$NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf
+

+ 2 - 0
frameworks/PHP/hhvm/run.sh

@@ -1,3 +1,5 @@
 #!/bin/bash
 
 hhvm --config ./deploy/config.hdf -m server
+$NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf
+

+ 4 - 1
frameworks/PHP/hhvm/setup_hhvm.sh

@@ -5,5 +5,8 @@ sed -i 's|SourceRoot = .*/FrameworkBenchmarks/hhvm|SourceRoot = '"${TROOT}"'|g'
 sed -i 's|Path = .*/.hhvm.hhbc|Path = '"${TROOT}"'/.hhvm.bbhc|g' deploy/config.hdf
 sed -i 's|PidFile = .*/hhvm.pid|PidFile = '"${TROOT}"'/hhvm.pid|g' deploy/config.hdf
 sed -i 's|File = .*/error.log|File = '"${TROOT}"'/error.log|g' deploy/config.hdf
+sed -i "s|/usr/local/nginx/|${IROOT}/nginx/|g" deploy/nginx.conf
+sed -i "s|TEST_ROOT|${TROOT}|g" deploy/nginx.conf
 
-hhvm --config $TROOT/deploy/config.hdf -m daemon
+hhvm --config $TROOT/deploy/config.hdf -m daemon
+$NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf