Browse Source

add disable coroutine case (#6818)

* Update IndexController.php

* add disable coroutine case

* name

* c name

* font
vic 3 years ago
parent
commit
8745f6797b

+ 24 - 0
frameworks/PHP/one/App/swoole_disable_coroutine.php

@@ -0,0 +1,24 @@
+<?php
+/**
+ * swoole 运行这个文件
+ * php swoole.php
+ */
+define('_APP_PATH_', __DIR__);
+
+define('_APP_PATH_VIEW_', __DIR__ . '/View');
+
+//define('_DEBUG_',true);
+
+require __DIR__ . '/../vendor/autoload.php';
+require __DIR__ . '/../vendor/lizhichao/one/src/run.php';
+require __DIR__ . '/config.php';
+
+
+\One\Swoole\OneServer::parseArgv();
+
+//\Swoole\Runtime::enableCoroutine();
+
+\One\Swoole\OneServer::runAll();
+
+
+

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

@@ -24,6 +24,29 @@
         "display_name": "one",
         "notes": "",
         "versus": "swoole"
+      },
+      "no-coroutine": {
+        "json_url": "/json",
+        "plaintext_url": "/plaintext",
+        "db_url": "/db",
+        "fortune_url": "/fortunes",
+        "update_url": "/updates/",
+        "query_url": "/queries/",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Fullstack",
+        "database": "MySQL",
+        "framework": "one",
+        "language": "PHP",
+        "flavor": "None",
+        "orm": "Full",
+        "platform": "swoole",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "one-no-coroutine",
+        "notes": "",
+        "versus": "swoole"
       }
     }
   ]

+ 32 - 0
frameworks/PHP/one/one-no-coroutine.dockerfile

@@ -0,0 +1,32 @@
+FROM php:8.0-cli
+
+RUN pecl install swoole > /dev/null && \
+    docker-php-ext-enable swoole
+
+RUN docker-php-ext-install opcache pdo_mysql bcmath > /dev/null
+
+RUN apt -yqq update > /dev/null && \
+    apt -yqq install git unzip > /dev/null
+
+COPY . /one
+COPY php.ini /usr/local/etc/php/
+RUN echo "opcache.enable=1" >> /usr/local/etc/php/php.ini
+RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/php.ini
+RUN echo "pcre.jit=1" >> /usr/local/etc/php/php.ini
+RUN echo "opcache.jit=1205" >> /usr/local/etc/php/php.ini
+RUN echo "opcache.jit_buffer_size=256M" >> /usr/local/etc/php/php.ini
+
+RUN php -v && php -i | grep opcache
+
+WORKDIR /one
+
+RUN curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
+RUN composer install --no-dev --classmap-authoritative --quiet > /dev/null
+RUN composer dumpautoload -o
+
+RUN mkdir -p /one/App/RunCache
+RUN chmod -R 777 /one/App/RunCache
+
+EXPOSE 8080
+
+CMD php App/swoole_disable_coroutine.php