# Fcgid.conf - Photo uploads

**URL:** <https://www.ruby-forum.com/t/fcgid-conf-photo-uploads/104057>\
**Category:** Rails\
**Created:** [May 13, 2007, 8:29pm UTC](https://www.ruby-forum.com/t/fcgid-conf-photo-uploads/104057 "2007-05-13T20:29:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Traci\_Reynolds](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e5b9ba/32.png) [@Traci\_Reynolds](https://www.ruby-forum.com/u/Traci_Reynolds)\
**Post date:** [May 13, 2007, 8:29pm UTC](https://www.ruby-forum.com/t/fcgid-conf-photo-uploads/104057/1 "2007-05-13T20:29:06Z")

</div>

My network guy is saying that fcgi is built for short lived processes.  
I’m running up against the limit of DefaultMaxClassProcessCount which  
is set to two, on the third picture upload it’s dying, and returns a  
503. The implication is that either I build a separate RoR application  
that only uploads photos and run CGI, or switch to PHP for uploads and  
downloads.

Has anyone else run into this?

Is there a way to monitor the number of processes used, so that I can  
manage the resource?

The access\_log shows

x.x.x.x - - [13/May/2007:11:43:40 -0400] “POST  
/item/create?item\_class=Photo&noredirect=1 HTTP/1.1” 503 408 “-” “”

My mod\_fcgi setup is:

AddHandler fcgid-script .fcgi  
SocketPath /var/lib/apache2/fcgid/sock  
IdleTimeout 3600  
ProcessLifeTime 7200  
MaxProcessCount 10 --\> i moved this up to 40  
DefaultMaxClassProcessCount 2 --\> i moved this up to 10  
IPCConnectTimeout 8  
IPCCommTimeout 60  
DefaultInitEnv RAILS\_ENV production

and the error I’m getting in my apache error\_log says

[Sun May 13 11:43:44 2007] [notice] mod\_fcgid: too much  
/var/www/deploy/current/public/dispatch.fcgi process(current:2,  
max:2), skip the spawn request

I notice also in my production log that the third request for a photo  
upload crashes, and then just continues on with the fourth:

Processing ItemController#create (for x.x.x.x at 2007-05-13 11:43:40)  
[POST]  
Session ID: s  
Parameters: {“Filename”=\>“somerights20.png”, “item\_class”=\>“Photo”,  
“\_session\_id”=\>“s”, “action”=\>“create”, “Upload”=\>“Submit Query”,  
“controller”=\>“item”, “noredirect”=\>“1”,  
“item”=\>{“filename”=\>#StringIO:0xb77c5738}}  
Completed in 1.32691 (0 reqs/sec) | Rendering: 0.00011 (0%) | DB:  
0.16443 (12%) | 200 OK [url]

Processing ItemController#create (for x.x.x.x at 2007-05-13 11:43:42)  
[POST]  
Session ID: s  
Parameters: {“Filename”=\>“TIJ4.jpg”, “item\_class”=\>“Photo”,  
“\_session\_id”=\>“s”, “action”=\>“create”, “Upload”=\>“Submit Query”,  
“controller”=\>“item”, “noredirect”=\>“1”,  
“item”=\>{“filename”=\>#\<File:/tmp/CGI.28857.2\>}}  
Completed in 1.20233 (0 reqs/sec) | Rendering: 0.00011 (0%) | DB:  
0.04595 (3%) | 200 OK [url]

Processing ItemController#create (for x.x.x.x at 2007-05-13 11:43:44)  
[POST]  
Session ID: s  
Parameters: {“Filename”=\>“Backgnd.gif”, “item\_class”=\>“Photo”,  
“\_session\_id”=\>“s”, “action”=\>“create”, “Upload”=\>“Submit Query”,  
“controller”=\>“item”, “noredirect”=\>“1”,  
“item”=\>{“filename”=\>#StringIO:0xb7c7655c}}

Processing ItemController#create (for x.x.x.x at 2007-05-13 11:43:44)  
[POST]  
Session ID: s  
Parameters: {“Filename”=\>“CodeCapsules.jpg”, “item\_class”=\>“Photo”,  
“\_session\_id”=\>“s”, “action”=\>“create”, “Upload”=\>“Submit Query”,  
“controller”=\>“item”, “noredirect”=\>“1”,  
“item”=\>{“filename”=\>#\<File:/tmp/CGI.28857.5\>}}  
Completed in 0.86467 (1 reqs/sec) | Rendering: 0.00010 (0%) | DB:  
0.03867 (4%) | 200 OK  
[url]
