Webhost is saying Redis Resource Intensive -- is that true?

Started by Sereda_V_V, Jun 24, 2022, 01:17 PM

Previous topic - Next topic

Sereda_V_VTopic starter

I am currently paying $100 per month for a VPS that offers 300GB of SSD storage, 15GB Bandwidth and 24GB RAM. I had inquired about object caching because my site is using Wordpress' BuddyPress, and I was thinking about adding Redis. However, the site is not yet live.

The hosting company has informed me that they can add Redis or Memcached, but it would require additional resources and upgrade to prevent overload on the server. They suggested that the service would be resource-intensive.

I am not sure if this is accurate. I thought Redis was designed to reduce the impact on the server, not increase it. And, with the amount of money I am already paying per month, I was not expecting to have to pay more for object caching support. Is there something I am overlooking?
  •  

chirkovmisha

That sounds questionable. The server you have is quite powerful, so unless your traffic is very high, I doubt Redis or any other object caching will put a strain on it.

To me, this seems like an aggressive upsell from someone who may not be fully informed. It's possible that you're approaching resource limits, but this is easy to verify.

You can run "free-m" and "top" commands from the command line to get an overall view of how the server is performing at that point, and you can monitor it. Keep in mind that Linux will naturally use as much RAM as you provide, so don't worry if you only have a small amount of free memory. Instead, look at your buffers/cache, which technically count as free memory for low priority tasks.
  •  
    The following users thanked this post: Sevad

Sevad

You can find a similar measure by going to WHM > Service Status > Memory Used and checking the percentage value displayed there. As long as it's below 50%, everything should be fine. It's odd that you are being advised to upgrade, particularly since the website is currently in maintenance mode.

Mcdeerieton

The hosting company's suggestion to upgrade could be due to your existing server resource allocation. While it's true that caching systems like Redis or Memcached are designed to improve performance and reduce resource usage of your server, they do so by utilizing some of the available system resources to store frequently accessed data in memory. This means they themselves require some amount of system resources (RAM, CPU, etc.) to operate efficiently.

Here's a detailed explanation:

RAM: Both Redis and Memcached require adequate memory (RAM) to operate efficiently. Every object cached consumes some memory. If you're running a large BuddyPress site which requires lots of objects to be cached, it could potentially use a significant amount of RAM. Considering your server already has other processes running (like the OS, the web server software, the database server, etc.), there might not be enough RAM left for Redis or Memcached to run without impacting the performance of the other processes.

CPU and I/O operation: While these caching systems can indeed help reduce the CPU and I/O operations load by reducing the number of queries to your database, they still need to do some work themselves (writing/reading cache data, managing cache invalidation, handling network requests, etc.), which could increase the CPU and I/O operations load slightly.

In your situation, though, you do seem to have a rather sizeable allocation of resources. With 24GB RAM, unless your website is very resource-heavy, you should reasonably expect to run caching without overloading the server.

You might want to get a more detailed explanation from your hosting provider, including an estimation of the additional resources your site will require. Moreover, it could be beneficial to monitor your server usage and benchmark your website performance before and after implementing caching, to confirm whether the upgrade is necessary.

Also, it's worth noting that enabling caching doesn't necessarily mean automatic performance gains. Your website must be properly configured to take advantage of caching. Some parts of your website, like dynamic personalised content, may not benefit from caching. And in some rare cases, improper caching configuration can even slow down your website.


When you introduce Redis or Memcached into your software infrastructure, you need to make sure that there is ample room for these services to operate efficiently. The cache is generally stored in memory (RAM) for the best performance, but this doesn't mean it won't affect the other resources of the server.

Here are a few more detailed points to consider:

Memory usage: Redis and Memcached generally use RAM to store cache data. The exact requirements will depend on the type and amount of information you plan to store. Given that your website is using BuddyPress, if you have numerous users and lots of dynamic content, your caching requirements could be significant.

Data persistence: One advantage of using Redis over Memcached is its feature of data persistence. This allows data stored in Redis to survive restarts, but it can add some I/O load on your server, as the data is written to your storage device periodically or each time changes are made.

Network usage: If your Redis or Memcached is setup on your same server (localhost), the network usage effect will be minimal. However, if it's set up to be accessed over the network (for example, in a distributed system/over network), then you also need to account for the network bandwidth usage.

CPU utilization: Each operation in Redis or Memcached will consume a small amount of CPU resources. For most practical concerns this is minimal, but if you're continuously saving, updating, and retrieving complex data structures, it can add up.

Finally, you should consider whether your hosting company is suggesting an upgrade because they foresee that your current resources could be inadequate once your site goes live and begins to receive traffic. If so, they might be preparing for the worst-case scenario where Redis would take up more resources in addition to the increased traffic your site might experience.

It's crucial to remember that both Redis and Memcached are tools developed to deal with a problem that becomes significant in particular settings: repetitive database calls that could drastically slow down websites or applications. If this won't be the case with your system following its launch, and you're not experiencing any evident slowdown, then you could argue that introducing a cache system from the beginning might be premature and add unnecessary complexity and costs. It might be more useful to wait until you see the need for it, especially if the rest of your system is appropriately optimized and suitably dimensioned.


I'll try to provide some additional perspectives and considerations:

Optimization Before Upgrade: Before upgrading your server or deciding on Redis/Memcached, there could be other techniques to optimize your site's performance. Make sure you are using a good quality, well-optimized theme, and limit the number of plugins in use. Utilizing a Content Delivery Network (CDN) can also improve website speed by serving static content from locations closer to your users.

Alternative Cache Plugins: If your WordPress site isn't a high-traffic site yet and is primarily run with plugins, you might consider using WordPress-specific caching plugins first before jumping to server-level caching software. Plugins like W3 Total Cache, WP Super Cache, and WP Rocket can provide significant performance gains with simpler setup and maintenance than Redis or Memcached.

In-Memory VS Disk Space: Remember that Redis and Memcached use in-memory storage for fast access times, which is significantly faster than SSD or HDD storage. However, it also means that if you have a large amount of data to cache and limited RAM, this might crowd out other processes that need memory space.

Redis and Memcached Benefits: On the benefits side, while Redis and Memcached eat up some resources, they can drastically reduce the load on your database, allowing for more website users and interactions concurrently. This reduction in database load can also reduce the CPU time spent on executing SQL queries, possibly mitigating some of the resource costs of running Redis or Memcached.

Over-Provisioning: Hosting companies sometimes suggest higher plans due to over-provisioning practices or to make sure that their services run smoothly under high load. They might be considering the peak loads and worst-case scenarios. It could be wise if your application is critical or if you plan to have sudden spikes in visitors, but less so if your traffic will be steady and predictable.

Scenario Analysis: A good hosting company should be able to help you conduct a "what if" analysis to estimate the actual resources your server would need given different volumes of traffic and/or different configurations of the server software. If they can't, you may want to enlist the help of an experienced sysadmin or a different hosting company that's more transparent about these issues.

In sum, while it's essential to weigh the potential benefits of adding a caching system like Redis or Memcache, it's equally crucial to explore other ongoing optimization processes. The right mix of caching, optimized applications, and hardware resources can be determined through ongoing monitoring, benchmarking, and adjustment as your site grows and its needs evolve.
  •