cPanel & WHM Version 92 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Enable file-based OpCache for PHP 7.0/7.1

sparek-3 shared this idea 4 years ago
Open Discussion

As a server administrator and shared web hosting provider I would like OpCache file caching to be compiled in with OpCache for PHP 7.0 and PHP7.1 in EasyApache4 in order to allow me the option to enable file-based caching if i would like to, and to help increase the security of my server.


Compiling this doesn't automatically enable file-based caching, but it gives administrators the option of enabling file-based OpCache in PHP 7.0 and PHP 7.1 if they so desire.


The fix for this would seem to be relatively simple, simply enable the opcache-file option in the spec file for each of PHP 7.0 and PHP 7.1.


For PHP 7.0, change line 1159 of the ea-php70.spec file from


--disable-opcache-file


to


--enable-opcache-file


For PHP 7.1, change line 1166 of the ea-php71.spec file from


--disable-opcache-file


to


--enable-opcache-file


The merits of OpCache security and the performance benefits of file-based OpCache, I suppose those could be discussed as well. But unless there is a specific reason why file-based OpCache should be disabled, I don't see why the option shouldn't at least be made available for server administrators to utilize.

Comments (4)

photo
1

OpCache tuning is left up to the admin, and is compiled if you select the correct profile. See https://forums.cpanel.net/threads/easyapache-4-all-php-options-opcache.504191/ and https://forums.cpanel.net/threads/opcache-config-in-ea4.583422/ for more details

photo
1

No, none of that applies to what I'm talking about.


OpCache as is provided by cPanel, i.e:


ea-php70-php-opcache-7.0.14-1.1.5.cpanel.x86_64

ea-php71-php-opcache-7.1.0-14.14.2.cpanel.x86_64


Is not compiled with --enable-opcache-file


No amount of configuration is going to solve that.


OpCache in PHP 7.0 and PHP 7.1 as provided by cPanel lack the configuration options


opcache.file_cache

opcache.file_cache_only


As described at:


http://php.net/manual/en/opcache.configuration.php


You can add those directives to your php.ini until your blue in the face, without the --enable-opcache-file compile flag (or perhaps the removal of --disable-opcache-file) those directives are not going to be recognized.


If you want to tell me how to set opcache.file_cache and opcache.file_cache_only with the current EA4 PHP 7.0 and EA4 PHP 7.1 modules, I'm all ears. But I don't think it can be done without recompiling the opcache.so module.

photo
photo
1

This seems real easy for cPanel to just include when compiling, so hopefully it's not something that goes years without attention just because there's not enough votes. I could definitely use anything that could help reduce cache slam when opcache restarts or on server reboot.

photo
1

I wouldn't hold my breathe.


From what I have seen, you have to have minions ready to back your idea or request on here. It doesn't matter how good or bad an idea is, if there aren't enough people to voice or vote for an idea it's not going to pass. And if there are enough votes, no matter how bad the idea is, they will bend over backwards to include it. Thinking of how certain ideas will be used or implemented in the future doesn't hold a lot of value. It's just about blind votes.


I don't have a ton of confidence in feature requests here. I see a lot of good ideas that never get any traction. And I see a ton of bad ideas that get a lot of traction.


For this particular request, the change is quite simple - you change one line in the spec file. I even told them how to do it. But that was nearly 3 months ago and nothing has changed yet. So why should I have confidence in the way this feature request system works?

photo
1

Yes, votes should not be required to enable common sense features. Makes me wonder how many of the developers run active servers with many accounts where they'd immediately see the need for improving cache handling when they all try to re-create their caches at the same time.


Another area of seen be a problem time and time again is 3rd party bundled software (Munin, PHPMyAdmin, Spamassassin) not being kept up-to-date because they either didn't have a Feature request or it didn't have enough votes. It's taken them years to get phpmyadmin updated because years ago they downgraded from a more recent version because of MySQL 5.1 compatibility instead of just installing a recent version if using later versions and the old version if 5.1 or earlier.


Munin was update one x.x.# release before a much needed bug fix yet nothing has happened there and the current installed version doesn't quite work properly.


Again, shouldn't need votes just for them to keep things maintained properly.


Heck it took the community starting a Feature Request asking for cPanel to pay more attention and actively respond to feature requests to even get some improvements which at least responded to by putting Benny into the mix to try and help things along.


Maybe there needs to be a category or other way of flagging a request as an easy config change, so the developers can see them and clear them quickly.


...or maybe we just need to discuss things randomly back and forth until it draws attention or stays closer to the top of the list often. :)

photo
photo
1

Hey guys: I understand that it can be frustrating when a request that you put in isn't picked up before ones that you feel are less important, or more difficult. Unfortunately, the speculation about how and why features we choose are picked is not helpful, and incorrect. This kind of conversation is also inappropriate for the feature request site, so please take it to a private email thread.


This one is already on the EasyApache team's radar, but obviously hasn't been picked up yet. As soon as that changes, I'll let you know.

photo
1

Great. Simply stating that it's on the teams' radar is a good response. All feature requests should have some kind of response similar from the cPanel side either acknowledging that the team has been made aware of the request and will review at some point, or have rejected a request. It's just a basic level of feedback that all requests deserve I think no matter what their status. In my opinion no requests should go months without any response from the cPanel side. It just leaves people feeling unheard. Just some thoughts on further improving the process.

photo
1

Thank you! I definitely appreciate the feedback, but this is also not really appropriate for the feature request site. :)


If you have more feedback to provide, please email me (my email address is my username).

photo
photo
1

Any movement on this? Seems to still not work. And could be helpful in this case: https://tideways.com/profiler/blog/dodge-the-thundering-herd-with-file-based-opcache-in-php7 and when sites get little traffic and their PHP processes drop out but SSDs could still cache their code.