Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0

Started by fredolingo, January 31, 2019, 09:32:37 AM

Previous topic - Next topic

fredolingo

Hi,
I want to enable caching for my forum.
I have tried with memcached.
(memcached, php-memcached, libmemcached11:amd64 is installed, memcached is listening on 127.0.0.1:11211
memcached is listed on a phpinfo, and I have confirmed caching using a separate php-page.
Restartet both apache, memcached and the server)

My server-settings page still only lists:
"SMF has not been able to detect a compatible accelerator on your server."

I'm unable to find anything online about how to configure this, or how SMF actually detects this.

I did try with APCu instead, but apparently that's not supported untill 2.1.x arrives?

Any pointers or hints?

Arantor

You also need to install the PHP-to-memcache connector, which you may not have done. There are two, and I think you installed the newer one that 2.0 doesn't support.

drewactual

did you start memcache?  dumb question, i know... but I didn't. 

memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody




Arantor

I think the issue is using the wrong memcache library (as there are two and the OP mentions the newer one)

fredolingo

Quote from: Arantor on January 31, 2019, 10:44:07 AM
You also need to install the PHP-to-memcache connector, which you may not have done. There are two, and I think you installed the newer one that 2.0 doesn't support.
Where's the link to the supported configurations?
All I could find was how to activate caching, and that was sorely lacking.

Quote from: drewactual on January 31, 2019, 11:07:25 AM
did you start memcache?  dumb question, i know... but I didn't.
As stated in OP, I have confirmed that memcached works.

Quote from: Arantor on January 31, 2019, 11:14:17 AM
I think the issue is using the wrong memcache library (as there are two and the OP mentions the newer one)
Could you mention the last one?

Arantor


drewactual

.... and I jumped through hoops to find the memcachE i used.  It works in Apache2.4 MPM build running php7.0 just fine- but it was a PAIN to find it.  If you're interested, I can likely track it down for you?

Arantor

I really should port across the Redis cache backend I wrote, it performs better than either memcache or memcached in all the testing I could throw at it.

fredolingo

Quote from: Arantor on January 31, 2019, 04:17:45 PM
You installed php-memcached, you need php-memcache.
SMF has detected that your server has Memcached installed.

And there you have it!
Thank you.
Quote from: drewactual on January 31, 2019, 05:56:04 PM
.... and I jumped through hoops to find the memcachE i used.  It works in Apache2.4 MPM build running php7.0 just fine- but it was a PAIN to find it.  If you're interested, I can likely track it down for you?
apt install php-memcache ?

Quote from: Arantor on January 31, 2019, 05:57:42 PM
I really should port across the Redis cache backend I wrote, it performs better than either memcache or memcached in all the testing I could throw at it.
That'll be great, but from a new guy - what this needs is documentation and examples.
I couldn't find any implementation guides regarding caching, all the posts I could find pointed to very old forumposts that detailed optimizations in the forum, not "external" caching like this.

Redis is awesome though.

Arantor

Thing is, it's not like SMF gives you any control over it and there are much simpler ways to optimise SMF particularly for new sites than that.

fredolingo

Might be, I don't know.

Doesn't look like memcached is any good on my server though:
QuotePage created in 25.368 seconds with 50 queries.
Used to be less than a second.

I'll do some checking.

Arantor

Turn on debug: add $db_show_debug = true; to Settings.php.

Note: the core SMF is pretty good about caching, but mods and addons often don't use it.

fredolingo

Quote from: Arantor on February 01, 2019, 03:20:24 AM
Turn on debug: add $db_show_debug = true; to Settings.php.

Note: the core SMF is pretty good about caching, but mods and addons often don't use it.
Whops... Wrong name in hostname, fairly easy to pick up with that debugger.
I'll certainly document that setting, thanks!

Advertisement: