[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

apache /fcgi: prevent starting of multiple fcgi processes

benny

4/24/2005 5:08:00 PM

hi,

I am using ruby-fcgi (http://sugi.nemui.org/prod/...) with apache
1.3x.

under heavy load, apache begins to start other processes of my fcgi-script.
since I am caching some basic code in this main process, I want every
request to be handled by the same fcgi-script. So how can I force this
behaviour?

Any ideas?


benny


--

6 Answers

benny

4/24/2005 5:22:00 PM

0

benny wrote:

> hi,
>
> I am using ruby-fcgi (http://sugi.nemui.org/prod/...) with apache
> 1.3x.
>
> under heavy load, apache begins to start other processes of my
> fcgi-script. since I am caching some basic code in this main process, I
> want every request to be handled by the same fcgi-script.

errr! meant to say "I want every request to be handled by the same
*process*"


benny

ES

4/24/2005 6:11:00 PM

0


Le 24/4/2005, "benny" <listen@marcrenearns.de> a écrit:
>benny wrote:
>
>> hi,
>>
>> I am using ruby-fcgi (http://sugi.nemui.org/prod/...) with apache
>> 1.3x.
>>
>> under heavy load, apache begins to start other processes of my
>> fcgi-script. since I am caching some basic code in this main process, I
>> want every request to be handled by the same fcgi-script.
>
>errr! meant to say "I want every request to be handled by the same
>*process*"

Apache directives should do the trick:

FastCgiServer -processes 1
FastCgiConfig -minProcesses 1 -maxProcesses 1

See http://www.fastcgi.com/mod_fastcgi/docs/mod_fa...

I assume you have some state you are trying to maintain?
In general, I would have to waggle my finger in warning
against such practice :)

I will hopefully have my scgi code finished soon, I was
thinking about including an option to run a persistent
sort of an app on it. We shall see.

>benny

E

--
template<typename duck>
void quack(duck& d) { d.quack(); }



benny

4/24/2005 7:51:00 PM

0

Saynatkari wrote:

>
> Le 24/4/2005, "benny" <listen@marcrenearns.de> a écrit:
>>benny wrote:
>>
>>> hi,
>>>
>>> I am using ruby-fcgi (http://sugi.nemui.org/prod/...) with apache
>>> 1.3x.
>>>
>>> under heavy load, apache begins to start other processes of my
>>> fcgi-script. since I am caching some basic code in this main process, I
>>> want every request to be handled by the same fcgi-script.
>>
>>errr! meant to say "I want every request to be handled by the same
>>*process*"
>
> Apache directives should do the trick:
>
> FastCgiServer -processes 1
> FastCgiConfig -minProcesses 1 -maxProcesses 1
>
> See http://www.fastcgi.com/mod_fastcgi/docs/mod_fa...
>

in case, anyone other should need it:
the complete syntax is (apache 1.3.x)

<IfModule mod_fastcgi.c>
FastCgiServer /path/to/script.fcgi -processes 1
FastCgiConfig -minProcesses 1 -maxProcesses 1 -processSlack 1
</IfModule>

> I assume you have some state you are trying to maintain?
> In general, I would have to waggle my finger in warning
> against such practice :)
why? its simply that I have build a framework around the fcgi-script and
want to avoid this framework to be reloaded. In fact this was propagaded as
advantage of fastcgi: that a script doesn't have to be loaded on each
request.

my framework got so large that I don't want it so be several times in RAM.

but I am very interested to hear what disadvantages this configuration might
have to me.
is it simply an issue of threads-performance vs. RAM overhead?

benny

Ara.T.Howard

4/24/2005 9:58:00 PM

0

Thursday

4/25/2005 12:42:00 AM

0

> but I am very interested to hear what disadvantages this configuration might
> have to me.
> is it simply an issue of threads-performance vs. RAM overhead?
>
> benny

I use 2 * number of CPUs after doing some benchmarking.

The disadvantage to your configuration is that if you have more than 1
CPU. You might find 1 * number of CPUs more to your liking...

Dick Davies

4/25/2005 8:12:00 PM

0

* benny <listen@marcrenearns.de> [0454 20:54]:

> my framework got so large that I don't want it so be several times in RAM.
>
> but I am very interested to hear what disadvantages this configuration might
> have to me.
> is it simply an issue of threads-performance vs. RAM overhead?

You'll only be able to serve one client at a time, unless I misunderstand fcgi's
process loop model.

--
'This must be Thursday. I never could get the hang of Thursdays.'
-- Arthur Dent
Rasputin :: Jack of All Trades - Master of Nuns