Skip to content

Commit

Permalink
Fix debug container memory usage and slow xdebug performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Derschatta authored and derschatta committed Nov 19, 2024
1 parent cf7d07a commit 1bee22c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 12 deletions.
4 changes: 3 additions & 1 deletion php/php71-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Set some sensible defaults
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \
# Note that PHP's memory limit needs to be high enough.
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini
4 changes: 3 additions & 1 deletion php/php72-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Set some sensible defaults
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \
# Note that PHP's memory limit needs to be high enough.
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini
4 changes: 3 additions & 1 deletion php/php73-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Set some sensible defaults
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \
# Note that PHP's memory limit needs to be high enough.
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini
4 changes: 3 additions & 1 deletion php/php74-debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Set some sensible defaults
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \
# Note that PHP's memory limit needs to be high enough.
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini
6 changes: 4 additions & 2 deletions php/php80-debug/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM totara/docker-dev-php80:latest

RUN pecl install -f xdebug-3.3.2 && docker-php-ext-enable xdebug.so
RUN pecl install -f xdebug-3.4.0beta1 && docker-php-ext-enable xdebug.so
RUN pecl install -f pcov && docker-php-ext-enable pcov.so

RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
Expand All @@ -9,5 +9,7 @@ RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Set some sensible defaults
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \
# Note that PHP's memory limit needs to be high enough.
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini
6 changes: 4 additions & 2 deletions php/php81-debug/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM totara/docker-dev-php81:latest

RUN pecl install -f xdebug-3.3.2 && docker-php-ext-enable xdebug.so
RUN pecl install -f xdebug-3.4.0beta1 && docker-php-ext-enable xdebug.so
RUN pecl install -f pcov && docker-php-ext-enable pcov.so

RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
Expand All @@ -9,5 +9,7 @@ RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Set some sensible defaults
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \
# Note that PHP's memory limit needs to be high enough.
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini
6 changes: 4 additions & 2 deletions php/php82-debug/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM totara/docker-dev-php82:latest

RUN pecl install -f xdebug-3.3.2 && docker-php-ext-enable xdebug.so
RUN pecl install -f xdebug-3.4.0beta1 && docker-php-ext-enable xdebug.so
RUN pecl install -f pcov && docker-php-ext-enable pcov.so

RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
Expand All @@ -9,5 +9,7 @@ RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Set some sensible defaults
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \
# Note that PHP's memory limit needs to be high enough.
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini
6 changes: 4 additions & 2 deletions php/php83-debug/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM totara/docker-dev-php83:latest

RUN pecl install -f xdebug-3.3.2 && docker-php-ext-enable xdebug.so
RUN pecl install -f xdebug-3.4.0beta1 && docker-php-ext-enable xdebug.so
RUN pecl install -f pcov && docker-php-ext-enable pcov.so

RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
Expand All @@ -9,5 +9,7 @@ RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
# Set some sensible defaults
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \
# Note that PHP's memory limit needs to be high enough.
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini

0 comments on commit 1bee22c

Please sign in to comment.