|  | Posted by Jerry Stuckle on 09/21/07 20:45 
The Natural Philosopher wrote:> Jerry Stuckle wrote:
 >> The Natural Philosopher wrote:
 >>> Jerry Stuckle wrote:
 >>>
 >>>>> You cannot, for example, have multiple instances of Apache
 >>>>> listening on
 >>>>> port 80 of a single IP address, and I thought assigning 255 IP
 >>>>> addresses
 >>>>> to a single web server went out with browsers that don't understand
 >>>>> HTTP/1.1 and the Host: header.
 >>>>>
 >>>>
 >>>> I didn't say anything about multiple instances on port 80, did I?
 >>>>
 >>>
 >>> Actually you can, and often do, have multiple instances of Apache
 >>> (effectively) listening on port 80..
 >>>
 >>> That's how virtual hosting and load balancing works.
 >>
 >> No.  You can only have one instance of Apache running on port 80 on a
 >> single machine.
 >>
 >> Virtual hosting works because that one instance has several hosts
 >> defined.  But it is still only one instance.
 >>
 >> Load balancing works because the instances of Apache are on different
 >> systems.
 >>
 >
 > Semantics.
 >
 
 No, much more than semantics.  If you have multiple instances of Apache
 running on different ports, those processes can have different owners.
 A single instance of Apache only has one owner.
 
 > You can chain more listeners than one to a single port. At what point
 > that becomes 'more than one instance tied to a port' as against 'one OS
 > routine vectoring calls to multiple processes' is a moot one.
 >
 > My process list for apache shows this:-
 >
 > ps -eadf| grep apache
 > root      9310     1  0 Jul16 ?        00:00:00 /usr/sbin/apache
 > www-data 22302  9310  0 Sep16 ?        00:00:00 /usr/sbin/apache
 > www-data 22303  9310  0 Sep16 ?        00:00:00 /usr/sbin/apache
 > www-data 22304  9310  0 Sep16 ?        00:00:00 /usr/sbin/apache
 > www-data 22305  9310  0 Sep16 ?        00:00:00 /usr/sbin/apache
 > www-data 22306  9310  0 Sep16 ?        00:00:00 /usr/sbin/apache
 > www-data 22807  9310  0 Sep16 ?        00:00:00 /usr/sbin/apache
 > www-data 22892  9310  0 Sep16 ?        00:00:00 /usr/sbin/apache
 > www-data 23339  9310  0 Sep16 ?        00:00:00 /usr/sbin/apache
 > www-data 23417  9310  0 Sep17 ?        00:00:00 /usr/sbin/apache
 > www-data 23418  9310  0 Sep17 ?        00:00:00 /usr/sbin/apache
 >
 > i.e 10 instances of apache on ONE server instance are running. Plus the
 > original spawner. This is on an IDLE web server..the spare processes are
 > there to add load capacity without the overhead of a fork().
 >
 
 Sure.  They are different processes.
 
 > It is perfectly possible for more than one process to bind() to the same
 > socket, provided that the socket options are set up that way. The only
 > proviso being that the processes understand each other and work
 > co-operatively. In essence its no more complex than e.g sharing a
 > hardaware interrupt: All processes that are attached to that interrupt
 > wake up, and one of them decides 'its mine' and takes it whilst the
 > others go back to sleep..
 >
 >
 >
 > I am fairly sure apache does this routinely as above:
 
 
 Or does the main process get the request and hand it off to the
 appropriate process?  This would seem to be much lower overhead.  I'm
 not sure about it.
 
 --
 ==================
 Remove the "x" from my email address
 Jerry Stuckle
 JDS Computer Training Corp.
 jstucklex@attglobal.net
 ==================
  Navigation: [Reply to this message] |