• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Memcached Or Not?

Anthony Parsons

Well-known member
#1
I run php7 + opcache, mariadb 10.1 on an SSD cloud infrastructure... so read/write is pretty sweet.

Is memcached really going to do a whole lot or not? I have read through older threads, but they were always based on spindle HDD's.

Saying that, from reading, memcached targets session storage of string and such info, storing dynamic aspects for faster loading. Opcache is purely precompiling php scripts.

So... is it worth using something like memcached? Are the results with php7, mariadb and SSD really going to be worth while when the data flows so easily without I/O being a factor?
 

Brent W

Well-known member
#2
We don't run it on our largest sites anymore. We try to keep configuration as simple as possible. Hardware is far outpacing the demands software can put on it these days. Technology is also making things a lot easier on the hardware instead of the other way around.
 

Xon

Well-known member
#3
Using memcache (or redis with my addon) is useful as it will often save complex queries and cache the result.

With redis, I implement a number of complex or write intensive queries as some very simple redis commands in my Trending Tag Content, Redis view counters, User Activity(not released here yet) Add-ons.

I also use Redis/memcache caching to save complex queries in a large number of my other add-ons when on the hot-path for viewing forums/threads/etc.

This makes a measurable performance difference, and allows savings even on modern hardware.
 
#4
I'm running Litespeed with Opcache and Memcache, on SSDs.

I don't think you'll see a dramatic difference, but it did benefit me. I've got a non-XF app associated to my site that utilizes it heavily.
 

eva2000

Well-known member
#7
memcached and redis serve cache from memory which is generally faster than from ssd

however, when it comes to memory and ssds not all memory and ssds are created equal so your mileage will vary and really depends on what is being served out of caching

using both memcached and redis cache for my XF forums at https://community.centminmod.com/

redis cache via @Xon XF redis cache addon and memcached for ngx_pagespeed caching https://centminmod.com/nginx_ngx_pagespeed.html :)
 

Anthony Parsons

Well-known member
#8
Isn't a DB slotted into RAM automatically, so most queries are done via RAM and not direct to the DB? I remember reading @digitalpoint saying that the more RAM the better, because the more then that gets cached into RAM and subsequently delivered faster to the user.

If I remember that correctly, that is. I have heaps of RAM... which is why I'm wondering whether or not there will be any noticable performance based on others who use SSD RAID stacks with plenty of RAM and if they found memcached to be useful or just a lag on bandwidth and resources.

I have ran it before on HDD's, and from memory it increased bandwidth, but that didn't matter then compared to the gain achieved with HDD's being slow arsed things they are, compared to SSD's, especially in a cloud RAID.

Useful insight thus far... maybe the best bet is to just experiment?

Oh... big fan of your DB optimisation work @eva2000.
 

eva2000

Well-known member
#9
Isn't a DB slotted into RAM automatically
mysql can tune memory buffers to allow caching of data/indexes (if innodb or just indexes if myisam) but if your web app i.e. xenforo, wordpress etc allow for it you can cache much more than that so that it doesn't even touch mysql server which is still faster and allows your web app and site to scale much better. Also more so is that redis and memcached can be clustered or setup as remote servers to web app so that you can distribute the cache across web clusers if you have more than one web server.

wordpress7 site with redis nginx level full page caching http://wordpress7.centminmod.com/232/wordpress-7-site-updates/ :)
 

digitalpoint

Well-known member
#11
My general rule of thumb is memcached/redis are hugely beneficial for multiple server setups (in fact, I'd argue it's a requirement). For a single server setup, not so much... in fact, it might be a little detrimental performance-wise if it's on an otherwise well setup/tuned server (there are other caching mechanisms designed for a single server setup that doesn't have the network connection overhead).