SymfonyCon Madrid 2014

Mejorando el rendimiento de Symfony con Varnish

Carlos Granados  · 

Presentación

Vídeo

Transcripción

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

hey I hope I can keep you entertained and so I'm going to talk today about varnish and how to make it work with symphony and first of all let me introduce myself I'm Carlos granados I live here in Spain in Galicia and I've been developing symphony

application since 2010 and a symphony certified developer one of the first 50 so I'm quite happy about that and I've been developing so where I would say most of my other life I've been developing software for almost 25 years and most of that time

I've been in a building games which I love so I started working with 88 computers then I move into arcade computers then mobile and then I got to all to continue building games so I move into the web application and mobile applications that which is what

I'm doing now this is how some samples of the work I've done in the past and so first of all before we move in to burnish we have to decide do really need a cash a seller error because seem funny taking into account all the feature that it provides

is really fast if you if you get to think all the things that simply provides from database access although routing all the classes all the annotations everything I know I made a list and it was like something like forty different processes that were involved

in every single request and taking that into account Symphony it's pretty fast and i gave a talk on last year's the same phony components in madrid where i explain all this and the main thing about symphony is that it practically calculates and catches

everything you know routine the caching the all the classes everything so that's that's what sinfulness quite fast so in fact maybe we don't need a cash application so let's look at our case test we have our website which is called clipping

book calm and this is a website where you can build this kind of we call them visual books a we call it as this one search engine what you do is you input a term and forks bull fight club and then it goes into the web looks for pictures videos text about that

thing and it builds this beautiful book with all this information this is a real book you can turn pages and I think it's a really nice service and it's going quite well so we measured and we were running this service in a single server and we measured

that we were able to handle 100 requests per second which is quite okay I mean for a it's a simple server nothing fancy nuttin not at two thousand dollars per month server which is ok but this wasn't enough to handle our load you know especially when

we start doing Facebook emotions when you suddenly posted something on Facebook and then suddenly 10,000 users came at the same time to your website and then they brought him down so we had to do something about that we couldn't let the website go down

and we could have moved into another back end we have tried to improve seemed funny or anything like that but we really chose symphony not because of it performance but rather because of a lower cost of development and maintenance which is symphony because

as it is very it's simple and it's easy to use and it allows you to do things in a logical and simple way and we also did not want to renounce too many of the sinful features like ORM two templates which makes your life easy okay maybe you can optimize

by taking them out going straight to the SQL code and writing your own PHP display but what you're going to get out of that is not almost need to go and and you're losing a lot of other things that may seem funny a really nice platform to work with

so we could have also scale particularly by using a much larger server with much more memory much more processing power horizontally by going clustering and distributing into several servers but do decide to implement the caching strategy first so our solution

was to implement varnish varnish is a cache a web application accelerator also known as a caching HTTP reverse proxy what it does it's it since in front of your HTTP application and caches its responses so you get a request barneys looks up in your cash

if it's there then it suffered back without going to your scene funny application if it's not in the cache then it goes to the backhand as for it and then saves it in the cash so that next request when they ask for the same information we can serve

it directly from them from the cash and the result is that by using just a simple a single varnis machine and the same old symphony machine that we were using now we are going to be able to serve 10,000 requests per second which is a 100 times improvement

which i think is a really nice improvement just by putting some software in in front of your sim free environment this is something that you will never get by optimizing Symphony optimizing your code or anything like that so it's a huge improvement by

doing a very simple thing so I'm going to talk about barneys these are the two things I'm not going to cover in this talk one of them is how HTTP caching works and I hope that you have a general idea of how this works because i'm not going to go

into detail if you want more information you can also read the HTTPS specification which is a really good document and I always recommend that you read it carefully and the documentation about HTTP caching and in symphony is also great as this all the symphony

documentation I really love the scene for a book and you you'll get a very nice overview of how it works in this chapter here and also i'm not going to cover basic varnish installation configuration and fabian covered this in a very nice talk he gave

him the same funny in spain a couple of years ago i highly recommend that you look at this talk because it's really informational it has lots of tricks and tricks and it's a great great in tradition to barneys so don't worry i'm going to let

you know a little bit about that configuration and how to handle varnish so i hope that everything doesn't sound too like chinese to you that some cases if you have never worked with varnish before or any HTTP oxalate door I have some of the things maybe

a little bit strange so my hope is that even if you don't fully understand what I'm saying now if at some point in the future you need to install varnish you can go back to my talk and find the information you need there OC okay so this is what I will

cover first of all I'm going to talk about why we choose furnace and not other HTTP cache accelerator a quick overview of a varnish configuration just a couple of slides and we're using virus for which is the new version of varnish which was released

this spring and I'm going to talk about what's new because most of the people out there are using bodies three which is the more established version and if you look for documentation blog post and we think you're going to find everything about

barneys three so I want to talk you about what's new and what's different here and then we will go to move into using Barney's with the same funny and look at all these different issues okay so first of all why did you choose parness one of the

good things about furnace is that it's really really fast it's amazingly fast and it's highly configurable you can really with the body language do anything you want you can catch things not catch things add headers delete headers whatever however

complicated your process balance is going to support it and it's really well documented in the symphony documentation there are some specific documents about barneys so that's that's a really nice thing also for example there's much much less

information about engines or squid and we have some really nice bundles that have you interacted varnish that's another point a really good point about it and and I have to say I was sold by fabian stock you know the information that he gave about varnish

and how to configure it and everything I really loved it and I was sold and the combs against varnish particle entation is I said you're not good i'm going to she say it's ship the main thing is that it's very updated you I cannot understand

[ ... ]

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