Bug #1776

lighttpd 99% CPU when uploading file

Added by Anonymous almost 12 years ago. Updated almost 12 years ago.

Target version:


When I upload something which is 9.5mb using PHP and

post_max_size = 8M
upload_max_filesize = 10M

then lighttpd uses 99% CPU and PHP and static content doesn't work.

If I change change post_max_size and make it 10M then everything is working as expected.

During the problem I notice that 1mb file chunks uploaded to /tmp and the hang starts when the file is fully uploaded (I sum the size of each temporary file). Also I use strace and during the hang no more data was passing strace.

-- chris


Updated by stbuehler almost 12 years ago

Hm. I tried to reproduce it without success (PHP 5.2.6-3 with Suhosin-Patch on linux (you are on freebsd iirc).

On my system, php reads the complete stdin stream, even if its bigger than post_max_size; i guess it just drops the content, as $_POST / $_FILES is empty. php does not send anything before stdin isn't read completely.

If this has changed, that would explain a little bit; mod_fastcgi does not read the response before it hasn't written all data.

Could you please try to attach to the hanging lighttpd with gdb and find out where it hangs? You will probably need debug symbols for this in lighttpd.

A strace from the php process may be nice too (use something like

strace spawn-fcgi -C 0 -p 1026 -n -- /usr/bin/php5-cgi

for "0" children, i.e. master process handles the request).

Btw: did you try the latest 1.4.20 prerelease? there was a freebsd-sendfile fix in r2256


Updated by Anonymous almost 12 years ago

The problem was finally with "freebsd-sendfile":

-- chris


Updated by stbuehler almost 12 years ago

  • Status changed from New to Fixed
  • Resolution set to invalid

Updated by stbuehler almost 12 years ago

  • Status changed from Fixed to Invalid

Also available in: Atom