Author |
|
jbeha
Joined: 03 Aug 2009 Posts: 3
|
Posted: Mon 03 Aug '09 18:31 Post subject: fcgid - MaxRequestInMem issues |
|
|
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:
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
|
Posted: Thu 06 Aug '09 9:47 Post subject: |
|
|
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
|
Posted: Thu 06 Aug '09 16:14 Post subject: |
|
|
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
|
Posted: Thu 06 Aug '09 20:25 Post subject: |
|
|
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
|
Posted: Thu 06 Aug '09 22:26 Post subject: |
|
|
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 |
|