Re: Running a service as External Server

Ken Gustafson <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
On 12/14/05, Fabrizio Pacini <[email protected]> wrote:
>
>
> Ken Gustafson wrote:
> Fabrizio,

On 12/13/05, Fabrizio Pacini <[email protected]> wrote:
> Hi all,
I'm running successfully my application as a fastcgi
> (dynamic/static)
server
behind an Apache 2 http server. I need to run it
> also as an external
server and
I have the following questions:

1. do I have
> to modify my application to run it as a fastcgi external
server?
2. how do I
> tell my application on which port/socket it has to listen when
 running as
> an external fastcgi external server?

> As David replied, you pass the port option. Without checking my
notes, I
> believe it's something like this (on the external machine):
cgi-fcgi -start
> -connect :port# path/to/appname
(Search for '-connect' in mail archive also
> for info on setting up
Apache's config file properly.)

>
> ok, this is the point I was missing: I cannot start my application as it is;
> I need to start it using cgi-fcgi to have it listening on a certain
> socket/port.
> Thanks !
>
>
> 3. can I place several instances of my application on multiple
> external
hosts
 and make all of them reachable from a single Apache 2 server
> (i.e. a
single
 access point for user's requests that then dispatched to the
> external
servers)?
4. if answer to point 3. is yes, is there some sort of
> load balancing
enforced by
 fastcgi?

> As David replied, nothing exists within fastcgi itself, so you'll have
to
> roll your own.
> so there must be one-to-one mapping between the FastcgiExternalServer lines
> in the Apache httpd conf file
> and the instances of  my application running on remote hosts. I cannot even
> run several instances of my application on a single
> externa machine listening on the same port, am I right?
>

The 1-to-1 mapping you describe is how I've done it.  I have not tried
running >1 instances on a single external machine.

>From what I've seen in the archives, it may be possible to multiplex
different requests over to the same machine/port# ; I don't know if
these multiplexed requests need to be handled by a single-instance app
or not (don't know anything about this).

Maybe several instances of your service could run on the same external
machine, each listening to a different port?

Hope that helps.

>
> I've used a (very) crude, round-robin, scheme:
Each external server
> (machine) is given a number (say 0-2).
A small (dynamic or static) modulo
> counter runs on the Apache machine.
As my 'user data input' page loads, it
> gets the next number from the counter.
This number is inserted in the form's
> action tag (via SSI), which will
rotate requests between the different
> machines. Each "#.fcgi" app
needs to be added to Apache's config file. HTH.
> my case is a bit more complicated as my application is a web service
> listening for soap messages, so I'm afraid I cannot use SSI.
> I'll have to find another way to rotate rerquests between different
> machines.
>
> Cheers,
> -- Fabrizio --
>
>
> Thanks in advance,

-- Fabrizio
> --

.........................................................................................................
Fabrizio
> Pacini

Project Leader
Grid R&D Group
Government and Institutions
> Division

DATAMAT S.p.A.
Via Laurentina, 760 ­ I 00143 Rome ­
> Italy
http://www.datamat.it
mailto: [email protected]
Phone: +39 06
> 5027 4573 (direct)
 +39 06 5027 4571 (secretary)
Fax: +39 06 5027
> 2500


___________________________________
fastcgi-developers
> mailing list
http://fastcgi.com/fastcgi-developers/


>

>
> --
>

.........................................................................................................
Fabrizio
> Pacini

Project Leader
Grid R&D Group
Government and Institutions
> Division

DATAMAT S.p.A.
Via Laurentina, 760 ­ I 00143 Rome ­
> Italy
http://www.datamat.it
mailto: [email protected]
Phone: +39 06
> 5027 4573 (direct)
 +39 06 5027 4571 (secretary)
Fax: +39 06 5027 2500
>
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.