How do you design web application for this case?

45 views
Skip to first unread message

Tony

unread,
Aug 30, 2015, 5:43:05 PM8/30/15
to play-framework
Hi everyone,

I have 10 websites (domain name), all site have traffics but small. I can deploy 3 web application per a server, and running each application in a different port, and use nginx as proxy. It's failed to start fouth application on single server (i tried but not succeed). With this design, it wasted me a lot of money for server (10 website, i need 4 server for them). So i have 2 questions:
1. There is anyway to run more than 3 web application on a single server (and is it a good way, i don't think so)
2. There is anyway to develop a single web app for each 5 website, and routing domain by url. So i need only 2 web application, deployed on 2 single domain, and it's still good, because each site just have small traffic. So just combine them.

For example:
domain a.com => localhost/a/
a.com/* => localhost/a/*
domain b.com => localhost/b/
b.com/* => localhost/b/*

vvv
I tried it with play application, but it's failed to config with nginx.
Anyone can have a better design or can help me for this design?

Thanks so much,

HHeinz

unread,
Aug 30, 2015, 7:03:51 PM8/30/15
to play-framework
Hello Tony, 

I have a server running more than 3 Play applications, even using various Play releases (1.3.1, 2.2.6, several 2.3.9 and 2.4.2). I am using lighttpd as a Proxy and every Play application is running on its own TCPIP port using the integrated HTTP engine (which in most cases seem to be Netty). The machine has 6GB RAM, runs MySQL and MongoDb but is also running a proprietary Application server that consumes up to 4GB of RAM for itself. It is not lightning fast but does the job.

So I cannot confirm that in general you can only run 3 Play web applications on a single server, although if I would have to serve dozens of them I would probably choose something else. I have also used Nginx in the past but don't remember the exact reason for switching to lighttpd.
I only use the Java part of Play Framework (on Linux), so maybe its a Scala only issue (but I assume its root cause to be something more related to the server configuration or an OS limitation). For example on Linux you sometimes have to increase the open files limit otherwise you might get into trouble (too many open files).
I cannot say something about your Point 2) because 1) always worked for me.
if you want more assistance I assume you have to become more specific in your problem description (e.g. "failed to start"  does not say much).
Have a nice day.

Henning
Reply all
Reply to author
Forward
0 new messages