Jump to content

Caching: APCu vs Memcached


Recommended Posts

Hello 🙂

Redis is the best for the latest IPS suite ....

Second option is Memcached.

Other than that according to my tests Apcu was not performing very well and after a high load i got also degraded performance so it is not recommended.

 

Link to comment
Share on other sites

Sure it is possible 🙂

As i am not using Cpanel i can't provide you a tested tutorial but you can find many on Google like:

https://tecadmin.net/install-redis-cpanel/

You may just need to adjust only the php path related to the version that you are using...

Maybe there is an even easier way.... Just google it.

Remember that you must install Redis and Php Redis extension and they are two separated things ...

Link to comment
Share on other sites

Hey, @bfarber help me understand this, when you select Redis as the storage mechanism is that ONLY for cache or does it replace MySQL (I assume not), the wording on that page in the adminCP is a bit confusing as to the extent that REDIS will be used.

From my understanding redis is memory so if the redis server restarts the data is lost.

Link to comment
Share on other sites

There are a couple of options present, but effectively if you choose to use Redis for the data storage option, then certain caches that we place in what we call a "data store" will be put in redis. You can also use MySQL or disk for these caches. There is also an option to use Redis to handle a few other functions, such as session management and topic view temporary counter storage.

MySQL will always be used to store your persistent data, because as you said, restarting the server can't also result in restarting your community.

Link to comment
Share on other sites

57 minutes ago, bfarber said:

MySQL will always be used to store your persistent data, because as you said, restarting the server can't also result in restarting your community.

Got it, that is what I thought. I just wanted to be super sure.

 

I suppose external Redis defeats the purpose due to tpc latency.

(Can't use Redis on shared hosting (memory is accessible by others) so I suppose APC is probably the best atm for shared hosting.

Link to comment
Share on other sites

We encode the content stored in Redis so you shouldn't have too many concerns about shared hosting. Also, Redis could be set up on an external server but on the internal network, so network latency is almost a non-issue at that point.

Still, it's really only going to be worth it if your site is measurably getting "bigger". If you have 100 posts and 10 users online for instance, the improvements would likely not even be measurable. If you have 10,000,000 posts and 1,000 users actively browsing, the gains would be worthwhile.

Link to comment
Share on other sites

8 hours ago, bfarber said:

If you have 100 posts and 10 users online for instance, the improvements would likely not even be measurable. If you have 10,000,000 posts and 1,000 users actively browsing, the gains would be worthwhile.

I understand those numbers are not meant to be taken literally, but what about the sites that fall in between? I have a site with 400,000 posts and about 4,000 members, is it worth the time and money to set up Redis and try or am I better of with memcached?

Link to comment
Share on other sites

It's hard to answer that definitively. The user counts that really matter are how many users there are online simultaneously using the site, rather than the total number of registered users. If you have 4000 people online at once, then extra caching layers will definitely help. If you have 4 online at once, they're probably not going to make much difference.

Link to comment
Share on other sites

  • 2 weeks later...
On 3/12/2019 at 8:35 AM, bfarber said:

There are a couple of options present, but effectively if you choose to use Redis for the data storage option, then certain caches that we place in what we call a "data store" will be put in redis. You can also use MySQL or disk for these caches. There is also an option to use Redis to handle a few other functions, such as session management and topic view temporary counter storage.

MySQL will always be used to store your persistent data, because as you said, restarting the server can't also result in restarting your community.

As I'm actively working on migrating my 3.4.8 forum to 4.4.2, I'd like to employ an appropriate caching solution.  I typically have over 1,000 active users in the middle of the day, so I'm sure caching would be worthwhile. I've never used Redis before, and I'm not too terribly familiar with it yet, but based on your recommendation I'm going to install it and try it out.

I'm quite curious about the "data storage option".  The description just states it saves "arbitrary data".  I assume attachments are always stored using the file system?   Can you be a bit more explicit about what data/files this covers?  I have over 250GB of attachments on my forum, and saving that data in MySQL frightens me..  Although not having tens of thousands of files sitting in directories would be nice, doing database dumps and restores would be a nightmare. 

Thank you. 

Link to comment
Share on other sites

Attachments are stored dependent upon your configuration (file system is the default, but database and S3 are two other built in options).

The "data store" is analogous to the "cache_store" database table in 3.x, since that's what you are coming from, except that unlike the cache_store database table, if the data store value is corrupted or lost it is rebuilt automatically. So things like the settings, languages, login handlers, etc. are built and processed, and then temporarily "cached" to the data store.

Link to comment
Share on other sites

In theory Redis should be faster as it uses ram and ram is faster than an ssd....

But i have seen also this issue on some systems when i enabled Redis for database caching and yes filesystem was faster.....

With the latest version of IPB if you select Redis for the system cache then Redis is auto selected for the database....

As i have that issue i would like to be able to have the filesystem there as an option. I probably be able to adjust constsnts.php manually to do that but didn't try it yet...

Link to comment
Share on other sites

  • 8 months later...

Archived

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

  • Recently Browsing   0 members

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