Apache 2.4 + PHP 7.1 + PHP FPM = WOW for CPU

I recently changed hosts, switching hosts decreased the timing to generate a page by nearly half. I then switched to 7.1 (from 5.6.12) and enabled PHP_FPM, and decreased the timing by another 40%. From the old host to now my site is a minimum of 3x faster, and I'm still not done tweaking, :)
 
@Anthony Parsons I have a question about opcache settings. I just enabled the opcache for 7.1, and wow, the speed is ridiculously fast and the memory used dropped significantly.

The question I have: are the php.ini default settings ok to go with? i.e. for me: opcache.memory_consumption = 128 (seems high?) and opcache.max_accelerated_files = 4000 (again seems high IMO), and opcache.fast_shutdown = 0 (when searching around most had this value set to 1).

Thanks for any advice, :)
 
opcache.max_accelerated_files = 4000 (again seems high IMO),
This is actually borderline too low for default XenForo with ~2 themes and caching templates to file and a bunch of add-ons.

You've got 1000-2300 php files or so in stock library/ (depending on how much of Zend is being pulled in), and each theme is +600 php files easily.

I need to have it at 16000 in production on my site, due to all the themes and add-ons.
 
are the php.ini default settings ok to go with?
They are... but they always depend on what you're hosting. WP for example, most have very limited files to render styles and such, so that would be overkill... yet like Xon outlined, for XF... probably best to raise it.

Here's what I have learnt about reading around about optimisation settings: don't believe anything that is given, and instead tweak one setting at a time and measure for the results.

Some say turn down x setting, others say increase it. Increasing some settings, whilst it sounds like more is better, actually causes performance degradation upon measuring the outcome.

Adjust, measure for 24hrs. If you see improvement, keep tweaking. Often best to try both upper and lower settings to see effect, yet some are pretty standard for their setting direction.

MySQL settings for example, I ended up reverting mine to default because some settings whilst they helped, after talking to a DB guru, they told me to try removing a setting and see what happens. It actually improved performance... so I let @MattW go through it instead and I may tweak it in time myself.

Trial and error is the simple answer.
 
We have a problem with opcache.fast_shutdown =1 and I was trying to find the setting in php.ini to change it to 0. I could not find any opcache settings in php.ini. Can someone point me to where managing this is documented?

We are running Centos7.4 on vmware v66.0.22. The site is using php 5.6.

The software is there for php 7.0 and php-fpm but not active on any of the cPanel accounts
 
We have a problem with opcache.fast_shutdown =1 and I was trying to find the setting in php.ini to change it to 0. I could not find any opcache settings in php.ini. Can someone point me to where managing this is documented?

We are running Centos7.4 on vmware v66.0.22. The site is using php 5.6.

The software is there for php 7.0 and php-fpm but not active on any of the cPanel accounts

Try /etc/php.d/opcache.ini (or something similarly named)
You can also go to admin.php?tools/phpinfo on your forum and find it there in "Additional .ini files parsed".
 
Btw, regarding opcache max files...

The maximum number of keys (and therefore scripts) in the OPcache hash table. The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987 }that is greater than or equal to the configured value. The minimum value is 200. The maximum value is 100000 in PHP < 5.5.6, and 1000000 in later versions.

I have mine set to 65407.
 
I found the opcache.ini file using Putty but I thought there was a way to modify the contents of these files from WHM and perhaps that direct edits would get overwritten by some hidden stuff in WHM.

Is it OK to edit the files in php.d for the running configuration?
 
Back
Top Bottom