TrafeX / docker-php-nginx

Docker image with PHP-FPM 8.3 & Nginx 1.24 on Alpine Linux
https://hub.docker.com/r/trafex/php-nginx
MIT License
1.33k stars 721 forks source link

Optimize PHP-FPM with JIT #162

Closed jduan00 closed 1 month ago

jduan00 commented 6 months ago

I have been using the following optimization to enable JIT. Hope this is hopeful to others as well. If this can be made into the docker image in the future. Thanks for this great project! - Jack

end_extension=opcache
opcache.enable=1
opcache.enable_cli=1
opcache.jit_buffer_size=512M
opcache.jit=1235
opcache.memory_consumption=512
opcache.interned_strings_buffer=64
opcache.max_accelerated_files=10000
opcache.max_wasted_percentage=10

opcache.validate_timestamps=0
;opcache.revalidate_freq=5

opcache.fast_shutdown=1
opcache.blacklist_filename=/etc/php82/opcache*.blacklist
opcache.huge_code_pages=1
TrafeX commented 6 months ago

Hi @jduan00,

Thank you for your contribution! If you want, you can open a PR with an addition to the docs/ folder that describes how to configure this?

jduan00 commented 6 months ago

Hi @TrafeX,

I appended this block in config/php.ini. I will work on a PR soon! Thanks for looking into this. Cheers

opcache.enable=1
opcache.enable_cli=1
opcache.jit_buffer_size=512M
opcache.jit=1235
opcache.memory_consumption=512
opcache.interned_strings_buffer=64
opcache.max_accelerated_files=10000
opcache.max_wasted_percentage=10

;for production deployment, set to 0
opcache.validate_timestamps=0

opcache.fast_shutdown=1
opcache.blacklist_filename=/etc/php82/opcache*.blacklist
opcache.huge_code_pages=1
TrafeX commented 1 month ago

I'll close this issue due to inactivity. Feel free to open a PR anytime!