Advertisement:

Author Topic: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0  (Read 996 times)

Offline fredolingo

  • Newbie
  • *
  • Posts: 5
Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« on: January 31, 2019, 09:32:37 AM »
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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,992
    • StoryBB/StoryBB on GitHub
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #1 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.
« Last Edit: January 31, 2019, 11:13:46 AM by Arantor »
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Online drewactual

  • Full Member
  • ***
  • Posts: 601
    • College Football Fan Site CFB51
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #2 on: January 31, 2019, 11:07:25 AM »
did you start memcache?  dumb question, i know... but I didn't. 

Code: [Select]
memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody



Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,992
    • StoryBB/StoryBB on GitHub
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #3 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)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline fredolingo

  • Newbie
  • *
  • Posts: 5
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #4 on: January 31, 2019, 03:59:53 PM »
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.

did you start memcache?  dumb question, i know... but I didn't.
As stated in OP, I have confirmed that memcached works.

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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,992
    • StoryBB/StoryBB on GitHub
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #5 on: January 31, 2019, 04:17:45 PM »
You installed php-memcached, you need php-memcache.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Online drewactual

  • Full Member
  • ***
  • Posts: 601
    • College Football Fan Site CFB51
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #6 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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,992
    • StoryBB/StoryBB on GitHub
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #7 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline fredolingo

  • Newbie
  • *
  • Posts: 5
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #8 on: February 01, 2019, 12:57:39 AM »
You installed php-memcached, you need php-memcache.
SMF has detected that your server has Memcached installed.

And there you have it!
Thank you.
.... 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 ?

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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,992
    • StoryBB/StoryBB on GitHub
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #9 on: February 01, 2019, 02:32:33 AM »
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline fredolingo

  • Newbie
  • *
  • Posts: 5
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #10 on: February 01, 2019, 03:01:48 AM »
Might be, I don't know.

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

I'll do some checking.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,992
    • StoryBB/StoryBB on GitHub
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #11 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline fredolingo

  • Newbie
  • *
  • Posts: 5
Re: Enable caching on SMF2.0.15, Ubuntu 16.04.05, Apache24, php7.0
« Reply #12 on: February 01, 2019, 03:37:38 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!