logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: fcgid - MaxRequestInMem issues
Author
jbeha



Joined: 03 Aug 2009
Posts: 3

PostPosted: Mon 03 Aug '09 18:31    Post subject: fcgid - MaxRequestInMem issues Reply with quote

I am trying to correct the large file upload issue with fcgid on Apache. It seems MaxRequestInMem does not work on my particular test environment.
I looked at the code and line
Code:
543         request_size += len;

is always 8000. It seems to be getting reset too early. I see the two loops in the code above it and the initial intention of line 507:
Code:
request_size = 0;

It seems I am getting multiple bucket brigades with only one bucket in each and this is causing the request size to be reset before grabbing the rest of the file.
Any ideas on this?

Env:
Windows XP
Apache 2.2
fcgid 2.2b
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 06 Aug '09 9:47    Post subject: Reply with quote

Did you configure the values in your php.ini as well?

e.g.
Code:

memory_limit
post_max_size
upload_max_filesize
Back to top
jbeha



Joined: 03 Aug 2009
Posts: 3

PostPosted: Thu 06 Aug '09 16:14    Post subject: Reply with quote

Yes, those 3 values are set.
upload_max_filesize = 512M
memory_limit = 128M, I also tried 512M
post_max_size = 512M

I changed the code as my first post said and it did seem to use the temp file. The only issue was when it was handed off to PHP, the memory shot up and never came down even after the request was finished. I am running fcgid, but I wonder why only Apache's memory shot up and not php-cgi.exe?

Updated:
The memory shot up in both situations, the original mod_fcgid from here and my modified one.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 06 Aug '09 20:25    Post subject: Reply with quote

Well PHP is not build to upload such big files. I've done it once up to 800 MB. But it is recommend to use ftp for such big files.

Can you post your php script and your fcgid setup please. I wanna try that out.
Back to top
jbeha



Joined: 03 Aug 2009
Posts: 3

PostPosted: Thu 06 Aug '09 22:26    Post subject: Reply with quote

Setup:
Windows Server 2003
Apache 2.2.12
Modfgcid - 2.2b
PHP 5.2.10

Code:

<?php
if(isset($_FILES)) {
  print_r($_FILES);
  print_r($_POST);
}
?>

<form action="test.php" method="POST" enctype="multipart/form-data">
<input type="file" size="20" name="test" />
<input type="submit" />
</form>


FCGI Config:
Code:
### PHP FCGI
AddType application/x-httpd-php .php
DefaultInitEnv PHPRC "C:/Apache2/PHP5/"
DefaultInitEnv PATH "C:/Apache2/PHP5;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
DefaultInitEnv SystemRoot "C:/Windows"
DefaultInitEnv SystemDrive "C:"
DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
DefaultInitEnv TMP "C:/WINDOWS/TEMP"
DefaultInitEnv windir "C:/WINDOWS"
AddHandler fcgid-script .fcgi .php
MaxRequestsPerProcess       1000
MaxProcessCount             50
IPCCommTimeout              1205
BusyTimeout             1205
MaxRequestInMem            128000
FCGIWrapper C:/Apache2/PHP5/php-cgi.exe .php
### PHP FCGI END


I uploaded a 277 meg file using the apache handler and it did not increase the httpd size. It used a temp file for storage.
I then implemented fcgid with the above settings and uploaded. No file was created in temp and the httpd process memory footprint increased to 1.1 GB. I see a quick update in the temp directory with the php temp file, but the httpd memory never goes down.

This is a brand new development machine so nothing has been setup on it and is pretty clean with nothing else running.
Back to top


Reply to topic   Topic: fcgid - MaxRequestInMem issues View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules