Welcome! Log In Create A New Profile

Advanced

Re: Update on: nginx makes mysqld die all the time

Steve Wilson
August 25, 2015 04:40PM
Hi,

On 25/08/2015 08:36, M. Fioretti wrote:
> On 2015-08-18 15:23, M. Fioretti wrote:
>> Greetings,
>>
>> I just migrated to nginx + php-fpm from apache a few websites, on a
>> centos 6.6 virtual server. The sites are up but... now mysqld
>> (MariaDB, actually) dies every 10/20 **minutes** with status:
>
> Greetings,
> after a few days, I can report that setting:
>
> mysql.allow_persistent = Off
>
> in php.ini, and then tuning some php-fpm parameters as below, fixed
> the problem. There surely still is much more that can be optimized
> (and comments on the parameters below are welcome!) and I'll ask
> about it later, but I haven't seen any more crashes,
> and the websites already load quickly.

This is good news, I was actually wondering if you'd sorted it.

> Thanks to all who helped!!!
>
> Marco
>
> pm = dynamic
> pm.max_children = 12
> pm.start_servers = 3
> pm.min_spare_servers = 2
> pm.max_spare_servers = 3
> pm.max_requests = 10

I don't think this is the perfect place to get answers on this, however
my understanding is that this is how it'll work.

php-fpm will manage it's workers dynamically, starting with 3 and being
able to grow to a maximum of 12. To keep resources to a minimum on your
server it will allow for between 2 and 3 of these to be waiting to do
something. If there's more than 3 it'll kill the child, also when each
one has served 10 requests they'll terminate. If there's less than 2
idle children it'll start another until there's a minimum of 2 idle.

The above may not be the optimal configuration for your needs, as
ondemand may be more suited than dynamic or static. I think key factors
are the spec of the server and how busy php is, there may be some way to
monitor the running number of children to fine tune later but may cause
problems if there's a sudden surge in requests.

The php manual has some information on each of these settings at
<http://php.net/manual/en/install.fpm.configuration.php#pm>

Steve.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx makes mysqld die all the time

mf1 August 18, 2015 08:24AM

Re: nginx makes mysqld die all the time

Steve Wilson August 18, 2015 08:38AM

Re: nginx makes mysqld die all the time

mf1 August 19, 2015 01:04AM

Re: nginx makes mysqld die all the time

oscaretu . August 19, 2015 03:02AM

Re: nginx makes mysqld die all the time

mf1 August 19, 2015 04:40AM

Re: nginx makes mysqld die all the time

Steve Wilson August 19, 2015 05:00AM

Update on: nginx makes mysqld die all the time

mf1 August 25, 2015 02:38AM

Re: Update on: nginx makes mysqld die all the time

Steve Wilson August 25, 2015 04:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 329
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