瀏覽代碼

PHP-ngx-pgsql x2 workers (#5356)

Joan Miquel 5 年之前
父節點
當前提交
18edd4d5dc
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile

+ 3 - 1
frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile

@@ -28,4 +28,6 @@ RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
 
 RUN sed -i "s|mysql:|pgsql:|g" /app.php
 
-CMD /nginx/sbin/nginx -c /deploy/nginx.conf
+CMD export WORKERS=$(( 2 * $(nproc) )) && \
+    sed -e "s/worker_processes  auto/worker_processes $WORKERS/g" /deploy/nginx.conf && \
+    /nginx/sbin/nginx -c /deploy/nginx.conf