Browse Source

Add nginx-unit platform to PHP (#4956)

Joan Miquel 6 years ago
parent
commit
6240656fa7

+ 23 - 0
frameworks/PHP/php/benchmark_config.json

@@ -108,6 +108,29 @@
       "notes": "",
       "versus": "php"
     },
+    "nginx-unit": {
+      "json_url": "/json.php",
+      "plaintext_url": "/plaintext.php",
+      "db_url": "/dbraw.php",
+      "query_url": "/dbquery.php?queries=",
+      "fortune_url": "/fortune.php",
+      "update_url": "/updateraw.php?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "MySQL",
+      "framework": "None",
+      "language": "PHP",
+      "flavor": "PHP7",
+      "orm": "Raw",
+      "platform": "nginx-unit",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "PHP-nginx-unit",
+      "notes": "",
+      "versus": "php"
+    },
     "ngx": {
       "plaintext_url": "/hello",
       "json_url": "/json",

+ 23 - 0
frameworks/PHP/php/deploy/nginx-unit.json

@@ -0,0 +1,23 @@
+{
+    "listeners": {
+        "*:8080": {
+            "pass": "applications/benchmark"
+        }
+    },
+
+    "applications": {
+        "benchmark": {
+            "type": "php 7",
+            "processes": 64,
+            "user": "www-data",
+            "group": "www-data",
+            "root": "/php/",
+            "options": {
+                "file": "/php/deploy/conf/php.ini"
+            },
+            "limits": {
+                "requests": 100000
+            }
+        }
+    }
+}

+ 13 - 0
frameworks/PHP/php/php-nginx-unit.dockerfile

@@ -0,0 +1,13 @@
+FROM nginx/unit:1.9.0-php7.0
+
+RUN apt-get update -yqq > /dev/null && \
+    apt-get install -yqq php7.0-mysql > /dev/null
+
+ADD ./ /php
+WORKDIR /php
+
+# RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/7.3/fpm/php-fpm.conf ; fi;
+
+RUN unitd --control unix:/var/run/control.unit.sock && \
+    curl -X PUT --data-binary @/php/deploy/nginx-unit.json --unix-socket           \
+        /var/run/control.unit.sock http://localhost/config