Forum

Upload size in FastCgi mode

godguy
20 June 2008, 12:23
hi:
i change my hiawatha to use fastcgi, it worked well. but i found an issue about upload file from client to server.
before i don't use fastcgi, it can upload about 10M file, i use fastcgi mode. it only can upload 64K file, the httpd.conf file is:
# Hiawatha main configuration file
#
# GENERAL SETTINGS
#
ServerId = 33:33
ConnectionsTotal = 100
ConnectionsPerIP = 10
SystemLogfile = /usr/local/var/log/hiawatha/system.log
GarbageLogfile = /usr/local/var/log/hiawatha/garbage.log
# BINDING SETTINGS
# A binding is where a client can connect to.
#
Binding {
Port = 80
MaxRequestSize = 15360
Interface = 10.155.20.74
}
#
Binding {
Port = 443
MaxRequestSize = 15360
Interface = 10.155.20.74
ServerKey = /usr/local/etc/hiawatha/webui_serverkey.pem
UseSSL = yes
}
#
# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications.
#
CGIextension = cgi
TimeForCGI = 100
CGIhandler = /opt/ah/bin/ah_capture:php

# FastCGI
#
FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:2008
Extension = php5
}

# DEFAULT WEBSITE
#
Hostname = 127.0.0.1
WebsiteRoot = /usr/local/var/www/hiawatha
StartFile = index.html
ExecuteCGI = yes
AccessLogfile = /usr/local/var/log/hiawatha/access.log
ErrorLogfile = /usr/local/var/log/hiawatha/error.log

# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
Hostname = 10.155.20.74
WebsiteRoot = /usr/local/var/www/hiawatha/webui
StartFile = index.php5
FastCGI = PHP5
}

how to change it?
Hugo Leisink
20 June 2008, 15:36
Thanks for your feedback. Can you tell me what version of Hiawatha are you using?

update:
I've tested it myself (128kb POST via FastCGI) but everything works fine.
godguy
23 June 2008, 05:25
the version is:
Hiawatha v5.7, SSL, cache
Hugo Leisink
23 June 2008, 09:45
In that case, you should update your webserver. The bug that is troubling you has been fixed in 6.1. But I advice you to download the latest release of Hiawatha (6.7 at this moment).
godguy
23 June 2008, 10:14
hi :
very thanks! i have some problems if i use verson 6.7, because i have chang some codes in hiawatha for our environment.
so can you give your cvs log only for this bug changed? i will merge this change to my hiawatha 5.7.
thanks!!
Hugo Leisink
23 June 2008, 10:35
I still advice you to download 6.7 and make your changes to that version. There have been some other bugfixes, which you want to have as well. And maybe the new features like URL rewriting and IPv6.

I don't use CVS. If I remember correctly, the 64kb bug is in send.c, send_fcgi_buffer():
padding = set_padding(fcgi_buffer, false);
if (send_directly(fcgi_buffer->sock, (char*)fcgi_buffer->data, 8 ) == -1) {
return -1;
} else if (send_directly(fcgi_buffer->sock, buffer, size) == -1) {
return -1;
}

should be
padding = set_padding(fcgi_buffer, false);
if (send_directly(fcgi_buffer->sock, (char*)fcgi_buffer->data, 8 ) == -1) {
return -1;
} else if (send_directly(fcgi_buffer->sock, buffer, FCGI_BUFFER_SIZE) == -1) {
return -1;
}
godguy
23 June 2008, 12:33
very thanks for your help. i merge the code to my hiawatha. it worked ok. the bug fixed . very thanks!
if i have more time, i will merge the 6.7 to our hiawatha.
very thanks!
godguy
23 June 2008, 13:13
BTW, i ofen find PHP will crash in zend_mm_shutdown(), i google the bug, i found my PHP version is fixed it(my version is 5.2.5).
Do you know about it? Does it relate to our hiawatha via fastcgi?
If right, can you tell me how to change it? very thanks for your help
Hugo Leisink
23 June 2008, 13:19
I also experience that PHP as a FastCGI daemon crashes now and then. Specially the Windows version is very unstable. The problem is definitly in PHP, not in Hiawatha (it's PHP that crashes, not Hiawatha). If you can reproduce the crash, you should report it to the PHP developers.

If you want to help them track down the bug, use a valgrind with a non-stripped PHP binary and send them the output.
godguy
23 June 2008, 13:36
ok, thanks, if i catch the crash, i will check it. very thanks for your help!
This topic has been closed.