Forráskód Böngészése

[php] Symfony add ReactPHP runtime (#10110)

* [php] Symfony add ReactPHP runtime

* Add JIT

* Add libuv
Joan Miquel 2 napja
szülő
commit
f9ab8cdbf5

+ 24 - 0
frameworks/PHP/symfony/benchmark_config.json

@@ -140,6 +140,30 @@
       "versus": "php",
       "tags": []
     },
+    "react": {
+      "plaintext_url": "/plaintext",
+      "json_url": "/json",
+      "db_url": "/db",
+      "update_url": "/updates?queries=",
+      "query_url": "/queries?queries=",
+      "fortune_url": "/fortunes",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "Postgres",
+      "framework": "symfony",
+      "language": "PHP",
+      "flavor": "PHP8",
+      "orm": "Full",
+      "platform": "reactphp",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "symfony [react]",
+      "notes": "",
+      "versus": "php",
+      "tags": []
+    },
     "franken": {
       "plaintext_url": "/plaintext",
       "json_url": "/json",

+ 3 - 0
frameworks/PHP/symfony/deploy/swoole/php.ini

@@ -17,3 +17,6 @@ opcache.validate_timestamps=0
 opcache.memory_consumption=256
 opcache.max_accelerated_files=20000
 opcache.preload_user=www-data
+
+opcache.jit_buffer_size = 128M
+opcache.jit = tracing

+ 38 - 0
frameworks/PHP/symfony/symfony-react.dockerfile

@@ -0,0 +1,38 @@
+FROM php:8.4-cli
+
+RUN apt-get update -yqq && \
+    apt-get install -yqq libpq-dev libicu-dev git > /dev/null && \
+    docker-php-ext-install pdo_pgsql opcache intl pcntl > /dev/null
+
+COPY --link deploy/swoole/php.ini /usr/local/etc/php/
+WORKDIR /symfony
+COPY --link . .
+
+# We deal with concurrencies over 1k, which stream_select doesn't support.
+# libuv
+RUN apt-get install -yqq libuv1-dev > /dev/null \
+     && pecl install uv-beta > /dev/null
+RUN docker-php-ext-enable uv
+
+# libevent
+# RUN apt-get install -y libevent-dev > /dev/null \
+#    && pecl install event-3.1.4 > /dev/null
+# RUN docker-php-ext-enable event
+
+
+COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer
+
+#ENV APP_DEBUG 1
+ENV APP_ENV prod
+
+#ENV APP_RUNTIME "Runtime\React\Runtime"
+#RUN composer require runtime/react --update-no-dev --no-scripts --quiet
+
+ENV APP_RUNTIME "Zolex\ReactPhpBundle\Runtime\ReactPhpRuntime"
+ENV REACT_HOST "0.0.0.0"
+RUN composer require zolex/reactphp-bundle --update-no-dev --no-scripts --quiet
+RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear
+
+EXPOSE 8080
+
+ENTRYPOINT [ "php", "/symfony/public/runtime.php" ]