-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
HHVM provisioning and toggling between php-fpm #45
Conversation
( ͡° ͜ʖ ͡°) |
(◕‿◕✿) |
@@ -0,0 +1,6 @@ | |||
--- | |||
- name: restart nginx | |||
service: name=nginx state=restarted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handle should be the same as https://github.com/roots/bedrock-ansible/blob/b859a967a0c08ce5eb3b2b899e35a189dc4bf197/roles/wordpress-sites/handlers/main.yml
Generally reload
is preferred over restart
for Nginx.
Reloading nginx is safer than restarting because before old process will be terminated, new configuration file is parsed and whole process is aborted if there are any problems with it.
Big 👍 for renaming the php role. I'll go over this again later but it looks mostly good. |
Okie doke, made all the requested changes. Also was able to figure out, we can throw all of our handlers in one file and have subsequent tasks utilize them, so I threw all the handlers thus far into Side note: am encountering a peculiar issue and curious your thoughts. On vanilla provision, at the end of the provision, Another note: On subsequent provisions where switching between implementations, a 502 is thrown until nginx has been reloaded or the box restarted. |
To address the 502, should we reload nginx after wordpress-sites has done it's thing, just to be sure? |
Be sure to update the readme ansible version if you are using newer Ansible features. (◕‿◕✿) — On Tue, Sep 2, 2014 at 12:00 AM, Nathaniel notifications@github.com
|
Ah, good catch! Done. |
Though, after re-reading the docs, I'm not sure this is a super new feature... did it just not work before? The docs say once loaded, handlers apply across all playbooks. They also mention having a |
I rolled back my version of ansible to 1.5.4 and confirmed: this isn't a new feature. Turns out we've been duplicating our handlers for nothing =p |
I blame @swalkinshaw |
Silly @swalkinshaw 😉 |
Never trust Stack Overflow answers. |
4664403
to
1ee2770
Compare
If this is looking good, I'll squash this one as well. |
fastcgi_pass 127.0.0.1:9000; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be 2 space indentation here. Other conf below is 2 and our others are as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I should probably give this one a test first |
Finally tried this out and I had one problem. Any nginx conf files like |
One other thing, what's the reasoning behind setting the implementation in the new |
I'll get to the file permissions asap. As far as the |
Yeah, I think so. Just seems weird to have that one setting there and everything else in another place. |
@nathanielks can you rebase + squash? Think this is good to go. |
5dc9eee
to
b27d653
Compare
Hey, I rebased and merged and started testing on a vanilla install and am running into some 502's. Will work on this some more and get back with you when it's ready. |
Okie doke. Did some more testing and reporting some findings: Provisioning a php implementation in a way locks the server into that one implementation. Otherwise, reprovisioning with a different one results in 502 errors. Restarting the machine, however, resolves the 502. After some further testing, I was able to find something curious: initial provision of a php implementation works out fine. Reprovision with another results in a 502. I ssh'd into the machine, ran
Now here's what's curious: I ran
After some more testing, I've found that 502's aren't consistent, but the above two conditions are. Going to keep testing and see what I can come up with. |
I'm wondering if |
I was wondering that too, but it doesn't do anything. The thing I find curious is nginx is running, but |
Ah, gained some more insight. From
|
This is while fpm has been provisioned. It should be connecting over a socket. |
You know what, I'm wondering if the initial provision's |
Opa! I think I got it. There is no pid file set in |
Shoot. I was wrong. |
04d1492
to
7a28d72
Compare
Okie doke. This can be safely merged now! |
@@ -69,5 +69,6 @@ Vagrant.configure('2') do |config| | |||
# Fix for slow external network connections | |||
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on'] | |||
vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on'] | |||
vb.memory = 1024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this? It's already implemented.
yerp, on it |
7a28d72
to
bef5482
Compare
boom. |
f7c834a
to
17939b2
Compare
Okie doke, ready for review. |
…ck of worker pools in hhvm
just found out hhvm won't be supporting multiple worker pools, so we could only use one socket for one domain. The workaround is to have separate hhvm instances running on different ports. I know thus far |
@swalkinshaw I forget where we landed on this... |
- name: Install HHVM | ||
apt: pkg="{{ item }}" state=latest | ||
with_items: | ||
- hhvm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for with_items
here. Just hardcore hhvm in there.
@nathanielks me too. I'm thinking we should just ditch separate php-fpm confs/sockets per WP site. Then HHVM and PHP-FPM can both be treated in the same way with 1 socket. |
Closing in favour of #136 |
Whoop whoop! |
php-55
tophp-fpm
as it made sense ( to me ) to remove theversion number from the role as it may change in the future, and
php-fpm is a more accurate representation of what we’re doing (
especially considering we don’t have version numbers in any of the
other roles ).
meta/main.yml
based upon the variablephp_implementation
located invars/common.yml
. The tasks in the php role are executed after said role.nginx-php-fpm.conf
andnginx-hhvm.conf
to allow decoupling ofhow nginx passes the request back to php. I believe the hhvm
implementation can be used for both, though we’d have to change from a
socket connection to a tcp connection. Should we choose, hhvm can be
used over a unix socket and we can standardize the file name structure
as well so as to not have to keep changing the nginx php location block.