Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run php-fpm as a separate process #330

Open
wants to merge 3 commits into
base: next-release
Choose a base branch
from

Conversation

jegasega
Copy link
Contributor

@jegasega jegasega commented Mar 1, 2018

Description of your patch

This patch provides several improvements for PHP-FPM and fixes several issues.

Improvement:
YT-CC-939: Now we create separate PHP-FPM process for each application using new openRC script, it allows us to restart each application separately.

Fixes for issues:

YT-CC-887: PHP started as root cannot be restarted. We are adding user to the PHP-FPM application init script, and now it will be set to deployment user even if root user will start/restart it.
YT-CC-985: Application warning user/group directives are ignored when FPM is not running as root on PHP-FPM start or restart. We have removed user/group directives from pool configuration, because now we run main worker as a deployment user.

Recommended Release Notes

Improvements:

  • Each PHP-FPM application runs as separate process.

Fixes for issues:

  • user/group directives are ignored when FPM is not running as root
  • PHP started as root cannot be restarted

Estimated risk

High. If something goes wrong PHP application will be stopped.

Components involved

PHP-FPM

Description of testing done

See QA instructions - tests were done on a solo environment.

QA Instructions

Boot a cluster environment on the latest V5 (not QA) stack, running the Passenger5 stack. Use simple PHP application for the test.

Review the current behavior

  1. Ensure application is reachable.
  2. Ensure monit php-fpm application is in Running state. Command for checking: monit summary | grep php-fpm

Upgrade to the QA stack (js_php-fpm_improvements-v5-0.2)

After the upgrade, test the new behavior, following the same procedure as above:

  1. Ensure php-fpm process dissapeared from the monit list and nstead of it you have monit process having name "php-fpm-<APPLICATION_NAME>". Process shoud be in Running state. Check command - monit summary
  2. Run command ps fauxx | grep php-fpm. Ensure main PHP-FPM process runs as a deploy user.
  3. Stop PHP-FPM process with command monit stop php-fpm-<APPLICATION_NAME>
  4. Start it with command sudo monit start php-fpm-<APPLICATION_NAME>
  5. Run command ps fauxx | grep php-fpm. Ensure PHP-FPM process still running as a deploy user.
  6. Add one more PHP application to your environment.
  7. Run command monit summary. Ensure you have additional monit process (php-fpm-<YOUR_APPLICATION_2>) configured and in "Running" state.

@gengor gengor requested a review from mikong March 19, 2018 17:20
@gengor
Copy link
Contributor

gengor commented Mar 19, 2018

Hi Daniel and Michael,

Jevgenij says you've been working together on this, will you gentlemen please write up your comments, thoughts/opinions and any additional information about this that might be interesting or nice to know? Thank you gentlemen.

@jegasega
Copy link
Contributor Author

jegasega commented Apr 5, 2018

@mikong, could you provide your opinion on this changes when you have time. We have a bundle of PHP improvements pending, which depends on this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants