Curl, Nginx and the connections conundrum

Hey folks,

I’d like to turn your attentions to this frustrating issue I’ve been
facing.

I’m running a dedicated server… Centos 6, PHP 5.3.3, Nginx 1.0.15.
Great hardware, no problems.

Nginx uses fastcgi to run php.

The server communicates with another server using remote sql.

A file called download.php initiates a mysql connection, checks some
details in the database and then begins streaming bytes to the user with
content-displacement.

No matter what I do, I cannot get simultaneous connections to download a
file above 5. For instance if I download a file using a download
manager, a maximum of 5 connections can be made, the rest timeout.

I’ve setup nginx to accept up to 32 connections, mysql connection is
closed before the file begins to stream so there shouldn’t be connection
limit issues there.

According to the logs, Nginx seems to be giving a return code 499 on the
6th request.

Also it’s max 5 connections every time, and when I want to download a
second file it won’t start because there’s a maximum of 5 connections
for my ip.

Does anybody have any idea how I can increase the amount of connections?
Perhaps an idea of what else I can check?

I’ve also posted my troubles here:

Thanks.

Posted at Nginx Forum:

Perfect, thanks for the advice.

Edit /etc/init.d/php_cgi
set server_childs=32

Posted at Nginx Forum:

On 2012-08-02 04:32, jakecattrall wrote:

The server communicates with another server using remote sql.

A file called download.php initiates a mysql connection, checks some
details in the database and then begins streaming bytes to the user
with
content-displacement.

No matter what I do, I cannot get simultaneous connections to
download a
file above 5. For instance if I download a file using a download
manager, a maximum of 5 connections can be made, the rest timeout.
[…]

Have you checked the ‘pm.max_children’ setting in php-fpm.conf?

-cs