# Should Redis be configed as a cache server or not?

**URL:** https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315
**Category:** Self-hosting
**Created:** [April 10, 2016, 3:14am UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315 "2016-04-10T03:14:00Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![louirobert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/louirobert/32/62262_2.png) [@louirobert](https://meta.discourse.org/u/louirobert)
#### Post date: [April 10, 2016, 3:14am UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/1 "2016-04-10T03:14:00Z")

</div>

The official GitHub page for Discourse says

> “[We use Redis as a cache and for transient data.](https://github.com/discourse/discourse)”.

But Sidekiq, which is a part of Discourse, says

> “[Many people use Redis as a cache but it’s important that Sidekiq be run against a Redis instance that is not configured as a cache but as a persistent store.](https://github.com/mperham/sidekiq/wiki/Using-Redis)”

and it also suggests

> “using two separate Redis instances, each configured appropriately, if you wish to use Redis for caching and Sidekiq”

So what should I do? I currently have only one Redis configed as a LRU cache. Should I make another one for Sidekiq, and how? Or I can safely ignore Sidekiq’s suggestion?

Thanks.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [April 10, 2016, 8:01am UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/2 "2016-04-10T08:01:48Z")

</div>

Are you trying to install Discourse for production use? If so, simply follow these instructions:

> <https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md>

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 10, 2016, 8:31am UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/3 "2016-04-10T08:31:55Z")

</div>

In general we try to avoid Redis flushes, but it’s not completely the end of the world if it does get flushed. Worst case, some emails might not get sent such as password resets and users will need to re-request.

---

<div class="post-metadata">

### Author: ![louirobert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/louirobert/32/62262_2.png) [@louirobert](https://meta.discourse.org/u/louirobert)
#### Post date: [April 10, 2016, 4:28pm UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/4 "2016-04-10T16:28:02Z")

</div>

I’m not using Docker. I deployed it through Capistrano. It’s production.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 10, 2016, 4:31pm UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/5 "2016-04-10T16:31:43Z")

</div>

Just for info, on the forums:

> The only officially supported installs of Discourse are the Docker based beginner and advanced installs. We regret that we cannot support any other methods of installation.

> <https://github.com/discourse/discourse/blob/main/docs/INSTALL.md>

---

<div class="post-metadata">

### Author: ![louirobert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/louirobert/32/62262_2.png) [@louirobert](https://meta.discourse.org/u/louirobert)
#### Post date: [April 10, 2016, 4:40pm UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/7 "2016-04-10T16:40:04Z")

</div>

Yes, I know that. But for Chinese users, Docker is not a good choice: it’s intended for convenience but due to the network block(GFW) from within China, bundler install fails frequently for network error. So Chinese Docker user has to manually edit the Docker templates and configs and so on to fix that. It’s not easy, not to say that the Docker image download is VERY SLOW in China, and I’m afraid someday it may be totally unavailable. So a workaround for me is to use bundler package to avoid network download for installing Ruby Gems, which I’ve prepared in some special way before. In short, I need a way with highly custom installation script and Capistrano fits me. Rather complex, right?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 10, 2016, 11:32pm UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/8 "2016-04-10T23:32:56Z")

</div>

> [@louirobert](#):
>
> bundler install fails frequently for network error.

I am pretty sure @fantasticfears had a workaround for this.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 10, 2016, 11:35pm UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/9 "2016-04-10T23:35:34Z")

</div>

> [@Replace rubygems.org with taobao mirror to resolve network error in China](https://meta.discourse.org/t/replace-rubygems-org-with-taobao-mirror-to-resolve-network-error-in-china/21988):
>
> [rubygems.org](http://rubygems.org) hosts its resource in Amazon S3 which is disturbed by GFW. So gem and bundle complain from time to time. This guide assumes you used docker installation. This guide also has a version in Chinese. [中文指南](https://meta.discoursecn.org/t/discourse/28)Add a template Open your congiruation file, say, app.yml. Add a reference to the china template: templates: - "templates/postgres.template.yml" - "templates/redis.template.yml" - "templates/sshd.template.yml" - "templates/web.template.yml" - "templates/web.china.yml" Bo…

---

<div class="post-metadata">

### Author: ![louirobert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/louirobert/32/62262_2.png) [@louirobert](https://meta.discourse.org/u/louirobert)
#### Post date: [April 11, 2016, 1:44am UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/12 "2016-04-11T01:44:28Z")

</div>

Thanks. However I tried Taobao mirror before, that doesn’t always work: Gems of required(new) version had been missing for 1+ months because the mirror server stopped syncing with official source for unknown reason. Here is an example: [Could not find email\_reply\_trimmer-0.1.1 in any of the sources · Issue #50 · alibaba-archive/ruby.taobao.org · GitHub](https://github.com/alibaba/ruby.taobao.org/issues/50)  
Taobao mirror is not always reliable.

---

<div class="post-metadata">

### Author: ![louirobert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/louirobert/32/62262_2.png) [@louirobert](https://meta.discourse.org/u/louirobert)
#### Post date: [April 11, 2016, 2:03am UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/13 "2016-04-11T02:03:46Z")

</div>

Thanks but @fantasticfears’s solution depends on Taobao mirror, which is not always reliable. Please see my previous reply for details.

---

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [April 11, 2016, 4:47am UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/14 "2016-04-11T04:47:41Z")

</div>

It’s been moved to RubyChina mirror. I documented them [here](https://meta.discoursecn.org/t/%E5%9C%A8%E5%A4%A7%E9%99%86%E5%9C%B0%E5%8C%BA%E7%9A%84%E4%BA%91%E4%B8%8A%E9%83%A8%E7%BD%B2-Discourse/28) and [there](https://meta.discoursecn.org/t/webchinatemplateyml-%E4%B8%AD%E7%9A%84%E6%B7%98%E5%AE%9D%E6%BA%90%E6%9B%B4%E6%8D%A2%E4%B8%BA-Ruby-China-%E7%9A%84%E9%95%9C%E5%83%8F%E6%BA%90/972) in Chinese.

You have more than one way to fix this, either by mirrors or by proxy. If you have a reliable proxy, you don’t even bother whether a mirror is perfectly stable to you. Besides, RubyChina mirror is rather stable comparing to the launch. [Issues · ruby-china/rubygems-mirror · GitHub](https://github.com/ruby-china/rubygems-mirror/issues?q=is%3Aissue+is%3Aclosed)

Docker can also employ a proxy as described in the documentation.

If you are using `Capistrano`, you have more choices since you are a senior developer.

---

<div class="post-metadata">

### Author: ![louirobert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/louirobert/32/62262_2.png) [@louirobert](https://meta.discourse.org/u/louirobert)
#### Post date: [April 11, 2016, 5:21am UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/15 "2016-04-11T05:21:11Z")

</div>

Thanks! I’ll look into the Docker solution again when I have to turn to it. For now, my Capistrano deployment has been working well. Thanks for all your help!

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:45pm UTC](https://meta.discourse.org/t/should-redis-be-configed-as-a-cache-server-or-not/42315/16 "2024-06-08T12:45:44Z")

</div>

This topic was automatically closed after 2981 days. New replies are no longer allowed.
