Welcome! Log In Create A New Profile

Advanced

Re: Upload module + PHP causes active connections to continually increase

Valery Kholodkov
January 16, 2010 05:14AM
Support wrote:
> Hi all,
>
> I'm developing a site using the upload module v2.0.11 ( from
> http://www.grid.net.ru/nginx/upload.en.html ) and just turned on the
> Stub Status module. I noticed that each time I send an upload form,
> the "active connections" number in the stats increments by one.
>
> For example, if I start up Nginx and visit the status, I get:
>
> Active connections: 1
> server accepts handled requests
> 1 1 1
> Reading: 0 Writing: 1 Waiting: 0
>
> After opening the upload form in a new tab, uploading a file, and
> getting a response from the PHP script, I get:
>
> Active connections: 2
> server accepts handled requests
> 3 3 3
> Reading: 0 Writing: 2 Waiting: 0
>
> After uploading another file, I get:
>
> Active connections: 3
> server accepts handled requests
> 4 4 5
> Reading: 0 Writing: 3 Waiting: 0
>
> I'm concerned that the "active connections" number keeps increasing
> (as well as the "writing" number), and never seems to go down. Does
> this mean that Nginx is holding extra connections (and possibly extra
> file descriptors) open? I'm wondering if this will be a problem once I
> deploy the site and the server is running for long periods of time.
> Could it reach some system maximum of open file descriptors?
>
> I thought it might be a problem with my fastcgi setup, but the active
> connections number doesn't increase when I visit regular (non-upload)
> PHP pages. Also, the problem didn't occur when I set @accept (in
> config below) to redirect to a .txt file instead of a .php file. In
> that case, the file appears in the upload directory, but I get a 405
> error because Nginx rejects POSTs to static files.
>
> The relevant section of my nginx.conf is:
>
> location /accept {
> upload_pass @accept;
> upload_store /var/www/fbp/uploads/files;
> upload_set_form_field "$upload_field_name[name]" "$upload_file_name";
> upload_set_form_field "$upload_field_name[content_type]"
> "$upload_content_type";
> upload_set_form_field "$upload_field_name[tmp_file]" "$upload_tmp_path";
> upload_aggregate_form_field "$upload_field_name[size]" "$upload_file_size";
> upload_pass_form_field "key";
> }
>
> location @accept {
> rewrite ^(.*)$ /accept.php last;
> }
>
> location ~ \.php$ {
> fastcgi_pass 127.0.0.1:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> include fastcgi_params;
> }
>
> My accept.php is simply:
>
> <?php
> die('accept.php'); ?>
>
> After the upload, the files appear in the uploads/files directory, and
> the text 'accept.php' is properly returned to the browser.
>
> Does anyone know what could cause this, and whether I should be
> concerned? Any help would be appreciated!

Using this patch or switching off keepalive might solve the problem.

--
Best regards,
Valery Kholodkov
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Upload module + PHP causes active connections to continually increase

Support January 16, 2010 03:36AM

Re: Upload module + PHP causes active connections to continually increase

Valery Kholodkov January 16, 2010 05:14AM

Re: Upload module + PHP causes active connections to continually increase

icqheretic February 18, 2010 03:24PM

Re: Upload module + PHP causes active connections to continually increase

Valery Kholodkov February 20, 2010 11:36AM

Re: Upload module + PHP causes active connections to continually increase

Ian Pye February 22, 2010 01:24PM

Re: Upload module + PHP causes active connections to continually increase

icqheretic February 23, 2010 03:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 214
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready