Connect to your app container via SSH using the CLI by running platform ssh.Note: If your app generates PHP code at runtime based on user configuration, don’t disable timestamp validation.ĭoing so would prevent updates to the generated code from being loaded. You need to explicitly clear OPcache on deployment by restarting PHP-FPM. When you have disabled OPcache timestamp validation, Variables : php : 'opcache.validate_timestamps' : 0 php files your app has by running this command from your app root: To determine the maximum number of files to cache, follow these steps:Ĭonnect to the container via SSH using the CLIĭetermine roughly how many. The cache becomes less effective because it starts thrashing. If this value is lower than the number of files in the app, Opcache.max_accelerated_files is the maximum number of files that OPcache can cache at once. Since the preload script may change some of the configuration. Let the app run for a while before tuning OPcache OPcache needs to be tuned before production usage and can be configured the same way as PHP. To enable preloading, add a variable that specifies a preload script: You need to clear the OPcache explicitly on deployment (which can be done by restarting PHP-FPM). If you have disabled OPcache timestamp validation, Note that the only way to clear the preload cache is by restarting PHP-FPM. If your PHP version doesn’t support OPcache, this is a good reason to upgrade. OPcache is only available on PHP 7.4+ and uses PHP-CGI. If there are recommendations for optimal preload configuration or ready-to-use preload scripts. When OPcache is correctly configured, it can result in significant improvements to both CPU and memory usage.Ĭonsult your framework’s documentation to see It also removes the need to include these files later. Making their content (functions, classes) globally available for requests. OPcache preloading loads selected files into shared memory, To determine and set the optimal value for your app, see PHP-FPM sizing. The default worker count is set to a conservative default value. Then some requests wait until worker processes are available. If more simultaneous requests are received than the number of workers, PHP-FPM uses a fixed number of simultaneous worker processes to handle incoming requests. To change your PHP version, change the type in your app configuration.īefore merging to production, test the change on a branch and make sure that your app is working as expected. Upgrading the PHP version might require changes to your app.įor more details and recommendations, see the PHP migration guides. To make a PHP-based site run faster, the first step is to upgrade the PHP version. They’re also listed in about the order to investigate them. The following recommendations are guidelines only. Platform.sh offers a wide degree of flexibility in how PHP behaves,īut that does mean you may need to take a few steps to ensure your site is running optimally. It means that /var/opt/remi/php72/lib/php/session is only used by the apache user (the default user in the FPM pools of your distribution).Īnd if you use multiple FPM pools, running with different users, you have to set a different location for each, see php-fpm.Once your app is up and running it still needs to be kept fast. for mod_php, see /etc/httpd/conf.d/php.conf See these comments in your php.ini: RPM note : session directory must be owned by process owner So the path is configured in each SAPI file This is documented in the configuration file.Įach user must have a different location to avoid access issues.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |