 hey people good morning you can do better than this good morning yeah that's what i'm talking about first of all it's my pleasure being here today and i'm talking about stress testing so i will walk around i expect them bother anyone one billion and six million of dollars one billion and six million of dollars that is what amazon would expand with one page slowdown one second page slowdown you know actually amazon is not the only one that are concerned about it there's a lot of other big companies that would suffer and would spend a lot of money and lost a lot of money with performance and page speed other one is google google actually made this research that if they increase their page they decrease their page speed by 500 milliseconds that would drop their their traffic by 20 percent 20 percent is a lot and if we take a closer look at those numbers like the relation between page abandonment increase and load speed we're going to see good stuff like the most important part about this graph here is the four seconds data now only after four seconds so four seconds would increase your abandon page rate by 25 percent and it's a huge number it can make the difference between the sewers and the failure of a product it can make the sewers between how many people do you can support and how many lives you can change with a product and with your application and the thing is that the the users are not like really really freaking about speed and freaking about impatient it's not about a generation thing actually it's about neuroscience there's a fun research that was made with some users and the expectations are really high like 47 of the people that was consorted tell that it's back to a page load to be fully functional in two seconds and it's too much and this is not the worst part like the worst part is that 75 percent of the same people 75 percent of the same people said that they would not return if this page took more than four seconds to load and yeah you should be worried about it because our brand does not operate doesn't operate really well in short-term response and in short-term memory actually our short-term memory can hold like anything for more than 10 seconds after 10 seconds you can literally say that you forgot what is your short memory so you must be really worried about it you must be working about it you must you must be working about performance and all this is related about performance performance is like it doesn't matter if you are a developer it doesn't matter if you are a team leader it doesn't matter if you are a product owner or if you're just another stakeholder sometime in the life of your product in the life of your application you you end up have to deal with some questions like will your application meet the no-function requirements how will your application behave in that extremely circumstance like heavy traffic so performance affects everyone of those and everyone that works in web development in industry. I am João Mota I'm the founder and CEO of GeoCo GeoCo is a SaaS notification platform and I'm here to talk to you about stress testing as a culture. The first thing that we have to ask ourselves here right now is how to increase the success rate of my application to meet the needs related to scale. This is the question here right now because the stress testing performance testing load testing it's all related about scale is all related about being ready to handle extreme circumstance into our application and to talk about scale to talk about performance and test I will go through four key points it's four simple key points that will enables you to start to stress testing and to address the stress testing as part of a culture of your application but in order to talk about those four key points I have to tell you guys a story and to tell this story I have to tell you from where I am and I'm from Brazil for those that doesn't know this is the brazil flag and this is exactly where I leave so I came all the way down to be with you and to share with you this experience and everybody and everybody that asks me when I tell them from Brazil and I have been in conference all around the world and every time that I tell them like I'm from Brazil everybody asks me about oh and what about the trees the lakes the florists and the animals and all the school stuff that you guys have around and actually we have a lot of trees lakes and florists but it's not usual in the whole country like I have never been one of those scenarios actually I came from Sao Paulo and this is Sao Paulo pretty different actually I have some cool stuff to tell you about Sao Paulo so paulo is the largest city in the whole americas and it's amazing and not just the the biggest the largest city it's actually the most populous city in the whole so-called hemisphere it's really huge and actually we have a lot of buildings we have a lot of traffic this is a usual picture of our friday night yeah you can you can easily get stuck in one of those if you're in Sao Paulo on a friday night so yeah there is no trees there's no lakes there is no animals there's no this kind of thing where I live but there one thing that we are good and really good at and it's fun we in brazil love to have fun we love to party we love to play we love to go out with friends we have to go to bars we are really good at it like we really love to get fun and one of the most entertainment things that we do is soccer uh you you might know us by our famous players or by our famous teams and all this soccer stuff that is going on brazil and actually i'm not a big big fan of of soccer but i like it and two years ago two years not one year ago i received the invitation to join a startup that was working with soccer in brazil this this startup was called palpitators they were basically a soccer social network and they asked me to join them as their cto and prepare them to the world cup well soccer is huge in my country so it would be a great opportunity to address big challenges and a whole different context that i was not used to so yeah it took me a little wide but i decided to join them a few months away from the world cup and we had a great marketing opportunity because one of our partners were neymar and you might know neymar as a player of barcelona and we landed a deal with him that we could use his image for the next 10 years so yeah it was a great deal for us and we are working pretty hard to make a marketing deal on top of it to the world cup so yeah there are a lot of huge expectations and when we start to talking about the world cup when we start to talk about this whole market thing and even landed a deal with a tv cable channel i start to worry about performance like okay but your application be ready to support this kind of thing like i have just gotten the company and you are talking about marketing stuff and how to bring a lot of users and make us a huge heat but i'm not sure if our application can handle it i'm not sure if you are prepared to extreme circumstances and the thing about performance is like it's a nightmare to developers you sometimes thinking about it you sometimes don't think about it but once it becomes your reality once it becomes true it's really scary so i start to google around and see what i could find about stress testing what i could found about loading tests that could help me to assure that my application was ready to this world cup thing and this is how i end up knowing what is the stress test and that's how we decided that we are going to use a stress test to ensure that our application is safe so we made a little benchmark we decided start it pretty pretty easy just to know if you get it right so we decided to made 15 requests in one minute it's pretty pretty low like it's a regular application we are talking about one request in ever four seconds and you don't have to be a genius to know how it turned out for us yeah the results were really really bad actually what happened is from the 15 requests only three were successful and the average load time was almost 10 seconds yeah we were definitely not ready and it's like you may have already seen some numbers close to this or you may work on something that can become so heavy like this and actually this was my face when i saw it this was my face when i saw it like i was really worried i didn't know how to handle this i wasn't prepared at all we are just like a couple weeks from the world cup we already have landed these deals with these major companies and we are not prepared like if the 15 people came up to our application in one minute we are down so how we are supposed to solve it and when this when when you when you see this kind of thing like when you leave this kind of thing you start to blame developers because the easiest way to do this like they're the closest people to this kind of problem but actually it's a problem that impacts everyone it's related with marketing it's related with design approach it's related to business rules so here i'm gonna make a small break a small pause on the story because here is where the first key point pops up and the first key point about stress testing is a culture is how to approach it so once that you realized how performance and how stress test is important how to approach test test how to start to thinking about it and the best thing that that i can tell you about how to approach test test is you have to give the attention it deserves if you are not in the same condition that i was where you needed to solve it quickly it's the best time for you to start to give it the attention it deserves because you have to treat performance see as a critical matter you have to trust to treat developer as you treat design as you treat development and as you treat marketing and you have to change the way you think because you have to make performance a priority so it can guide you in your decision making process so you're going to start to ask yourself are you going to use the cms are we're going to hold to host our website or should we download a team so should we do a feature and the best thing to set performance see as a priority or to start to stress testing is to set goals so you have to set up some goals to your stress testing and to your application to your performance see and set up goals it's defined a performance in budget that you have to stick to it and compromise to it so you have to set up a budget and you won't let anything that will decrease your budget decrease your performance comes in and if some feature comes in some features that will not help you to achieve those goals or will take you away from those goals and from your performance budget you have three options the first option is you optimize another existing feature or asset that you have into your application the second option is you remove an existing feature or asset from your application so you can stick into our goal and the third the third option that is the most difficult one you don't add a new feature at all because it will take you away from your goals and your performance in budget and there is a there is a couple of small things that might help you to set those performance goals and the couple I'll talk about them a little quickly like the first one is a simple golden rule and this golden rule talking about 80 and 20 it's say that 8% of the time that users spend into loading your application should be on the front end and 20% should be on the back end if you start to use the simple rule it will start to help you a little bit to set up some small goals to your initial stress testing and another trick that might help you to set up those goals is a really bad word that has been totally misunderstanding it's mobile first what I would like to call performance first because there's one thing that people don't get about mobile first mobile first shouldn't be only about screen size mobile search should be about everything related to mobile including network speed it should be taken into account to so because it's deeply related with mobile so yeah that's another cool thing that you should bring to our application to help you to set up your initial goals and to start to approaching the stress test because mobile is exploding mobiles will focus you to will force you to focus and mobile will extend your capabilities so you have a nice small idea of how you should be worried about how mobile network works and how to make your performance see better there are some numbers I'm going to shade to show you those are those numbers that people that doesn't that are online at the people that have smartphones and the spectations is that two years from now everybody that is online will have a smartphone everybody and there's some other numbers like if you take a look at the close curve at adoption of those technologies the gray line is the adoption of internet is how people that don't have internet are decreasing and the blue line is that how people that doesn't have smartphones are decreasing and the expectation is that by 2017 everybody that has internet will have a smartphone everybody so there's a good company that start to approach stress testing and performance see at use those hints that I gave you this company was BBC BBC defined that they would target a 10 seconds load at the gpr s connection so they used exactly the hints that I gave to you so they focus it on mobile and they define it goes goes that they should commit to and we at our application on pop potatoes when we decided to stress test the first thing that I thought yes all right I have to set up some goals I have to commit to something that I'm looking forward to achieve and my commitment was I will reduce while our 10 seconds load to minus 500 milliseconds that was my goal it was really rude go for two weeks of work but yeah I said we are going to do this and we are not going to add any new feature that might compromise this goal and this is the first thing that you you have to do when thinking about stress test the first thing is you have to decide how to approach it and the second thing the second key point that I will show up today it's there are different types of testing you have different types of performance in test you have different types of stress test you have different types of load test there's a lot of different ways to do this and there are different different tests but we decide that we'd like to focus on stress testing the difference between them is that performance in tests they validate your speed your stability as a tested application the stress test that is what we wanted was determining how your application will behave in extreme conditions and the load test is verified for your application performance specifically under peak load conditions so yeah we decide that we would move on with stress testing and in order to do stress test you have two different ways to do this you can do this as clients per second or you can do this as maintain client per load and it's a small difference that may apply through the type of application that you are building the type of application that you are working on so the clients per second is really simple is how many clients can go to your application get out your application in every second and the other one the maintain client load is how many clients can get in their application on top of each other and keep in send request together so yeah depending on the application that you are working on you have to choose one of those and we choose it the clients per second that is what would make sense to us and we define the goal too our goal is that we want to beat five requests per second so we are talking about 300 requests per minute that's way way bigger than 15 requests per minute that is how we started so yeah those are the first key points so once that you realize that you need to worry about performance or that performance issues might be happening into your application you have to decide how to approach it you have to define goals and you have to decide what kind of stress testing are you going to do and the third key point is what tools to use and there is no straightforward answer here like there are different tools for different kind of needs so I will go through some of the most famous of them and I will tell each one we choose it but there's a lot of other solutions that may help you the difference is about how to set it up in what language it's writing and how to write type of reports you get from it so there are some of them that are pretty much fiddles you have a patchment it's huge because it's a patch so yeah it might be a great choice you have jmeter that's writing java but it's a good solution you have send you have attp perf you have attp load and you have trample that it's right and ruby so yeah I have a lot of great solutions around it's easy to find them I can dive into which one but the one that we choose was one that was developed by a great company this company was send grid send grid develop a solution to stress test and load test that's really cool and it's called loader IO I would totally recommend it to you if you are looking for something to stress test your app because it's pretty easy to set up and have great reports either they describe loader IO as a free loading test service to stress test your ab apps and APIs with thousands of concurrent conditions so yeah actually you have some paid plans but you can use the free one that will enable you to test 10,000 clients per test and yeah it's totally enough for you it's totally enough for the most of applications unless you are Google and well they have lights a great interface that will enable you to set up it really quickly so all you have to do is fill some forms and you also have some great reports to watch so yeah it was definitely a great solution for us and we decided that we were going to use it and I would recommend it to you too and this was the first point so yeah they're all pretty much simple until now so you have to give performance priority you have to set ups and goals you have to choose the right two that you are going to use and the four points is really really really really important I think the most important point of all it's about culture because culture is a it's a tricky thing because no one can just really describe what a culture is a lot of people may try to describe culture but it's really hard to describe what a culture is and how it represents how it represents itself into your application into your company the best description that I have about culture is that something that can easily be spread it's something that replicates itself inside the company so it's like a DNA that's the best description of culture that I have and we as developers have a power to form new cultures not only in communities but also into our companies we have this power to set up and create new cultures and you already have done this before we have done this before with tdg with pdg and anything that you can put here but yeah so we already have done this before we we as developer have brought testing to company's culture and we can do this again with stress tasks and I believe that it's an easy way to do this if we want you and the easiest way is by integrating it into our deployment process so what we should do is integrate our stress testing within our Jenkins or any any when any integrate any integration process that we have into your deployment process that's the bad way to create a new culture related to stress tests and we can do this we certainly can this is the most important thing but you must be thinking about how it ended up for us like how was the world cup for us and I'm going to talk about it so you might remember our results it was only three sets three sets full response and it had an average time response of 10 seconds so we have done some pretty pretty cool thing to solve it I won't dive in because it's not the purpose of this talk but I'm talking a little bit about what we did the first thing that we did is that we created indexes so every index that we're missing into our database structure the second thing we changed a lot of our database structure and relationships so we we just deleted our relationship that doesn't make any sense and created new ones that made sense for us the third thing is we have factored tons of code there's a lot of really bad code that you can find into any application you can always rewrite it so we focus it on the rear rewrite code the fourth thing is we put everything that we could as background jobs it was really helpful but the most important thing that we did was cash but cash for real and you have to do it right cash is a tricky thing actually I became a deeply interested in cash and it was one of the most helpful approach that we had and after this I will show to you how was our reports so this was our first report as you can see it may be a little bit small but there is the true response with the 10 seconds low time and after all these changes only a week after this test this was our chart as you can see here we have 299 requests so only one request were lost and they all took 627 milliseconds so we almost almost got our goal you can see they close here so yeah it was amazing like we solved it and we solved it so quickly like we dive into code we made the stress test automatically to run every time that we wrote a new code we integrated it as our deployment process and it was working but well the World Cup had arrived and there was the first day the first game the most amazing thing everybody was super excited not only about the World Cup but about our application and the first thing that happened after the game is our application went down yeah and the thing is our application went down and there's a lot of reasons about even we're working pretty hard and we have done everything that I told you we weren't able to make it and the reason is that we concerned about it too late so what I'm trying to do here is alert you is tell you that you must worry about performance issues right now before you really need it before you went up in the situation that I did and you won't have enough time to work on it performance in task is crucial to scale an application there's a lot of people going crazy about startups right now so you have a lot of people throwing money at startups we have a lot of people starting new business then everybody are seeking a huge apio with a lot of users using it but the thing is that even with all the money on earth and the best people around is scale and performance performance might keep you from scale so it might really really cause the failure of your business and the failure of your application you must start to address it now so I have just a few more slides I will do a quickly a quickly wrap up so if you go out from here and you don't remember my name what I do and some of the things that I said there's some things that you have to keep in mind the first thing is this you have to set goals and you have to stick to it so set up some performance in goals set up some stress goals through application that you are going to commit to the second one there are different types of tests each one depending on the type of your application so define what kind of test do you need what kind of test your application needs the third thing is choose a two doesn't have right and wrong about two stuff there is no straight in for the answer you just have to choose the two that it enables you to start to stress testing as fast as possible and that you give you the best reports that you might need and the fourth and the most important one is make it a culture it's hard to make it a culture now maybe in the next ruby conf one year from now I will see a lot of people saying that hey we are stressing testing as a culture stress test is part of our deployment process and maybe there is some other talk about stress testing here so yeah this is a little quickly wrap up I just have to say some tanks about some a lot of great people and great companies that made able me to be here so first I'd like to talk a little bit fast about open source after all this stress testing thing and now my experience I end up really involved with cash and with some open source projects and right now I'm really deeply involved with active model serializer from rails api and we are really working hard to make the new version that one very one that zero zero version so we are looking for as most as contributors that can help us there's a lot of poor requests and a lot of issues open we are trying to make the most we can by ourselves but it's always good to have different people currently building with us into this the other thing that I wanted to talk is that as I said I leave the potatoes and started my own company called the geoco that is a sauce platform for gamification so if you want some stickers or want to hear a little bit more about it just look for me I would like to give you stickers also we have just released our hero co-integration so we are the first gamification add on that you can find so if you want to use us we are on beta so it's for free make yourself comfortable and also you can find some things that I have been writing the last few years at site point at all the rubsters now known as site point there's a lot of blog posts that I wrote there and this is it people thank you