Anatoly Davidov | 15 Oct 2007 13:47
Picon

Unexpected initialization of

Hello!

The latest snapshot mod_fastcgi-SNAP-0709231442.tar.gz moves 
initialization of dynamic_last_io_time deeper in the code, but in the 
wrong place.

 From CHANGES:
2.4.3
  ...
  *) Don't use initializers for timeval structs because on 64bit
     MVS there is a padding field in between tv_sec and tv_usec.
     [Eric Covener <covener gmail.com>]

Here is a fix:

diff -ur mod_fastcgi-SNAP-0709231442.orig/mod_fastcgi.c 
mod_fastcgi-SNAP-0709231442/mod_fastcgi.c
--- mod_fastcgi-SNAP-0709231442.orig/mod_fastcgi.c      2007-09-23 
22:56:37.000000000 +0500
+++ mod_fastcgi-SNAP-0709231442/mod_fastcgi.c   2007-10-15 
16:07:45.000000000 +0500
 <at>  <at>  -1594,6 +1594,9  <at>  <at> 
      pool * const rp = r->pool;
      int is_connected = 0;

+    dynamic_last_io_time.tv_sec = 0;
+    dynamic_last_io_time.tv_usec = 0;
+
  DWORD recv_count = 0;

(Continue reading)

Robert Jordan | 16 Oct 2007 03:54
Picon
Gravatar

Re: FCGX_Accept_r bad design?

stefano marengo wrote:
> I am new to fastcgi, I'm trying to run a simple threaded application
> like described in:
> http://www.fastcgi.com/archives/fastcgi-developers/2005-March/003627.html
> 
> I want a single accept loop and then some worker threads (or thread-pool).
> 
> FCGX_Request FcgiReq;
> FCGX_InitRequest(&FcgiReq, 0, 0);
> while (FCGX_Accept_r(&FcgiReq) >= 0)
> {
>      pcreate_thread(&WorkerThread, 0, (void*)&WorkerThreadFunc, 0);
> }
> ...
> WorkerThreadFunc(...)
> {
>      // Do the work.
> }
> 
> But this can't work because FCGX_Accept_r overwrites FCGX_Request being
> processed by the worker!

Try this:

for (;;) {
     FCGX_Request *req = calloc (1, sizeof (FCGX_Request));
     FCGX_InitRequest (req, 0, 0);

     if (FCGX_Accept_r (req) < 0)
	break;
(Continue reading)

David Birnbaum | 17 Oct 2007 21:41
Favicon

Re: Spurious 500 errors

Greetings,

We (Rob, Matt, and me) are doing some testing/cleanup, and looking to release an official release of mod_fastcgi soon. I imagine we can do a cut of the dev kit at the same time. Hopefully that will address all of the various older version information, and we can have a nice clean slate to start off with.  It rolls in a bunch of the outstanding patches also.

David.


jkuefler wrote:
FYI: I looked for a 2.4.2 dev kit to match the 2.4.2 apache mod.
NO DICE.
 
All I can find is 2.4.0 or 2.4.1 dev kit.  Neither of these matches the 2.4.2 apache mod.
 
Is there another dist directory?
 
 
 

From: Simon [mailto:simon-wRnu5U5B1ThBDgjK7y7TUQ@public.gmane.org]
Sent: Wednesday, October 17, 2007 11:00 AM
To: fastcgi-developers-VYFNfGabXYtBDgjK7y7TUQ@public.gmane.org; jkuefler
Subject: Re: [FASTCGI] Spurious 500 errors


You want version 2.4.2, 2.4.1 != 2.4.2 ;-)

Though, the module alone should solve your problem, I doubt API has changed
since the 2 versions for you to need to upgrade the devkit, but obviously best
to do both. All I know is I had same problem you describe with 2.4.0

-Simon

--Original Message Text---
From: jkuefler
Date: Wed, 17 Oct 2007 10:28:41 -0400

[FASTCGI] Spurious 500 errors

Thanks Simon. I am indeed running 2.4.0 of the fcgi module (and am building the app with 2.4.0 of the dev kit).

I see 2.4.2 of mod_fastcgi in: http://www.fastcgi.com/dist, but the latest devkit does not seem to have the same version number. That's why I backed down to 2.4.0, since there seems to be a matching set.

As of now, here is the contents of the distribution:
[ ] CGI.pm-2.7803.tar.gz 05-Nov-2001 15:04 129k
[ ] FCGI.pm-0.64-win32-x86.zip 05-Nov-2001 22:05 24k
[ ] fcgi-2.4.0.tar.gz 19-Jan-2003 12:23 458k
[ ] fcgi-2.4.1-SNAP-0311112127.tar.gz 11-Nov-2003 21:32 459k
[ ] mod_fastcgi-2.4.2-AP13.dll 23-Nov-2003 22:07 96k
[ ] mod_fastcgi-2.4.2-AP20.dll 23-Nov-2003 22:07 100k
[ ] mod_fastcgi-2.4.2.tar.gz 24-Nov-2003 19:07 96k
[ ] mod_fastcgi-SNAP-0404142202-AP2.dll 14-Apr-2004 22:12 100k
[ ] mod_fastcgi-SNAP-0404142202.tar.gz 14-Apr-2004 22:02 97k
[ ] mod_fastcgi-SNAP-0709231442-AP22.dll 23-Sep-2007 14:51 220k
[ ] mod_fastcgi-SNAP-0709231442.tar.gz 23-Sep-2007 14:42 98k

If I build and use 2.4.2 fcgi module (item#7 in the list above), which version of the dev kit do I compile and link my app with? It looks like I have two choices: fcgi-2.4.0.tar.gz or fcgi-2.4.1-SNAP-0311112127.tar.gz.

Joe

___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
Jeremy Wilkins | 22 Oct 2007 17:38
Picon

Scaling

Hi,

I'm busy looking at options for deploying an rails app we are  
developing. I've set up apps before with a FastCgiServer line like

FastCgiServer /path/to/app/public/dispatch.fcgi -processes x

to preload a certain number of instances of the app. Does this  
actually limit the number of instances - or is it just a base line?  
If the number of instances increases further when under load, how  
much load does it take to increase the instances of rails apps.

Also is it possible to have multiple FastCgiServer lines, so that i  
can preload several instances of each application.

NB: The app is a little unusual since most of the time it will be  
dealing with a few requests a minute, then will shoot up to 20  
requests a second for an hour at a time (chatroom session).

Thanks

jebw

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

Matthew Weigel | 22 Oct 2007 18:41
Favicon
Gravatar

Re: Scaling

Jeremy Wilkins wrote:
> Hi,
> 
> I'm busy looking at options for deploying an rails app we are  
> developing. I've set up apps before with a FastCgiServer line like
> 
> FastCgiServer /path/to/app/public/dispatch.fcgi -processes x
> 
> to preload a certain number of instances of the app. Does this  
> actually limit the number of instances - or is it just a base line?

My reading is that 'static' FastCGI servers - what 'FastCgiServer' sets
up - have a fixed number of processes that run.  If you don't use
'-processes' then that fixed number is 1.  Individual FastCGI
applications like PHP may manage multiple worker processes, and have
their own logic to control the number of worker processes dynamically
according to load.

If you want dynamic growing and shrinking of the application process
pool (managed by mod_fastcgi rather than externally), look at 'dynamic'
FastCGI servers - what 'FastCgiConfig' manages.
--

-- 
 Matthew Weigel
 hacker
 unique@...
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/


Gmane