Skip to content

Commit 845daee

Browse files
authored
Merge pull request #75 from kool-dev/tune_nginx_processes
Tune nginx processes
2 parents e18825d + 6357723 commit 845daee

45 files changed

Lines changed: 122 additions & 30 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7.1-nginx-prod/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
88
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
99
NGINX_FASTCGI_READ_TIMEOUT=60s \
1010
NGINX_FASTCGI_BUFFERS='8 8k' \
11-
NGINX_FASTCGI_BUFFER_SIZE='16k'
11+
NGINX_FASTCGI_BUFFER_SIZE='16k' \
12+
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true
1213

1314
RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
1415
&& chmod +x /usr/local/bin/supervisord \
@@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
2829
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
2930
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
3031
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
31-
&& rm -rf server-configs-nginx-*
32+
&& rm -rf server-configs-nginx-* \
33+
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
34+
&& chmod +x /kool/30-tune-worker-processes.sh
3235

3336
COPY supervisor.conf /kool/supervisor.conf
3437
COPY default.tmpl /kool/default.tmpl

7.1-nginx-prod/entrypoint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ fi
1111

1212
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
1313

14+
/kool/30-tune-worker-processes.sh
15+
1416
# Run entrypoint if provided
1517
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
1618
bash $ENTRYPOINT

7.1-nginx/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
88
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
99
NGINX_FASTCGI_READ_TIMEOUT=60s \
1010
NGINX_FASTCGI_BUFFERS='8 8k' \
11-
NGINX_FASTCGI_BUFFER_SIZE='16k'
11+
NGINX_FASTCGI_BUFFER_SIZE='16k' \
12+
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true
1213

1314
RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
1415
&& chmod +x /usr/local/bin/supervisord \
@@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
2829
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
2930
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
3031
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
31-
&& rm -rf server-configs-nginx-*
32+
&& rm -rf server-configs-nginx-* \
33+
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
34+
&& chmod +x /kool/30-tune-worker-processes.sh
3235

3336
COPY supervisor.conf /kool/supervisor.conf
3437
COPY default.tmpl /kool/default.tmpl

7.1-nginx/entrypoint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ fi
2020

2121
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
2222

23+
/kool/30-tune-worker-processes.sh
24+
2325
# Run entrypoint if provided
2426
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
2527
bash $ENTRYPOINT

7.1-prod/entrypoint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ fi
1111

1212
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf
1313

14+
1415
# Run entrypoint if provided
1516
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
1617
bash $ENTRYPOINT

7.1/entrypoint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fi
2020

2121
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf
2222

23+
2324
# Run entrypoint if provided
2425
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
2526
bash $ENTRYPOINT

7.2-nginx-prod/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
88
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
99
NGINX_FASTCGI_READ_TIMEOUT=60s \
1010
NGINX_FASTCGI_BUFFERS='8 8k' \
11-
NGINX_FASTCGI_BUFFER_SIZE='16k'
11+
NGINX_FASTCGI_BUFFER_SIZE='16k' \
12+
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true
1213

1314
RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
1415
&& chmod +x /usr/local/bin/supervisord \
@@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
2829
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
2930
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
3031
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
31-
&& rm -rf server-configs-nginx-*
32+
&& rm -rf server-configs-nginx-* \
33+
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
34+
&& chmod +x /kool/30-tune-worker-processes.sh
3235

3336
COPY supervisor.conf /kool/supervisor.conf
3437
COPY default.tmpl /kool/default.tmpl

7.2-nginx-prod/entrypoint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ fi
1111

1212
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
1313

14+
/kool/30-tune-worker-processes.sh
15+
1416
# Run entrypoint if provided
1517
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
1618
bash $ENTRYPOINT

7.2-nginx/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
88
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
99
NGINX_FASTCGI_READ_TIMEOUT=60s \
1010
NGINX_FASTCGI_BUFFERS='8 8k' \
11-
NGINX_FASTCGI_BUFFER_SIZE='16k'
11+
NGINX_FASTCGI_BUFFER_SIZE='16k' \
12+
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true
1213

1314
RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
1415
&& chmod +x /usr/local/bin/supervisord \
@@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
2829
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
2930
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
3031
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
31-
&& rm -rf server-configs-nginx-*
32+
&& rm -rf server-configs-nginx-* \
33+
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
34+
&& chmod +x /kool/30-tune-worker-processes.sh
3235

3336
COPY supervisor.conf /kool/supervisor.conf
3437
COPY default.tmpl /kool/default.tmpl

7.2-nginx/entrypoint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ fi
2020

2121
dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf
2222

23+
/kool/30-tune-worker-processes.sh
24+
2325
# Run entrypoint if provided
2426
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
2527
bash $ENTRYPOINT

0 commit comments

Comments
 (0)