Jump to content

PHP 7 caching


Recommended Posts

Posted

What is the best option for caching method on a server using PHP 7?

I want to use memcached but I'm told that isn't available with PHP 7. Is this true and is there an alternative?

Posted
4 minutes ago, marklcfc said:

What is the best option for caching method on a server using PHP 7?

I want to use memcached but I'm told that isn't available with PHP 7. Is this true and is there an alternative?

Maybe this Article will help you out.

Posted

I've asked my hosts time and time again as well as showing them that article above but get told

Quote

The PHP functions need to be supported by cPanel to not be lost on the upgrades and work with cPanels EasyApache, this also helps ensure the stability of your server. These guides are if you have a stand alone Apache install.

 

  • 2 weeks later...
Posted

I am currently running php 7.0.12 with Redis and ofcourse opcache
 

Your best bet is to change hosts or host it yourself if you want it all to work nicely on php7 

The problem with hosts running WHM/CPanel is that updates to PHP 7 are really slow since not all is stable yet, therefore they have to wait till WHM/easyapache decides to release it.

Posted
On 30/10/2016 at 4:14 PM, SteffM said:

I am currently running php 7.0.12 with Redis and ofcourse opcache
 

Your best bet is to change hosts or host it yourself if you want it all to work nicely on php7 

The problem with hosts running WHM/CPanel is that updates to PHP 7 are really slow since not all is stable yet, therefore they have to wait till WHM/easyapache decides to release it.

What php handler do you use with redis and opcache? I ran into problems with opcache and fastcgi, my hosts have suggested dso but have no experience of it.

also with Redis should I use file system or MySQL database?

Posted

I am currently running CentOS 7 with apache and installed the php70u packages:

PHP 7.0.12 (cli) (built: Oct 14 2016 09:23:01) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.12, Copyright (c) 1999-2016, by Zend Technologies

It doens't matter if you use MySQL or File System, they both do their job well enough, but the fastest would be MySQL.
 

Posted

This doens't look weird to me.

You have 58 cache misses and 58 cached scripts, that's how caching works, the first script will always be a miss, the requests afterwards will be serving the cached version.

Either your website doesn't get any traffic or you restarted your webserver.
If you want to see your hits increasing you need more requests and don't be restarting your webserver/changing files.

if you hit F5 a couple of times on your IPB, your cache hits should increase

Posted

No, cache hits never changed from 2. I had opcache online for a few hours before disabling opcache and looking for advice. My site gets quite alot of hits in that time. My host said:

 

B) As you are running CGI as your PHP handler opcache gets emptied on every request as each of them starts there own cache. The other PHP handler that can be used is "dso".

Posted

Are you running your own server (vps/dedi) or is this a shared hosting?

I know back in 2015 there was several discussions with issues with PHP opcache and shared hosting - it was sharing the cache across the various clients and caused issues.

I didn't keep up with it closely as I prefer a high performance setup than a cPanel/WHM setup.

 

Posted
1 hour ago, marklcfc said:

PHP handler opcache gets emptied on every request as each of them starts there own cache

That's quite interesting.


I've never been a fan of shared hosting(except for low-traffic word-press websites), due to the fact you can't customize anything and the shared hosting company has a lot of restrictions.

DSO is the old name of apache's mod_php

I am running mod_php myself, but it's not in a shared hosting environment.
It completely depends on what your shared hosting companies allows you to change in your Apache/PHP configuration
If they say you can switch to mod_php, you can try doing that in your shared web hosting configuration panel right?

 

This are my opcache statistics:

98b98af89e164597b41c26bbd44292bd.png

Posted

I'm on a dedicated server, I didn't change over to dso because as far as I was aware fastcgi was better for forums. Someone told me this:

 

Quote

php-fpm aka FastCGI and opcache work find together.

Using DSO causes memory scaling problems as the number of php instances scales with load rather than being fixed. Better to serve a known fixed number of php pages at a time, rather than attempt to serve upto thousands with no warning or scalability.

CGI means every page, the webserver forks to run a php instance from scratch. It is slow.

suPHP is sudo followed by CGI. It is even slower than CGI.

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...