high performance infra strutucre

Jonathan Matthews contact at jpluscplusm.com
Sat Dec 22 23:27:31 UTC 2012


On 22 December 2012 22:19, Friedrich Locke <friedrich.locke at gmail.com> wrote:
> Hey,
>
> this is my first message to this mailing list. I am not, right now, using
> nginx, but i would like to do so.

Good plan. It's a very flexible HTTP server and router.

> My intent is the following:
>
> I would like to build a farm of x web server. I would like to perform load
> balance among them. I need high performance and high availability for a set
> of 100k domains to hosted within this farm of web server. The requirement i
> was presented with is that a domain must be served by at least 3 server.

That's very achievable. At mass-hosting volumes like these, you'll
need to distinguish between static site hosting and dynamic
application hosting. Doing the former at volume is (almost!) trivial
using nginx; doing the latter will be more ... interesting.

> I want to use nginx as web server; and could use nginx or varnish as reverse
> proxy, which ever would be a better approach.

If you mean a pure reverse proxy with responsibility other than HTTP
routing, then nginx is very well suited to this. If you want to bring
back-end health checks and HTTP caching into the mix as well, then I'd
suggest supplementing nginx with Varnish (caching) and HAProxy (health
checks). Whilst nginx can fulfil both these functions, I prefer those
other two tools for various operational reasons.

> Some doubts arose :
>
> 0) Do i need to have the html/jpeg/php/* of a given domain replicated on
> each of the http server i want to serv that domain ?

Generally yes, but you may wish to research network attached storage
(NAS) and cluster filesystems for a common solution to this scaling
problem.

> 1) What happens if a web client upload a file to that domain, it (the file)
> get saved in a http server and the next request of that web client to the
> domain goes to a second http server the upload file is not there ?

You don't mention if this is the site admin uploading files to the
site, or user generated content (UGC) being provided by users

In general, the former is something you'd need to solve in the same
way you solved for your question #0, above. The latter is generally an
application-level problem, which may well use the replication/etc
strategies provided by the solution to #0, but really isn't obliged
to.

> 2) What about session? User authenticated session ? How does nginx manage
> such? A given server could have information about a session and the other
> server that serves the domain too is not aware about the session.

You would normally solve this at the application or application framework layer.

HTH,
Jonathan
-- 
Jonathan Matthews // Oxford, London, UK
http://www.jpluscplusm.com/contact.html



More information about the nginx mailing list