It also offers additional insights into the operation of your site and can suggest places to further optimize your configuration or when it’s time to increase your plan size. That offers visualization of access logs to determine how much memory requests are using on average. The web agency Pixelant has released a log analyzer tool for Platform.sh To optimize your app, consider using a profiler.Ī profiler helps determine what slow spots can be found and addressed and helps improve performance. 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. Once your app is up and running it still needs to be kept fast.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |