[svlug] Multiple Web Servers on One IP
Sargun Dhillon
xbmodder at gmail.com
Thu May 29 16:02:05 PDT 2008
Sorry about the lack of explanation for that complex, and interesting graphic.
I'm talking about request routing:
use two lighttpd instances.
A frontend which runs modproxy and runs regex against the directory
structure, then it will route it internally to each web server based
on ports. Not external ports. This is common place in many large
organizations.
And just kick up the number of apache threads/instances to like 20-25.
Use Lighty's mod_proxy. If you need help hit me in #freebucket on
Freenode (chat.freenode.net).
digraph chris {
"downloading client"
"normal client"
"LigHTTPd (1) fsdev.net:80"
"/downloads"
"/"
"Apache (127.0.0.1:81)"
"LigHTTPd (2) (127.0.0.1:82)"
edge [color=red]
"downloading client" -> "LigHTTPd (1) fsdev.net:80";
"LigHTTPd (1) fsdev.net:80" -> "/downloads";
"/downloads" -> "LigHTTPd (2) (127.0.0.1:82)";
edge [color=green]
"normal client" -> "LigHTTPd (1) fsdev.net:80";
"LigHTTPd (1) fsdev.net:80" -> "/";
"/" -> "Apache (127.0.0.1:81)";
}
On Thu, May 29, 2008 at 3:55 PM, Sargun Dhillon <xbmodder at gmail.com> wrote:
> On Thu, May 29, 2008 at 3:07 PM, Chris Miller
> <lordsauronthegreat at gmail.com> wrote:
>> On Thu, May 29, 2008 at 2:58 PM, Sargun Dhillon <xbmodder at gmail.com> wrote:
>>> Stop using some device that has a terrible queuing method. What might
>>
>> Yes, I'm sure that no one ever bothered to ponder the queuing
>> mechanism in the Apache webserver. After all, it was made by a bunch
>> of these "open-source" people. Not much better than a thousand
>> monkeys banging on keyboards, really...
>>
>> It's first-come first-serve. I can't change that without making a
>> custom build of Apache after having modified the Apache source code
>> directly. Unless there's some set of Apache directives I'm not aware
>> of (which would be great).
>>
>>> be better is to run the crappy backend on some port which is 80 bound
>>> to 127.0.0.2 (add this address to lo). Then run the download server
>>> bound to 127.0.0.3. Use a lighty frontend with mod proxy to make
>>> /downloads go to 127.3 and /!downloads to go 127.2. Its just that
>>> simple!
>>
>> So bind Apache to another lo and then have lighty mod_proxy to Apache,
>> which will queue normally, and also have lighty serve downloads like
>> there's no tomorrow on the other domain. They're domains, so it's
>> really:
>> http://www.fsdev.net/ <== web pages which eat memory like there's no tomorrow
>> http://dl.fsdev.net/ <== files which download quietly, never eating
>> crazy amounts of memory
>>
>> By turning the problem upside-down, it became solved. Who knew...
>>
>>> Alternatively you can tell apache to bind to a non-80 port and run a
>>> mod_proxy frontend to sort between the ports.
>>
>> I do not want to use any non-80 ports, since I do not want to run into
>> a restrictive firewall. I also don't want to run into any possible
>> issues that may be caused by serving non-SSL pages and files through
>> the SSL port (which would solve the problem and circumvent the wrath
>> of the firewalls, but I may need SSL later, too!)
>>
>> --
>> Registered Linux Addict #431495
>> http://profile.xfire.com/mrstalinman | John 3:16!
>> http://www.fsdev.net/ | http://lordsauron.wordpress.com/
>>
>
More information about the svlug
mailing list