Move to 2 physical Django servers (front and backend) from one production server?

I currently have a growing Django server running all front-end and back-end services. I could continue to increase this server more and more, but instead I want to try to leave this main server as my backend server and create some front-end servers that will run apache / nginx and remotely connect to the main production server.

Now I use slicehost, so I don’t think I can use several servers running on the intranet. How to do it?

+6
django
source share
2 answers

The first step in scaling a server is usually to partition the database server. I assume that this is all that you mean by “backend services” if you do not give us more details.

All this requires changing your settings file. Change DATABASE_HOST from the local host to the new IP address of your database server.

If your site is heavily loaded with static content, creating a separate media server can help. You can even peek into the CDN .

+1
source share

The first step, as a rule, is to separate the server from the actual Python code and the database server. Any background jobs that perform processing are likely to run on the database server. I assume that when you tell a server with an interface, you actually mean a server running Python code.

Now, since each query must fulfill several database queries, latency between the web server and the database server is very important. I don’t know if Slicehost has some function that allows you to create two virtual machines that “close” in terms of network latency (a quick search on Google did not find anything). They seem like good guys, so maybe you could ask them if they have such a service or can make an exception.

In any case, when you have two machines on Slicehost, you can check the latency between them, just ping between them. When you have a result, you will probably find out how possible or not.

What to do next depends on your application. If this is heavy media, perhaps using a separate media server will make sense. Otherwise, the usual step is to add additional web servers.

-

As a side note, I personally think that it makes sense to invest in real dedicated servers with dedicated network equipment for this kind of setup. This, of course, depends on what budget you use.

I would also suggest exploring Amazon EC2, where you can provide servers that are magically close to each other.

+1
source share

All Articles