Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've built a django / python application, running on apache with wsgi, and hosted on a single amazon AWS EC2 instance.

It a custom client application, so low traffic, but one part of my application generates reports, which take a requires more horse power, so I'd like to add an incoming web server which looks at my requests and sends them to one of two application servers.

I am guessing it's not exactly load balancing, because I want to treat the requests for generating documents different from other requests. So I envision apache on one machine, and django on another...

But how do people do this?

  • Do I run a wsgi-based django app on the web server that looks at the request and then forwards it to another machine that is running apache with a wsgi-based django app?
  • Or is there some apache mod that forwards on requests from the web server, and then the application run as stand-alone django servers without apache?
  • Or can a load balancer (like amazon's elastic load balancer) be configured to do this?

I've been having trouble finding documentation on this - is there something in particular I could be searching for?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Apparently what I am looking for is FastCGI, which has this capability. Found the answer on the Chapter 21: Deploying Django of the django book, where it says:

FastCGI is an efficient way of letting an external application serve pages to a Web server. The Web server delegates the incoming Web requests (via a socket) to FastCGI, which executes the code and passes the response back to the Web server, which, in turn, passes it back to the client’s Web browser.

The documents also explain How to use Django with FastCGI, SCGI, or AJP. Looks like I can modify the request path and route them to different instances fairly easily.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.