Browse Source

Revert workerman to x3 workers (#5320)

* Revert workerman to x3 workers

* Update to ubuntu 19.10 and php 7.4
Joan Miquel 5 years ago
parent
commit
4ab9d77d6a

+ 1 - 1
frameworks/PHP/workerman/server.php

@@ -6,7 +6,7 @@ use Workerman\Protocols\Http;
 use Workerman\Worker;
 use Workerman\Worker;
 
 
 $http_worker                = new Worker('http://0.0.0.0:8080');
 $http_worker                = new Worker('http://0.0.0.0:8080');
-$http_worker->count         = (int) shell_exec('nproc') * 4;
+$http_worker->count         = (int) shell_exec('nproc') * 3;
 $http_worker->onWorkerStart = function () {
 $http_worker->onWorkerStart = function () {
     global $pdo, $statement, $fortune, $random, $update;
     global $pdo, $statement, $fortune, $random, $update;
     $pdo = new PDO('mysql:host=tfb-database;dbname=hello_world',
     $pdo = new PDO('mysql:host=tfb-database;dbname=hello_world',

+ 4 - 4
frameworks/PHP/workerman/workerman-async.dockerfile

@@ -1,18 +1,18 @@
-FROM ubuntu:19.04
+FROM ubuntu:19.10
 
 
 ARG DEBIAN_FRONTEND=noninteractive
 ARG DEBIAN_FRONTEND=noninteractive
 
 
 RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
 RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
 RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 RUN apt-get update -yqq > /dev/null && \
 RUN apt-get update -yqq > /dev/null && \
-    apt-get install -yqq php7.3 php7.3-common php7.3-cli php7.3-mysql  > /dev/null
+    apt-get install -yqq php7.4 php7.4-common php7.4-cli php7.4-mysql  > /dev/null
 
 
 RUN apt-get install -yqq composer > /dev/null
 RUN apt-get install -yqq composer > /dev/null
 
 
 RUN apt-get install -y php-pear php-dev libevent-dev > /dev/null
 RUN apt-get install -y php-pear php-dev libevent-dev > /dev/null
-RUN printf "\n\n /usr/lib/x86_64-linux-gnu/\n\n\nno\n\n\n" | pecl install event > /dev/null && echo "extension=event.so" > /etc/php/7.3/cli/conf.d/event.ini
+RUN printf "\n\n /usr/lib/x86_64-linux-gnu/\n\n\nno\n\n\n" | pecl install event > /dev/null && echo "extension=event.so" > /etc/php/7.4/cli/conf.d/event.ini
 
 
-COPY php.ini /etc/php/7.3/cli/php.ini
+COPY php.ini /etc/php/7.4/cli/php.ini
 
 
 ADD ./ /workerman
 ADD ./ /workerman
 WORKDIR /workerman
 WORKDIR /workerman

+ 4 - 4
frameworks/PHP/workerman/workerman-pgsql.dockerfile

@@ -1,18 +1,18 @@
-FROM ubuntu:19.04
+FROM ubuntu:19.10
 
 
 ARG DEBIAN_FRONTEND=noninteractive
 ARG DEBIAN_FRONTEND=noninteractive
 
 
 RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
 RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
 RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 RUN apt-get update -yqq > /dev/null && \
 RUN apt-get update -yqq > /dev/null && \
-    apt-get install -yqq php7.3 php7.3-common php7.3-cli php7.3-pgsql > /dev/null
+    apt-get install -yqq php7.4 php7.4-common php7.4-cli php7.4-pgsql php7.4-xml > /dev/null
 
 
 RUN apt-get install -yqq composer > /dev/null
 RUN apt-get install -yqq composer > /dev/null
 
 
 RUN apt-get install -y php-pear php-dev libevent-dev > /dev/null
 RUN apt-get install -y php-pear php-dev libevent-dev > /dev/null
-RUN printf "\n\n /usr/lib/x86_64-linux-gnu/\n\n\nno\n\n\n" | pecl install event > /dev/null && echo "extension=event.so" > /etc/php/7.3/cli/conf.d/event.ini
+RUN printf "\n\n /usr/lib/x86_64-linux-gnu/\n\n\nno\n\n\n" | pecl install event > /dev/null && echo "extension=event.so" > /etc/php/7.4/cli/conf.d/event.ini
 
 
-COPY php.ini /etc/php/7.3/cli/php.ini
+COPY php.ini /etc/php/7.4/cli/php.ini
 
 
 ADD ./ /workerman
 ADD ./ /workerman
 WORKDIR /workerman
 WORKDIR /workerman

+ 4 - 4
frameworks/PHP/workerman/workerman.dockerfile

@@ -1,18 +1,18 @@
-FROM ubuntu:19.04
+FROM ubuntu:19.10
 
 
 ARG DEBIAN_FRONTEND=noninteractive
 ARG DEBIAN_FRONTEND=noninteractive
 
 
 RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
 RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
 RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 RUN apt-get update -yqq > /dev/null && \
 RUN apt-get update -yqq > /dev/null && \
-    apt-get install -yqq php7.3 php7.3-common php7.3-cli php7.3-mysql  > /dev/null
+    apt-get install -yqq php7.4 php7.4-common php7.4-cli php7.4-xml php7.4-mysql  > /dev/null
 
 
 RUN apt-get install -yqq composer > /dev/null
 RUN apt-get install -yqq composer > /dev/null
 
 
 RUN apt-get install -y php-pear php-dev libevent-dev > /dev/null
 RUN apt-get install -y php-pear php-dev libevent-dev > /dev/null
-RUN printf "\n\n /usr/lib/x86_64-linux-gnu/\n\n\nno\n\n\n" | pecl install event > /dev/null && echo "extension=event.so" > /etc/php/7.3/cli/conf.d/event.ini
+RUN printf "\n\n /usr/lib/x86_64-linux-gnu/\n\n\nno\n\n\n" | pecl install event > /dev/null && echo "extension=event.so" > /etc/php/7.4/cli/conf.d/event.ini
 
 
-COPY php.ini /etc/php/7.3/cli/php.ini
+COPY php.ini /etc/php/7.4/cli/php.ini
 
 
 ADD ./ /workerman
 ADD ./ /workerman
 WORKDIR /workerman
 WORKDIR /workerman