Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-27, 15:55:01

Author Topic: php-fpm_event conf  (Read 5470 times)

0 Members and 1 Guest are viewing this topic.

Offline KloxoLittleFish

  • Valuable Member
  • *
  • Posts: 147
  • Karma: +0/-0
    • View Profile
php-fpm_event conf
« on: 2015-05-03, 10:28:39 »
Where is the php-fpm_eventĀ“s configuration file?  ::)

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: php-fpm_event conf
« Reply #1 on: 2015-05-03, 11:57:57 »
For what?.

In /etc/php-fpm.d and /etc/php-fpm.conf
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: php-fpm_event conf
« Reply #2 on: 2015-05-03, 12:02:17 »
If you mean php-fpm_event in 'php type', this is Kloxo-MR term for how to apache connect to php. It's using fastcgi and event mpm.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline KloxoLittleFish

  • Valuable Member
  • *
  • Posts: 147
  • Karma: +0/-0
    • View Profile
Re: php-fpm_event conf
« Reply #3 on: 2015-05-03, 20:53:38 »
oh, thanks!  :)

To customize all fpm  I added at the end of php-fpm.conf or I have to copy and edit a custom-php-fpm.conf?

To change Max Execution Time i need to do in the panel ... and in "php-fqm.conf" with request_terminate_timeout ?

Do I need to add fastcgi_read_timeout in httpd.conf?
« Last Edit: 2015-05-03, 21:14:49 by KloxoLittleFish »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: php-fpm_event conf
« Reply #4 on: 2015-05-04, 05:37:42 »
Change values (like 'max execution time') via 'advanced php configure' in panel for certain client (including admin if needed).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline KloxoLittleFish

  • Valuable Member
  • *
  • Posts: 147
  • Karma: +0/-0
    • View Profile
Re: php-fpm_event conf
« Reply #5 on: 2015-05-04, 11:49:52 »
and in fqm and httpd? I have max execution time value high but php scripts after 90 seconds of execution fails ...

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: php-fpm_event conf
« Reply #6 on: 2015-05-04, 13:32:21 »
Just for php. Need modified manually for webserver.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline KloxoLittleFish

  • Valuable Member
  • *
  • Posts: 147
  • Karma: +0/-0
    • View Profile
Re: php-fpm_event conf
« Reply #7 on: 2015-05-04, 17:52:30 »
I have changed, but the pages are breakin at 90 seconds.


Quote
A. Kloxo-MR: 7.0.0.b-2015050301

B. OS: CentOS release 6.6 (Final) x86_64

C. Apps:
   1. MySQL: MariaDB-server-10.0.17-1.el6.x86_64
   2. PHP: php54-5.4.40-1.ius.el6.x86_64
   3. Httpd: httpd-2.2.29-2.mr.el6.x86_64
   4. Lighttpd: --uninstalled--
   5. Hiawatha: hiawatha-9.12.0-f.4.mr.el6.x86_64 (also as webserver)
   6. Nginx: --uninstalled--
   7. Cache: --uninstalled--
   8. Dns: bind-9.9.5-1.el6.x86_64
   9. Qmail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64

D. Php-type (for Httpd/proxy): php-fpm_event

Offline KloxoLittleFish

  • Valuable Member
  • *
  • Posts: 147
  • Karma: +0/-0
    • View Profile
Re: php-fpm_event conf
« Reply #8 on: 2015-05-05, 12:28:48 »
Any idea of the parameter that can be limiting execution to 90 seconds?

Web: apache
PHP Used : php54m
PHP Branch : php54_(as)_
PHP-type: php-fpm_event

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: php-fpm_event conf
« Reply #9 on: 2015-05-05, 13:50:13 »
Copy /opt/apache/tpl/domains.conf.tpl to custom.domains.conf.tpl and then change '-idle-timeout 90' (3 minutes) to '-idle-timeout 180' (6 minutes). After that, run 'sh /script/fixweb; sh /script/restart-web -y'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline KloxoLittleFish

  • Valuable Member
  • *
  • Posts: 147
  • Karma: +0/-0
    • View Profile
Re: php-fpm_event conf
« Reply #10 on: 2015-05-05, 18:04:34 »
Thanks a lot. I was going crazy  :P

To run a php file 180 seconds. You have to do:
(via panel) max_execution_time php_value to 180
(copy/edit where?) request_terminate_timeout directly inside the pool config to 183
(copy/edit) /opt/configs/apache/tpl/custom.domains.conf.tpl and then change '-idle-timeout 185'

Reload:
sh /script/fixweb; sh /script/restart-web -y


Recommended reading => http://stackoverflow.com/a/21595677/4717423

Quote
Increasing -idle-timeout (just one dash in front though ^^) is indeed the solution. A complete explanation on this is given here, but I'll try to explain it:

PHP has it's own timeout, set in max_execution_time. If running it using mod_php, this setting tells PHP to quit working on a script after x seconds.

Next: the FPM process manager has another one, request_terminate_timeoutset in the pool configuration. This one limits / overrides max_execution_time.

That's it for the pure PHP-side part. If you're using PHP-FPM and FastCGI, PHP is started in its own process. The internal timeouts still apply. FastCGI however has its own timeout (which isn't needed for PHP, but how should fastCGI now PHP has its own?), that makes sure the webserver doesn't freeze if some CGI process does (or just works for a very long time).

The problem is: FastCGI just kills the IO stream between PHP and Apache, giving PHP no chance to properly shut down. Data that has already been received by FastCGI is still handed over to Apache - if it's incomplete, it'll raise an error (the one you see about incomplete headers). In addition to that, the PHP processes stay there, running in a zombie-like state, unusable because there IO stream is now dead. You may have to kill them manually or wait until PHP-FPM hopefully does (depending on process manager settings). The other errors you're getting are generated by PHP for this exact reason: Pipe was closed, Apache "disappeared" on the other end.

So: Make sure FastCGIs timeout is higher (by at least one second) than request_terminate_timeout, and this one is higher by at least another second than the highest value you use in max_execution_time.

Note that the latter can be changed using ini_set, so make sure to remember what values do work and what don't - or set it using php_admin_value in your FPM pool configuration, so it cannot be changed inside individual scripts (see the documentation). Not because it's necessary (request_terminate_timeout will terminate PHP children properly as long as it'S lower than the FastCGI timeout), but because your scripts can detect the timeout properly if setting max_execution_time fails, while they will asusme it worked if they can override it (there is no way to read request_terminate_timeout from inside PHP scripts).

You can change all values for each pool separately:

    max_execution_time via php_value/php_admin_value inside the pool config

    request_terminate_timeout directly inside the pool config

    FastCGIs -idle-timeout in the Apache config, where each pool has to be added separately anyway:

    FastCgiExternalServer /usr/lib/cgi-bin/external.php5.www -socket /var/run/php5-fpm/www.sock -pass-header Authorization -idle-timeout 310  -flush

    (paths may be different of course, this is just a quote from my config, but I'd recommend the pass-header for Authorization, although not related to this problem).


Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: php-fpm_event conf
« Reply #11 on: 2015-05-05, 18:33:50 »
Copy '/opt/configs/php-fpm/tpl/php53-fpm-pool.conf.tpl' to 'custom.php53-fpm-pool.conf.tpl'. After modified, run 'sh /script/fixphp; sh /script/restart-web -y'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine

Page created in 0.037 seconds with 22 queries.

web stats analysis