PHP UK Conference 2013

Exprimiendo Nginx al límite

Helgi Þormar Þorbjörnsson  · 

Presentación

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

welcome to cranking engine x2 11 my name is helgi on this fellow here so i co-founded Orchestra I yo peace be platform-as-a-service we got bought by engineered and we're sponsoring social drinks tonight a belief I'm paired developer from Iceland originally

for live in dublin and i'm at h on twitter so if you want to haggle me during the talk or asking questions just tweet at me no problem or if you want to tell me I'm you know bad at this whatever anyway engine X so how many people who are actually using

engine X not everyone alright just a fair warning this is not a simple version of my talk this is like the advanced version so to speak so I might actually do a simple version at the uncle so if anyone is actually willing to you know go to that as well anyway

engine X is it just a web server it really isn't because it's a web server it's a proxy it's a reverse Cash it's a male proxy and a few other things and I'll go through a few of those things through this talk but one of the most important

things I found when I was dealing with really complex web sites and kind of with really complex and genetic setups was that dealing with the tweaking and how I actually made that happen without taking engine X down so those of you that use Linux where with

engine X will no conflict test please through boom to so convict test is one of the most powerful tools you have with engine X so you don't have the silly little developer kind of accidentally doing a typo and taking down your whole website so running

convict test after everything you do is really important so it would be service engine ex-convict test and they would tell you oh you have a typo but that's not really the interesting bit about the whole tweaking bit when you reload your config so you

do service engine X reload it's really interesting to kind of figure out how that works and how that's been effect the way you're dealing with your configuration and how you're just working with engine X so the reload is what they call in the

links world the hub signal and what happens is that when you reload reloading the config so engine X has a master process and then it spawns off all the children all the workers so when you're reloading you're actually spawning up new workers and attempting

to put them into rotation so engine X slowly siphons off the old workers and basically lets them finish off the work they're doing all the HTTP requests they have going on you'll finish that and kind of slowly switch over to the new ones so it's

good to know kind of how the inner workings are doing it because you'll have to debug this at some point but you can actually also do upgrades you can do life and genetics binary upgrades without taking your website down so you can actually upgrade engine

X on the Box on the fly without anything going down so they use the user to signal there's a lot of kind of magic you have to do on the back end foremost distros will have that functionality for you or ready for again it's really really interesting

to see how this thing works so you do a live upgrade and essentially what you're doing is that you're bringing up a new master now you're not just dealing with new children or new workers you're bringing up a whole new master she end up with

two engine X master processes working side by side and it will try to actually give the control over to the new master with the new binary if that fails things should just fall back on using the old one so I will attempt to give over control if that works

it will slowly start closing its own connections and the new binary takes over all the connections so these are kind of like really important bits to know when you're actually trying to work with in genetics they seem a little bit weird at the start of

talk but it's good to know what you're dealing with so one of the things I have to deal with a lot is debugging debugging HTTP requests for debugging just what the hell is happening on the web server since I helped run obviously I platform-as-a-service

then I have to deal with a lot of code that other people have written but they kind of tend to blame the web server or the hosting company for their problems so you have to be able to debug properly so one of the things you can do you have to compile with

debug to get the debug kind of tokens and all that stuff into your logs but one of the things you can do is set the log level to debug instead of critical or notice or so on well you may not want to do that all the time you may not want to actually be able

to do that for all the requests that are coming in because I only want to see I don't want to fill my logs with information from the millions of users that I have for thousands maybe so what you can do is that you can actually start using connection specific

things and by the way if anyone has any questions or if I'm going too fast to stop me like I said this is an advanced talk so you can actually set debug connection and that automatically enables the debug logging only for specific IPS or subnets so basically

you can say all my developers I want debug the information when they are hitting my web server but for everyone else I don't care about it because I want to see what only that request is doing or if I just want my own IP to generate kind of those debug

logs you just put in your own IP there so that kind of gives you a lot of information that you can figure a lot more low-level things out but also when you're dealing with rewrite rules so engine access rewrite rules built in so you can easily do rewrite

rules and all that kind of magic that apache you'd have to enable mod rewrite for what you can do what the main problem with rewrite rules is that how do I debug it basically for most developers that is going to be oh i wrote a rule and it just doesn't

work why doesn't it work I don't know you don't really get any information so what you have to do is put the rewrite log on in engine X and put notice level on because all the rewrite log level information all the problems and any kind of information

related to it it's going to be a notice level we have to turn on the rewrite log for that kind of pop up otherwise engine X is going to suppress it so it's really really useful when you're actually trying to both move from Apache to engine X and

[ ... ]

Nota: se han omitido las otras 3.102 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.