1

I'm building a Django application that uses PostgreSQL for data storage and Redis with Django Redis Cache for Django session storage. I'm also using RQ for asynchronous job queues. I've built the application so that my PostgreSQL database resides on a separate server. I have two questions:

  1. Should Redis and Django Redis Cache both be installed on my Django web server since they are handling session storage or should I install them on my database server since they are providing database-like functionality?
  2. Should RQ be installed on the web server or the database server? I would think it should be installed on the same server as Redis but I'm not sure.

Thanks.

Jim
  • 13,430
  • 26
  • 104
  • 155
  • You should consider docker so it is easier to make changes as you grow. Please specify your expected user base size. The answer will be different depending on the size of the server – dkarchmer Mar 28 '16 at 17:46
  • Expected user base size is 5,000 users. I'm using Ansible for CM. – Jim Mar 28 '16 at 18:45

1 Answers1

0

Assuming you've really got just two machines to work with, I'd say Redis on the web server and RQ on the database server.

The cache close to its consumer and the non-latency critical RQ elsewhere.

However, if you've got an in-memory cache before any call to Redis then I'd say to put Redis on the db server too so that you free up all available cpu cycles for the web server.

Of course, in an ideal world each of these services would be on seperate hosts that you could resize acordingly (thinking amazon style seamless upgrade). To start with they could even be on the same physical hosts but identified using suitable host aliases to avoid building too many hosting assumptions into your code.

Completely agree that docker and ansible are great ways to go if you can.

Joseph Simpson
  • 4,054
  • 1
  • 24
  • 28
  • Does that answer your question? Interested to know how you got on. Cheers – Joseph Simpson Apr 01 '16 at 17:36
  • Simpsojo, sorry for taking so long to credit you with the answer. In the end, I managed to figure out how to install Redis and RQ on my database server and I could even communicate with Redis from my web server. Unfortunately, I was unable figure out how to start django_rq on my web server so this morning, I'm going to delete Redis and RQ from my database server and put them on the webserver. Configuring django_rq on a web server to talk to RQ running on a database server shall remain a mystery to me. – Jim Apr 03 '16 at 16:39
  • No worries. Good luck! – Joseph Simpson Apr 03 '16 at 17:34