This paper proposes a comprehensive evaluation framework to assess wildfire susceptibility and its effects on the ecological environment and urban development. It uses multiple indicators such as temperature, soil type, land use, distance to roads, and slope to evaluate the susceptibility of different areas to wildfires. Additionally, it uses the remote sensing ecological index, RCI, and the nighttime index, and TLI, to measure the vulnerabilities of the ecology and urban development, respectively. The results of the evaluation framework are then integrated to assess the overall risk of wildfire disasters in Gillan. The XGBoost model was found to have the highest predictive performance, with an AUC value of 0.927, accuracy value of 0.863, and RMSI value of 0.327. The results indicate that the XGBoost model has the best predictive performance and can be used to identify and assess the risk of wildfire disasters in Gillan. This article was authored by WhitingU, Chowrin, Yuezhi Liang, and others. We are article.tv, links in the description below.


Nagushka, yeah, referencing the three year limited law, although I'm sure the wrecking is still to come, yeah, and here's the thing what Nagushka is referencing. In British Columbia, Canada, they just decriminalized the possession of many drugs, right, but here is the here's the kicker, and Nagushka pointed this out to us on our gilded server, so thanks for that Nagushka, okay, and our gilded server, okay, and Nagushka pointed out, I thought it was they're decriminalizing the possession of a small amount of possession of almost all the illegal drugs, but they're not. They're doing it to drugs, which means pharmaceuticals, right, so it was opiates, MDMA, cocaine, and there was something else, right, and their derivatives, right, but Nagushka can correct me if I'm wrong. They're not decriminalizing the possession of magic mushrooms, peyote, I'll ask how you can use in ceremonies, as long as it's attached to a religious aspect of it.


am here to talk about AC who here who here uses AC all right looks like we got about 50-50 here and for the 50% that don't you know this is a simple little thing that has made my life much much better so I am excited I want to share that with you because I'm always looking for simple things that will you know make my life better you know for example I've just given myself a promotion thanks to Roy's talk you know freelance architect simple thing makes my life better and you know I'm a freelance architect and there's my handles and stuff like that I love hard problems let me know if you have one but so I think this actually ties into a lot of these talks we talk about organizing code we talk about taking the big mess on the floor and putting it in little boxes and putting those boxes somewhere convenient we're replacing depth with breadth but that doesn't make it any easier to find things and we talk about reading code and you know one of the best ways to read and understand code is to start asking a questions and see what answers you get in the same with new projects so what is AC AC finds things and AC finds things really well AC is designed for code and it's designed for code projects and it's better than grep why is it better it's faster it's more intuitive and it skips stuff like your git repository by default so what is the big deal about that so I was going to let's see bring up a window and try to show you real quick so let's say I have an app and let's see how many things I have there so it is 8001 files it's a pretty big Rails project but you know let's say I want to find something like oh I don't know I want to find anywhere the word quest shows up you know it's pretty fast in fact it would be everything's swapped out of cash this is my ancient MacBook Air your new iPhones probably have more processor speed but you know it goes through all 8,000 files in oh I don't know two seconds so that that's something to be excited about and it's also nice to be able to find something like oh I want to find a field and I want to find it in oh I don't know my HTML files and so then all it does is look in the HTML files or if I want to find something like you know I just want to find it in the Ruby files I can you know look for it in my Ruby files and you know so there it is it's in specs it's all that all that other stuff and it can have intelligent default about case sensitivity and stuff like that and it's also very fast which is really good because as Mike says maintaining folk you know has implied maintaining focus is priceless so if you don't spend a lot of time trying to find crap you can actually keep your mind on your task so anyway so that's the big deal and it's actually really easy to install if you have home ring to brew install act you know it's on a boon to and you can even install it in Windows and I've you know worked much better than anything I've ever used to find things in a project in Windows you know you might need to tweak it a little bit you know for example it doesn't know about a lot of these fancy files that we use you know in Rails land so you know you can you can give it some options it has you know these are just command line options that you can give it so I can say okay you know I want Hamill to show up under HTML files and I want to you know be case and sensitive unless I put uppercase stuff in I want to sort things colors you know all that you know some other nice things you know I've got a link to the gist all you know and I posted the presentation to on under the hashtag for Twitter and there's also act at them which is an awesome plug-in that lets you do all of that great stuff like finding files in them gives you a nice little quick fix window and if I had my screen a little bit smaller you would see some context and you can go there and you can see all the matches which is very cool and so there are just all the references all in one place I posted I posted these slides the Rocky Mountain Ruby hashtag and there you go so get ready to grab you Zach


Welcome to Nation Beat. I am Janelle Novel bringing you this brief on the pulse of our nation and highlights around the heart of St. Lucia. St. Lucia's are urged to become earthquake-ready. In a matter of weeks, St. Lucia will own the cover of the European Business Magazine and adult learners attain new heights. The University of the West Indies Seismic Research Centre says it is closely monitoring seismic activity in the Caribbean region. The centre has one that a catastrophic earthquake is likely to strike the region and all nations, including St. Lucia, must be on the alert. Representatives are on island to participate in a series of activities in observance of Earth Science Week. The National Emergency Management Organisation, NIMO, on Wednesday held an information sharing session on the threat of earthquakes, tsunamis and volcanic eruptions to St. Lucia. The session was attended by liaison officers of NIMO and facilitated by the U.E. Seismic Research Centre. Volcanologists at the U.E. Seismic Research Centre, Eurosella Joseph, said a number of role-play activities were to be conducted in an effort to help familiarise disaster responders with necessary action to follow. What we're running is one of the scenarios with respect to volcanic eruption at the Sufrey Volcanic Centre. We're taking one of those scenarios and running it as if it has happened and a different stage is involved and the responses that the officers would take among themselves in their different roles in respect to what the activity is showing, including responses to the press. Earthquakes have become more frequent in the Caribbean with a 5.9 magnitude earthquake hitting Haiti on the 6th of October 2018 and a 3.9 magnitude earthquake hitting Trinidad and Tobago as recent as the 11th of November 2018. Joseph explained that the Seismic Research Centre remains alert, maintaining constant contact with relevant emergency agencies and heads of government. We regularly communicate with governments and our first line of contact natural disaster coordinator officers on earthquake and earthquake safety. We have the automatic location that comes out when an earthquake happens. All of our contacts have that information. They are actually alerted first before the message is then sent out into the public domain through our Facebook and our website and Twitter. In terms of communicating the importance of the message to governments, yes, that is regularly done through meetings, letters, other forms of communication by us coming to the islands such as what we're doing here and going through these exercises in terms of this week is being Earth Science Week and doing the outreach and updating the information we have on each island in terms of the volcanoes as well as the earthquakes. The volcanologist highlighted recommendations coming out of the U.E. Seismic Research Centre. They need to increase the public's own response in terms of their response not to panic. Now, I know it's difficult to say, but if we continue, it's the same as, you know, practicing something over and over. It becomes more habitual rather than a panicked response and the drop cover and hold in case of in the event of an earthquake if you have that response to drop cover and hold on so you cover yourself, get under a desk, a bench, a table. You're better if there's enough space under there and you hold on until the shaking stops rather than trying to run and get out unless you're immediately near a doorway into a master area or an area where you can go to where there's nothing falling on top of you. The workshop forms part of activities for Earth Science Week. Next month, St. Lucia will feature prominently on the cover of the European Business Magazine as the best Caribbean island to invest in. The magazine is Europe's leading subscriber-based publication. The readers voted St. Lucia as the best Caribbean island to invest. Lisa Joseph reports on how invest St. Lucia is capitalizing on this and other investment opportunities. According to the publisher of the European Business Magazine, St. Lucia's award for best Caribbean island to invest was based on new projects, the expected returns on those investments, the yield and return on real estate and government assistance as it relates to tax incentives. The island received over 30,000 votes over a six-month period with readers citing areas of significance such as standard of living, the preservation of domestic laws and ease of access. Readers were also impressed with the current projects from international investors, which signals investor confidence in the island's potential as a choice investment location. St. Lucia will be prominently featured on the front cover of the international publication's upcoming edition in December. The piece will include information on why St. Lucia has earned the reputation as the best island to invest in. The St. Lucia edition will also be distributed at the 2019 World Economic Forum, which will be held January 22 to the 25 in Switzerland. Chief Executive Officer of Invest St. Lucia, Roderick Sherry, says this speaks to how the island is viewed by the international community. The wood begins after that. My investors now are aware that St. Lucia is here. There are possibilities for investment. The important thing for us now is to turn all of that interest into active projects, which would then help Invest St. Lucia to achieve its goal, which is the economic development of the country. Over the past few weeks, Invest St. Lucia has made its present felt at various investment-related functions in its bid to attract investors. Among them was the 12th Global Resident and Citizenship Conference, which took place in Dubai. It is a very competitive marketplace. Lots of countries are seeking foreign direct investment. Lots of countries have the CIP. So it is very, very competitive. For St. Lucia, the message really was that our compliance is vigorous. And I think that is the main thing that came out from the CIP standpoint, that we are not in the business of selling passports to anyone and everyone. We needed to ensure that everyone knows that there is integrity in our passport and we plan to maintain that. Mr. Sherry notes that one of St. Lucia's biggest selling points is its trainable workforce, as witnessed in the experience of Ojo Lambs. The company is the creator of an innovative artificial intelligence-based technology that can conduct text conversation with consumers. More than 180 young St. Lucia's were trained and employed by the company. Mr. Sherry says by March 2019, the staff compliment will move to 300. Building on that success and the investors in that space have seen what has been done and we are attracting quite a bit of attention. Mr. Sherry, we are hoping you are speaking to a couple of people with nothing signed or anything like that. But there is a lot of interest going forward, so that is a good one. We also have obviously the DSH project, which is really going with which is happening. And if it happens as planned, I mean it will be quite a substantial change for the south of the country as a whole. In the coming weeks, Invest St. Lucia will be announcing the commencement of a new project in the south of the island. The CEO says it's a game changer. From the Government Information Service, Lisa Joseph reporting. This is Nation Beat. The National Enrichment Program is being championed as a creator of New Horizons for adult learners. With just one click, the internet connects people, businesses and nations. Being connected can open a world of information and opportunities. You can get services and products of your choice much faster. From electronic financial transactions to connecting with family and friends. From being up-to-date with the latest news and information. To learning new skills and acquiring academic qualifications. All from the convenience of your home or wherever you roam. Get connected today. This message is brought to you as a public service announcement by ECTO, the NTRC and this station. Welcome back. St. Lucia has joined the rest of the world in Observing World Diabetes Day, raising awareness of the impact that Diabetes has on the family. More from Fennel Neptune. In observance of World Diabetes Day on November 14, Chief Medical Officer Dr. Millen-Fedrix echoed a call to promote the role of the family in the management, care, prevention and education of diabetes. Dr. Millen-Fedrix emphasised on the need to practice healthy lifestyles as to prevent and help manage diabetes. Diabetes really is a disease that can be controlled. It is not a death sentence. It doesn't have to be. And percents are reminded that they are to take all of the precautions, eat healthier foods, avoid sugars, exercise, exercise, exercise ensure that the body gets enough exercise to decrease the chances of developing diabetes. World Diabetes Day was held under the theme the family and diabetes. Dr. Fedrix says it is important that families encourage and provide support to persons who are diagnosed with diabetes. This person would have to go through some lifestyle changes. So it may be that you would have to decrease the amount of sugar that you use.  So we're encouraging family members to support that individual. So instead of just doing it for the one individual in the family, maybe the whole family can adopt that lifestyle. And that would help the person who is diagnosed in terms of maintaining, you know, decreasing the incidence and the severity of the diabetes. But it would also help the other members of the family in terms of preventing them from going on to develop the condition. Throughout the month of November, the Ministry of Health and Wellness will host a series of activities with the aim of sensitising and educating the public about diabetes. Reporting from the Communications Unit of the Ministry of Health and Wellness, I am Fennel Neptune. The National Enrichment Program is being championed as a creator of New Horizons for many who did not receive formal secondary school education as a new batch of trainees under the program graduated at a ceremony held at Coconut Bay recently. Chris Satney has more in this report. The Education Sector Development Plan makes continuing education and the training a major priority in like manner. The United Nations 2030 Agenda for Sustainable Development proposes a substantial increase in the number of youth and adults who possess relevant skills, including technical and vocational skills for employment, decent jobs and entrepreneurship. It is with this thirst that the National Enrichment Unit, NELU, continues to reach out to many throughout the island to receive training in several technical and vocational areas, as well as CXC's Caribbean Certificate of Secondary Level Competence, the CCSLC, the Caribbean Vocational Qualification CVQ and the Caribbean Secondary Education Certificate, CSEC. Education Officer for NELU, Dr. Cynthia Polius-Prascott is pleased with the collaborations with stakeholders such as the Winwood-Andywood Brewery and the Caribbean Examination Council CXC in making the program successful, as well as the remarkable successes and passes for the courses offered. We have the view that investment in people is one of the best ways, or I should say the best way to promote a better and brighter future, to promote human rights and to empower people, to manifest this perspective. NELU continues to cultivate synergies with governmental, non-governmental entities and the private and public sectors. Featured speaker Brenda Wilson has worked extensively in social transformation and spoke to the theme, tapping into the power within. It's important that we recognize that being present in life is the catalyst that will propel us to see learning beyond going to school or being in a classroom. That's why we must seek to be present in life and what is being present. To be present, it is to enjoy and make the most of the time you are in. The moment you are in is right now. It means you're in a moment when you feel and know exactly what you want. Some 1,621 candidates benefited from the NEL program from 15 adult centers across the island. From the Communications Unit of the Ministry of Education, Innovation, Gender Relations and Sustainable Development, I am Chris Satney reporting. That's nation beat to join us next time on NTN at 7.30pm with a repeat at 7.30am and on this station as we fill the pulse and heart of our community. You can also catch up with us anytime on the St. Lucia Government Facebook page or YouTube channel. I am Janelle Norville.


I also like that it's like a re-roll thing like it's not a guarantee that you're going to get that panda skin so you might have to burn gems several times to try to get that because that's going to help with burning gems and pretty much getting the prices up on the gems so that it's worth it to open mystery boxes. At this point like I get a mystery box every day my mystery boxes are full because I don't open them really like I do I've opened a bunch of them but I'm at the point where I'm like I'm gonna just wait once those prices go up I'll start opening all the mystery boxes.


I was wondering, I saw the first two presenters stand behind the podium. I think I'm going to try something over here. And you'll notice that to start off with, when the Barucho folks or the Full Stack folks said, hey, submit a talk title, I said something, something Ruby. And so what's ever in your program is not the title of what I had, because I actually forgot what I told them. But I think I'm still in the same vein. And really what I want to talk about here is lowering the bar between Dev and Ops. And the title of the talk is after you commit that code. So just a quick question, who here actually thinks of themselves more of Ops than as Dev? So I see like four or five hands up. All the conferences I've been to in the last four months have been pretty much the opposite. Everybody has been pretty much all Ops. So this is actually good to actually talk to some developers about Ops. So I go to a lot of conferences and I realize, and I can see a whole bunch of laptops here. And I'm sure very quickly, a lot of you are going to tune me out. I mean, I have a very soothing voice. It's going to lull you to sleep a little bit. But so I decided that, why don't I just start with the conclusions? So everyone who has to do work or wants to get an IRC or Slack or do whatever, they can at least get something out of the talk. So here, in conclusion, we're having a continuous, so you need to have a continuous integration story. That's very important. And as I discussed earlier, you know why now. You need to deploy with confidence. You always, so whenever you do your deploys, whenever you click that button or run that command or type whatever, you need to know that it will work every single time. You need to have control of your logs. As you saw from slide 34, that if you don't have control of your logs, things just go bad. And you need to have one-on-ones with your application. You need to not only understand what's happening with your application, you need to feel what's happening with your application and always experiment and constantly improve. So with the conclusions over, I'm Brian Liles. I am actually, it's weird. I used to be a developer for about 20 years. And I said, well, I can do better than this. So I joined the business side of DigitalOcean. I kind of do strategy. I don't know what that means. Like you guys don't know what it means. But I'm basically paid to do what Brian does at DigitalOcean. Anyone here heard of DigitalOcean? Anyone know what DigitalOcean is? Yes. So for Yozi, you don't know. We're infrastructure as a service. We call ourselves a cloud. We're almost there, but we're very cheap and we're really into making sure that developers can get their applications online. And because DigitalOcean paid for my trip in its entirety, I put their little Twitter thing on there. And I am an urban software developer. I don't know what that means. I just like it. It sounds great. So let's start this talk off with a quote. I write software. Someone else deploys and maintains it. I'm sure you've heard this before. I mean, a lot of developers say this. I just write the software. Where it goes on the servers, I have no idea. And a lot of places developers don't even have access to production. You know, we're in 2015. That needs to end. So do you ops? Who here actually knows how to ops? There we go. All right. Well, I'm talking to people up top then. So I've broken this talk down into four or five sections. And the first one I want to talk about continuous integration. We talk about continuous integration all the time. I'm sure everybody is familiar with it, but I want to really just think about it as a topic. Whenever you choose your CI tool, what do you do? Do you just say, well, everybody else uses Travis. So I use Travis. I know that there's a whole bunch of other ones. Circle CI, Code Ship. You can run Jenkins, Hudson. You can run a whole bunch of other things. But whenever you think about your CI tool, it's not just for running tests.   It's a liability. So how do you want to manage that piece of software? And then how much control do you want? If you use something like Travis, you can't control your build environment. You have to actually work within their constraints.  But what else can it do? Continuous integration is just not running your tests. I talk to people all the time. They're like, I do continuous integration. It runs my tests. There's other things you can do. And other languages, besides Ruby, we can run static analysis. We can actually see if things are unused. And actually in Ruby, we can actually run tools like Rudy, Reek, all those, and actually get good statistics about our software. What can it do? A lot of times we think about our CI, about what it can do. But what can our CI do? Well, it's probably not going to run anything interactively. And if your CI is interactive, that's not CI. And then what are the real costs about CI? So it's easy to say that I use Travis for my open source, and it's free. But what is the liability that you have to carry of managing that Travis.yaml file? I don't know. And what about if you're using something like Coachedip or Jenkins? And Jenkins is actually more difficult to configure. But what is the real cost of keeping that Jenkins configuration? So I like to think of continuous integration like a pipeline. And I'm really proud of this, because I paid $99 for this Sketch app on my Mac. And this is actually the 100% total what I can do. I drew a three-dimensional little tube. And actually, it's a square. It was a rectangle and two circles. But you guys didn't know that. So I'm really proud of this thing. It took me about a good hour to figure this out. So let's think about our code pipeline, or continuous integration pipeline. We have a commit. And I hope everyone here is using a modern source code management tool. I'm not saying you have to use get. A lot of us use get. So you have a commit that's referenced with a SHA1 if you're using get. And then you have your test build, your little thing which runs. And then you have an artifact. What I find, and this is interesting in Ruby shops, is that a lot of us don't think about things in this way. We don't think about what comes out of our CI. We think that, oh, we just ran CI on a particular SHA1, and maybe we tagged it. So let's think about, what is an artifact? So as I said in a previous couple of sentences, is that an artifact could be a tag. But I want to actually raise the bar a little bit. An artifact actually could be something else. An artifact, I like the word Docker. Who here likes the word Docker? Am I the only one? I think Docker's neat. I don't think it's perfect. But I think it's a great abstraction for taking this particular piece of software, packaging it up into this format, and then allowing it to be installed on multiple other machines. Does this sound like anything to you guys? Does this sound like what RPMs and devs have been doing for the last two decades? So when I look at Docker as package management, I guess we'll say 3.0 right now. Maybe we're on 3.5, I don't know.  They are really good at logos. I work with Digital Ocean, and I think we do a pretty good job at logos.  They have a turtle and a whale. Containers on its head, come on. This slide has nothing to do with my talk. I just wanted to put it in there. Great art. So you just think about for your CI, you're taking a particular SHA-1 if you're using Git, you're doing something with it, and you're creating an artifact. And that's what I actually wanted to talk about. It's like, you have to create an artifact. You have to know what you're deploying. Whenever, if you're doing this as a professional and not as an amateur or just like an enthusiast, you are deploying something. And I'm not even talking, I'm sure a lot of you are Rails-y type developers who do web apps, right? Yeah. I mean, it's popular. Web apps, we like web apps, right? We like web apps. But you know, this also pertains to people who are shipping things like, just, I'm shipping this service. And I'm not even talking about like a REST-based service.  I write, I'll go. But we do the same things. And when we package, so a digital ocean, and this is a trade secret, a digital ocean, what we do for almost everything is we run it through our CI. And we don't even use anything I mentioned before. We use something called Drone. Has anyone here heard of Drone? It's good. You don't need to hear about this. It's CI that someone said, I know the word CI and I know the word Docker. So if I take Docker and CI and put them together, I have a drone. And what it does is it just runs our tests in Docker containers. But what we really want out of this is the ability to have these artifacts. And we push all of our artifacts, whether they're sometimes whether they're Ruby builds or whether they're Go. And we push them up and we tag them with a version. So anyone can pull down that version. So it's not just coming out of our private GitHub or our public GitHub. It's coming out of this thing already packaged up. So now that you have this thing that's all packaged up, you're gonna wanna deploy it. Because if we just write software and put it on our GitHub, I mean that's like most people. I have a whole bunch of software that I never deploy. But if we wanna make money with it, we actually have to deploy it. So thinking about it, who does your deploys?  Who works in a place where developers do all the deploys? Write on, that's how it should be. A little secret here is, and I tell ops people this all the time, is that your days are numbered. We are going to automate each and every one of you out of a job. And you know what? It's not a negative thing to say that. It's actually a very positive thing to say that either ops are gonna have to grow to devs and devs are gonna have to grow to ops. Think about it. There's someone from Chef here in the crowd and they're making, there she is. They're making lots of money with this theory that being able to write easy Ruby to do configuration management allows everyone, allows that experience to scale across more people. And then also, is your deployments easy to set up? Who here runs Capistrano? Isn't that super easy? I mean, think about it. At the time, and I remember before Capistrano, I remember what was before Capistrano. And then I've used Capistrano. I've used things like fabric to do my installs. I've used shell scripts. I actually even used Ansible lately to do my deploys. Is it easy to set up? And that's a question we have to ask. And I'll say with Ansible, sometimes, sometimes not. But we also, but at Digital Ocean, one thing we did is we built a deploy tool. And it's pretty cool working for a company that has DO because you can call everything do. We have Adobe, Digital Ocean backend. We have a Doge, Digital Ocean Go environment. We have a Do-ray, Digital Ocean Ruby environment. I wrote a CLI for Digital Ocean called Do-It. Come on, whenever you do it, you do it. So I don't know where I came from with that. All right, let's go on to the next one. So you gotta think about your deployments. What happens when they break? You need to have a strategy. Do you roll back? Do you fall forward? Do you just say, whatever? You know, we shipped? I don't know. I can't tell you that, but you need to know within your team what the strategy is going to be. And then we gotta think about where are we deploying to? Some of us deployed Heroku, and that's cool. But some of us actually want to control our full stack, so we deploy to Digital Ocean, Amazon, Google. Some people even deployed to Microsoft, you know, it's whatever. But where are you deploying to? Everyone needs to know. And you really, and here's something, this is just a pro tip. If you're staging, doesn't look like your test environment, doesn't look like your pre-production environment, doesn't look like your production environment, you've failed. And a lot of organizations will say we have a test, we have a staging, but it has data from 50 builds ago, and we don't even know how the state of that data got there. You need to be able to build your environments on demand. And if you can't, you need to go back and rethink your stacks. And then what happens when I oops? I oops constantly, but that's probably why I'm not a developer anymore, because someone said you oops too much. So, but what happens when you oops? What happens whenever someone fat fingers a build? What happens? I don't know. You need to understand that. So back to that Docker logo that I like. So when we deploy, this is what your deploys might look like. So you have, let's say that we are using Docker, we're building Docker images, and we have our own private registry, or we're using a public private registry, and we're saying that we're going to deploy this Docker container to this server, this server, and server. So, that brings me to an interesting thing. Chad Fowler typed a blog post about two years ago, maybe three years ago, I don't remember, I actually think I have it on the next slide, talking about immutable infrastructure. And here's a picture of the blog post, I know you can't read it, but I did create a little bitly link, so I am Infra, if you wanna go see it real quick, if you can get on this body wifi. But what it talks about is deploying to servers. And what we do in a lot of cases is we deploy to our servers, and then we have a new build, and we deploy to those servers, and then someone logs in, they say, oh, no, I gotta change this, I gotta change this configuration file, and then they log out, and then someone logs into another server, and says, I have to change this configuration file, you know what, I'm on the file, it's Ruby, I could just change it on demand, and then restart whatever my Unicorn, or whatever we happen to be using. And guess what happens after a while? Actually, I got in front of myself, I'm sorry, I don't have a slide preview up here, I'm actually seeing my slide, so it's kind of like slide roulette as we do this. When they pop up, I'm like, wow, I typed that. So, let's back up a little bit. I bet your deploys look like this. So you have your artifact, as we talked about in the first section, and you deploy to server one, server two, and server three, and then you do another deploy, and it looks the same, because you know what our deploy should be repeatable, right?  But like I said, what happens when someone logs in? Everyone has that person at their company that says, you know what, get push dash F, you know the F stands for FU, right? And then log in and then just change all the things. It'll be fixed on the next commit, and I committed it in our SCM anyway, so who really cares? Come on, we all work with that person. So that brings me to this point where I like to talk about something that's like, are my servers pets or cattle? Has anyone heard this analogy? This is a very popular, I know, Chef people have heard of this, but do you know, does anyone here know that analogy about pets and cattle? All right, so pets and cattle. So really quick before I go into this, if you've never seen a talk of mine, this is how my mind works. I'm actually writing a program in my mind right now. You guys don't even understand this. I'm solving Lambda calculus in preparation for Corey's talk tomorrow. While I talk to you guys right now. But pets and cattle. So you know, you have cute pets. Nope, cute pets. And you have still cute cattle. Look at those. Who would eat those?  So pets, pets, pets, pets. You know, cute kitties, cute puppies. So pets are given cute names. Pets are unique and they're lovingly raised. And pets require you to nurse them to health when they go sick. Anyone here have servers like that? And pets generally have names like, like I said in this first one, like odin.example.com or killer server or you know, someone here is a comic book fan. So they're like watchmen. I don't even know what watchmen are. I know, I think I saw the movie, but I don't know, still don't know what the watchmen are. But I know people here have servers that are named like that. But the difference between pets and cattle is this. Cattles are given numbers like apple1.dc2.example.com because you know you're running, if your app is important enough to run, you're running it in more than one data center. And then they are identical to all the rest of the cattle.  But I didn't put that on the slide. So, but think about it. Your servers should all look alike. And the cool thing is, I mean, I'm not trying to push my company, but I will say that I know a company that has things like not analog, not lake. We happen to have these servers that you can buy and they all look alike. And other companies have the same thing.  This is my web servers. This is my application servers. This is my server for total domination. It does not matter, but they're all the same. So let's talk about this deploys again. So we have our deploy and we have our artifact. We're pushing off to the servers. Why not just create new cattle whenever you are deploying your second one? And then whenever you go for your third deploy, why not just create new servers for your third deploy? And you can't do this whenever you own your own hardware or maybe you can if you use virtual machines. But the reason I suggest this and the reason I love this idea is because it guarantees that your server looks exactly like you think it looks every single deploy.  You will actually just provision the server and you deploy your software. Or even better yet, you use something like Packer. You provision an image and you deploy the image and you deploy this like soup to nuts. Get rid of everything else. But use your configuration management to build the image. I know these are like crazy thoughts, but guess what? That's where the world is going. So, what are we talking about again? What does that mean to me? We're still talking about deploying all the things. We always wanted to deploy the fresh servers and shoot the old ones in the head when we're done and then serve them up and make little veal cutlets or whatever else we're gonna make out of them. But it doesn't matter anymore because they're done. And this is really forward thinking. A lot of companies don't do this. We don't do it in every single case, but I think that we could do it. I think the industry is moving towards it. And I do know there's a company in New York called Getty Images and they literally do this. They actually, they run on Amazon. They're not even our client. They run on Amazon and they really do. When a server goes out, a new build goes out, they throw up a new one, they test it and then they shut down the old servers so they don't have to worry about bad code ever showing up. So, I think I've said this a couple times. So, we'll move back. So, what about people who don't use the cloud? I'm here, it doesn't use a cloud.  Some people don't use a cloud.  So, what do you do what you do? Well, guess what? That's where containers come in. This is the third time that I'm mentioning Docker, but guess what? With Docker, you can actually build these repeatable images and you can actually do that on a smaller scale.  So, the funny thing is, this is 2015.   And I was talking about testing at the time, but you can still apply this.  It still works.  So, or don't, these are just suggestions. If you wanna be with the winners, you can do it. If not, you can keep on doing what you're doing. So, what's my app doing? Actually, let me walk back over here for a second. So, what's my app doing? It is 1148 CEST. Do you know what your app is doing? I don't, I'm not a developer anymore, so it does not really matter. But, can you answer these questions? Like, what does working okay mean? Do you know you go to these teams and you're like, is the app working fine? Yeah, sure, yeah, it's working just fine. Then you get all these errors. Yeah, except for that error, it was working fine. And then what do I do? Well, where do I go to see things that aren't working okay? I actually have some crazy story about that in a second. And then, yeah, what was my app doing at 345 you see last Thursday? Do you know where your app is right now? A lot of people don't know. So, the first question is, you have logs, right? Right, right. You aren't alone though, if you do something like this.  So, we're gonna ask the station to the server. And then what we're going to do is we're going to stand closer to the podium. And we're gonna go into my app directory and we're gonna go, it looks like a, what kind of app is it like to you? It's Rails, CapAstronode all over the place. So, app, my app, shared logs. And then what we're going to do, there's a problem. Someone's reporting a problem to our support department. So, what do we do? Well, they said a problem was with foo. So, guess what we're going to do? Is anyone done this lately? So, yeah, I'm gonna let you know that 2010 called and says there's a better way. So, the first thing is, where are your logs? If, all right, well, let's try this real quick. I'm gonna say one, two, three and everyone's gonna yell out where their logs are. One, two, three. Yeah, I didn't hear any of that. Did anyone say server? Are your logs on your servers? We don't have to talk. I've seen your hand come up a lot. But if your logs are on your servers, so you have server one, server two, server three, this server is this way, this server does this and this server just says, oh, I don't know what's going on. So, servers because they are cattle, we can shoot them in the head at any time. Guess what, your slog should never be on your server. What we probably should do is use this new found concept called log server.  Let's say it again, log server. So, you take your server logs and you pipe them off to another server. It's only job because it is cattle is to keep logs. And you know, I know Rails does not make this extremely easy. It wants to write to a file, but you know something, there are tools that can actually read that file and ship it off somewhere else. And once one tool that everyone I know uses, we're storing our logs in elastic search from elastic and see that right there? Another 30 minutes. And then we viewed them with Kibana. And you know, you've seen Kibana. Kibana's neat. I actually like Kibana. I redacted everything. This is like real stuff from Digital Ocean. It's kinda neat here, so let's see what we have here. That's something I can't tell you about. Here's something else I can't tell you about. I don't even know what that is. What is this? And then we had 17,000 of something else. I will tell you, so we deal with Digital Ocean, our whole system's event-based. So these are just pictures of events across regions of different types. I will tell you that we are doing really well. These are all creates. Look at it, people love to create stuff on us. And I'm really happy for all of our happy customers that like to give us money. So what's my app doing? Looking in Kibana, you should do that. But who here uses Log Stash? About Log Stash.  But let me talk about Log Stash for a second. Log Stash is neat when you have a little bit of Logs, maybe even like a little bit more Logs.  I'm running in JRuby. Let me show you how my garbage collector works. So at Digital Ocean, we don't use Log Stash. And it might be because we have an Arcist Law Committer on staff. I don't know, he actually, and he's also a zero and two committer. So guess what? Our logging infrastructure is ArcistLog and zero and Q. But there are other ways to get your Logs. And the cool thing about ArcistLog, and the reason I talk about this, is that it's a tool that's been used for a long time and it's not in an interpretive language. Not that interpretive languages are bad. We're at a Ruby conference. We actually like interpretive languages. But if you're doing something that's processing a lot of data, and let's say if you just have many tens of thousands of servers and you have all this coming in at once, I want something as close to the metal as possible. And ArcistLog gets that to me. And ArcistLog can happen to write Elasticsearch templates the same way that Log Stash does. So that's what we use. That's just my rant. And the only reason I'm ranting is because a good friend of mine that works with me is always ranting me about how bad Log Stash was. So what kind of things should we log? I don't know, let's figure this out. If I were to trace my application and rebuild a flow, what data would I need? I don't know, that's a question you need to answer. And I actually noticed that I'm throwing things out, but I can't answer any questions. I'm just gonna be that person in your mind whenever you're actually making these decisions. You're gonna think, well, what would Brian say? And then also it's like, what do I need when the poop hits the fan? I don't know. But you need to think about that. When things go south, how am I gonna be able to get data to the forensics to actually figure out what I need? And then also, does my code capture errors? We're talking more about that in the next session. And then since we're to the next section, let's talk about that. So now we're talking about what is my app doing? But now, so I can tell you what I'm doing at any particular time. I can tell you I'm on stage, I'm giving a talk, I'm ranting, I'm having a good time doing it. You guys are having a good time listening to it. But you know what, that's not what's going on. What could probably be happening is somebody can be like, oh, Brian's heart rate, actually I'm perfectly calm up here. So I'm not nervous or anything. But some of you guys might be kind of nervous like this guy is really intense. So someone can be measuring your heart rate, somebody can be measuring your breaths per second, somebody can be measuring your temperature. This guy, hello, here in the front. What are you working on? All right, awesome. So we could actually see what this gentleman is doing right here in the front. So that's where we're gonna talk about something a little bit different. We're gonna talk about the pulse of your app. Something about what is your app actually doing? Not what is it saying it's doing, what is your app actually doing and how is it affecting its ecosystem? And then also, and this is, I love to put this one in here. If your app crashes when no one is paying attention, does it make a sound? I don't know. I mean, your customers might make a sound but does your app make a sound? You know, debatable. When I was writing this, I started writing this and I said, oh, I'm writing another section on logging. So I said, if I put this disclaimer in there, this is not another section on logging, it's really not. So that's where we are right now. So what we have here is we have logs and we have other stuff and that goes to your peace of mind. So you need all these things to have peace of mind. So we talked about logs before. So let's talk about all this other stuff. What are these other things that we can capture? Well, look at all these keynote animations. I am on fire and fuego.  What is your app? How is your app affecting its ecosystem? How is your ecosystem? Or how are things around your app working? So let's think about exceptions first. Exceptions are super easy and if you don't want to pay any money, because, you know, a lot of us are cheap even though we might bill, we use something called Sentry. Hear anyone here use Sentry? Does anyone here have any Sentry War Stories? I have one. What happens when you send 10 million failures to Sentry? And Redis goes down. Do you know what happens? I'll tell you how you know this is that whenever you're like, well, I haven't seen a, we must be doing really well. We haven't seen an error log in three days.  So it's a funny story about this is that the reason that we know what BigTables is at DigitalOcean is because we had BigTables support turn on in Linux and real quick, BigTables basically allows you to allocate more memory at a time because Linux usually allocates in like 4K chunks but you can actually allocate in like one gig chunks and we had BigTables turned on and Redis was allocating it. So basically it tried to allocate like one sub 10 million billion jillion things of memory in the machine bar but it didn't complain. It's just that Redis went away but we actually pointed this out to the Redis fellow and he fixed it and now it's pretty awesome. But we send all of our error logs to Sentry and it's pretty cool. We have a lot of apps and you can actually go through and see those logs and the cool thing is that you can make those show up elsewhere, whether an email or Slack or whatnot or paid your duty. But remember, your log, your error collection please should be something that you should be trying to train to go down.  So what about telemetry? This is a really weird, interesting new space and not when I say new is that new that we're actually talking about it right now. So I'm gonna tell you guys a secret and I have a friend from Google here who can probably verify this that every good idea that we've had in computer science for like the last 15 years or software has come out of Google. Did you guys know this? No, I'm actually not kidding. Google has done great things. I mean, they're spying on us constantly, yada, yada. But a lot of think about it with their GFS. We now have Hadoop and we have a GFS. The way that they optimize for ad serving has done wonders for the market and how we think about performance. And how they think about programming language is actually the future programming language. It's called Go. And I just know that we're doing a workshop on Go the day after tomorrow from Francesca. If you haven't signed up for it, you probably should. It's an interesting language, I like it. But I'm just saying that Google is always on the things. And another example, like Google does clustering. So they've said we're gonna do clustering or at least something called Kubernetes, which is how Google does clustering. But this right here is interesting because Google says we have opinions on analytics and time series metrics. And Google engineers from Zurich actually quit Joint SoundCloud and now some of them have created something called Prometheus, which is how Google does monitoring. And what they do is they actually, they push data out for only 30 days and you can monitor it in interesting and neat factions. But you need to be able to see your data over time, period. And I know a lot of us use Graphite. We're huge fans of killing Graphite and using it in crazy ways. So we're moving everything to Prometheus. And I'm only putting this out there to put a new word into vocabulary because I'm sure a lot of you have not seen Prometheus yet. It's pretty neat, right in Go. As all awesome things are. And actually, here's something neat about Prometheus. Prometheus produces pretty graphs. I think anything that produces pretty graphs is worth looking at at least once. This website is like, if you'd search for a prom dash, a P-R-O-M-D-A-S-H. And Prometheus will come up. It's pretty neat looking at it. But we use this to monitor our many tens of thousands of servers. So what should we be monitoring? Well, it's really easy. Operating system state. So desk, CPU, memory, shared memory. What's your apps doing?  Because your app might be bigger in the morning than it is in the evening.  But if you're using, no, this is not a dig. See, you guys, you're horrible. Right here, you guys are horrible. It's not a dig. That's just, that's how Ruby works. And that's fine. But other apps that can actually go up and then come back down. And that's just how they work. You should know the characters of your app. And then also you should know about what's a network look like? And what's this look like? And what's that look like? If you have your servers outside, what weather is it? I don't know. But you should put all that stuff in a central place. And we do what Prometheus and Prometheus rollups and PromNation all that stuff. So I've been talking for, wow. Almost to my time limit. What else can I do? So here's one thing. 12 factors crazy. I know a lot, I introduced 12 factor people and they're like, I'm never gonna do that. But I said, well, hmm. What if your apps were stateless? I said, that sounds like a good idea. What if you shipped your logs off somewhere else? Wow, that's kind of a great idea too. What if you use configure environment variables to actually configure your app? They're like, well, wait a second. That's a good idea. So I guess 12 factor. Those are three tenants with 12 factor. So don't have to embrace it all, but read it. It's one of the best things to come out of Heroku. These guys have really put it together. And ladies, I'm not. So the next thing is, invest in chat ops. I know it's kind of like a buzzwordy term, but I'm really into it. And here's another heavily redacted digital ocean screen. And you notice that that's how you know I'm in business. You might even end that channel. But we do, but I did actually write some of the software for our Hubot. But what it does is we can actually allocate servers on demand, we can put them in the Chef, we can do all this from just the command line of talking to somebody. And a good thing is that it's done in public. It's not on anybody's desktop. It's done where everybody can see it and we have real logging of it. Also, what is this gonna say? Oh, here's the most important thing. DevOps is, I don't really know what it means if you ask somebody, I'm a DevOps. I'm like, I don't understand how you do that. But DevOps is important because the most important thing that it invokes is this, empathy. You should empathize or sympathize for the people who manage your servers throughout the night, the people who are on call. And if you're not on call for your app, you should think of how you should be. Because as the people who create apps, we should be the people who are running our apps and understanding how they are. And if we're on call 24-7, we will not create these crappy things that we tend to do. So, what else can I do? Look at that. Now, this is on DigitalOcean on our call.digitalocean.com, we have a Create button. And it used to be really, really fast. And then we introduced React.  But I want to show you this because I want to lead up. What else can you do?  You can boot a DigitalOcean droplet. That's my only sales pitch. I will say that DigitalOcean loves developers. I love developers, that's why I do this all the time. And that's it. Thank you.


David Greenwald, how to clean the WordPress database. David Greenwald used to be a professional music critic, and has interviewed Radiohead, Barth Brooks, and 50 Cent. Now I'm super excited about making WordPress run tens of milliseconds faster and keeping websites about 50 Cent for progression. He's a freelance WordPress developer, a performance engineer, and four-literate. Thank you. Let's give him a round of applause. Can everybody hear me again? Great. Thanks for coming. This is how to clean up WordPress database. I'm going to run this on my phone with magic. I'm not checking my Twitter. Don't worry. Okay. Too far. Okay. So I'm David Greenwald. Like he said, I'm from Portland, Oregon. You can check me out at DavidGreenwald.com or on GitHub. You're actually going to want to go take a look at that because I have some code examples that you can take home. You can see the things you can bring home to your database and run your own detective work. So here is a link to that, actually. If you want to check that out. And we're going to run through some examples, but this is a full list. So there's that link. These slides will be up online as well. So this is Passion of the Wife. This is a music blog run by my friend Jeff down in LA. This is a great site. He's been doing it for many years. He had a lot of readers. I think he gets about 100,000 unique visitors per month, something like that. So pretty good traffic. Not quite enough to break the internet. This was originally a Kim Kardashian photo, which we took out for copyright reasons, so this has to be imagined. But so with, you know, a few thousand visitors a day, most websites should be able to handle that. Jeff should not have been having any problems with this site. Instead, this site was crashing almost every day, and it was going on for years. This was a constant problem. So here's some of the things that he tried to do. He switched from this cheap share host to a faster BPS server. Not great. He thought he was being hacked. So he set up Cloudflare, set up DDoS protection and all that good stuff. Not super helpful. And he finally thought, oh, maybe it's the database. I don't know what that is, but I'm a music blogger, so I can feel that. And so he set up the WP Optimize plug-in and tried to think of the database. And this continued to not get great results. So eventually, I got in touch with Jeff and took a look at it, and we found out it was the database.  It was full of junk all left over from a Facebook share counter plug-in that he believed it in, like, 2013. And it had just left all of its stuff behind in his database for years. So before I cleaned it up, I had about 252 megabytes of stuff sitting in the options table of this database, and we'll talk about what that is, after two megabytes. So that's a lot better, obviously. And here's why this matters. So the options table saves all the settings for your WordPress site through plug-ins and for WordPress 4 as well. And so if you part of that are things that autoload, they load automatically with every page view, so that anyone coming to your site gets all the right settings. Some things only load conditionally when they're needed to, but a lot of stuff that's in this table is automatically loading. So every time someone is coming to a page of Jeff's site, they're getting all this data, there's 252 megabytes of data. So what would happen was, he would tweet a link to his site, five people would look at it, and it would overload his server, which had one gigabyte of ground. So that's not really the position that you want to be in where you can't have six people on your website. So what we can learn from Jeff's story is that database problems are sneaky. They're not the first thing that people are looking for. They're expensive. You're probably wanting to upgrade your server or your hosting because you think that's the real problem, which it cannot be. And it's bad for business and traffic because if your site is crashing, if it's slow, these are things that hurt you in Google results and they hurt you with your customers. So this is a problem that you can solve for your clients. It's going to be a big win for them financially and for you financially. So what is the WordPress database? Raise your hand if you think you sort of know what it does. That's great. That's awesome. That was better than the Portland Talk box. So all your WordPress content lives in the database. Basically, what happens is someone comes to your website. There was a great discussion of this in Zach's caching conference yesterday. He caught that. But somebody comes to your website and WordPress goes and talks to the database. He says, I need the information that goes on his blog post. The database says, here you go. WordPress feeds that into your theme and then it makes an HTML page to serve out to your visitor. So it basically looks like this. The docs WordPress. The ping is minus 2L and that tennis ball is your blog mode. So we need the doc to get the tennis ball to bring it back to you as a visitor to his website. So database queries, which is a search for this information, they take time and then they use data which fills up your RAM, fills up your server's memory. So we want to really optimize both of these. We want things to run fast. We want them to use as little data as possible so we can have lots of people come to our site and not crash on six people. So what is a database? Just to scale out a little bit. A database, every WordPress website has a database. They organize their data in tables. And those tables are basically, you can think of it as a spreadsheet. It's storing information in rows and columns. So the way that's set up in WordPress is your rows are for each individual item. So blog post one, blog post two, blog post three. Each one of those will be a row in your database. And then you have columns that break up those rows so you would have your post title, your post content, your post excerpt. So this is how the database organizes things. And here is what WordPress comes with. It's a whole bunch of tables. I'm just going to talk about a few. Posts, comments, users, those are pretty self-explanatory. Terms is where your categories and your tags live. Options, like we said, is where your settings are. All the settings across the site. And plugins like to dump a lot of things in there. Page builder tools that might come with your theme. We'll put a lot of stuff in there. And also, temporary data called transients can also live in that options table. So that's really the most important for performance and where we really want to look. The meta tables. Most tables come with a meta table. And what that means is if you're running advanced custom fields, if you're running a social media plugin, anything that would add new columns to your post table, instead of going into posts, that extra information goes into the meta table. So again, plugins that add extra information, that's all going to go into post meta. And those are the two tables that we are really looking for to see extra stuff generated in our database, so here are a couple of good database guides you can check out for a little bit more, deliciousbrains.com, premium.wpm.dev, if you want to get a little bit deeper on how this stuff works. So plugins also add their own tables. WorkVents is here this weekend. Thank you, WorkVents. We're from our sponsor. They add a bunch of tables to your database, so does Yoast, so does Reconverse. A lot of plugins you're probably using are adding tables to your database. They're really good because it means the information is organized, it's not sitting in your post meta table, so it's going to be better organized and a lot faster. But still, we have to make sure we're looking for bad actors and making sure that plugins are not adding extra data, bad data that we don't want on our side. So you might see, you notice that in our list of WordPress tables, they're all WP underscore. This is the default for WordPress. Your host might have to be different because it changes yourself, so that's what Reconverse is. So what actually causes database problems? A large number of rows and a large data size of the row content, like we saw with Jeff's site, where he has 250 megabytes of stuff. MySQL, the database software that we mostly all use, is really good at searching through thousands of rows. That is its job. So we can be less concerned with having a lot of rows and more concerned with the data. Let me show you how that works. If you have Pride and Prejudice in a blog post, that's going to be 700 kilobytes of information, whereas if you put my tweet in a blog post, that's .09. So if you have 5,000 blog posts and each one is Pride and Prejudice, we're going to have a much bigger database than if you had 5,000 tweets in your database. So we really want to be conscientious about the data that we're using. And another reason for that is not just performance, but also it's taking up room on your server, which you weren't paying for. If you have an account with a managed host like Flywheel or WP Engine, you are paying for every gigabyte of storage. It's not unlimited amount of space. And if you have somehow a database that balloons out to 250, 500 megabytes, you only have 5 gigabytes to use, that's something else to be aware of. Even if it's not causing a performance burden on your site, it's still taking up space. So we really want to be conscientious about that. So how can we tell if our database is slow? This is the fun part. So here's a couple tools that are very accessible. You can get more into New Relic and some other things that are high-end. But just to get started, these are great. ByteCheck.com, tools.bingdom.com, and GTmetrics. This is ByteCheck. And this gives you a measure of what's called Time to First Byte, which is how long it takes for someone to click on your website and for some other things to happen. And then for the work risk time to go talk to the database pig, get the tennis ball and bring it back to you and have the page ready to go. So we're looking for what's called the wait time, which is how long the server is doing that turnaround and actually getting the information to make the page. So in this example, 29 milliseconds, that's super good. You don't have a problem with this website. ByteCheck.com will give you more information. This is called the waterfall. This is a whole rundown of all the information, all the data that's floating on your web page. So the page itself and all your JavaScript, CSS. In that top bar, you can see it's broken into the steps of our Time to First Byte. And again, we want that yellow bar, the wait time. So we just want that little sliver to be really fast. So wait time is part of Time to First Byte. As you can see, they're in the waterfall. ByteCheck will break it out, but if you want to do more of a bigger speed test, you would use Bingdom or GT machines. So wait time should be, Google says it should be under 200 milliseconds. In real world scenarios, you can absolutely get it under 200. You can get it to 100. If you have, you're on a good server, you have a clean database. This is something you can very realistically shoot for. Something to remember is as your site scales and you have more traffic, that will put more strain on the server, more RAM or CPU, and so things will go slower. So you really want to make sure it is as fast as it can be before your server is under load and you're having a big traffic day, and all of a sudden you're going from 100 milliseconds to 300 to 500, so slow wait times can be caused by several factors. Your server, it can be old hardware, it might not be on a solid state drive, an old PHP version, a lot of us are still on 5.6 or 5.3, or who even knows, we should all be on 7.0 or better, or in a slow database. And so in Jeff's case, he had just moved over to a fast server, so we knew he was on, moved to Digital Ocean, so we knew he had a good server, he was on PHP 7.1, so no problems there. So when I was doing my speed test, you can do process of elimination, see, that slow wait time is probably because of the data space. So that's something to solve if you are on slower hosting, you definitely want to upgrade, it's not a lot of money, it's really worthwhile. And then you can do these tests and see if you think your database is going to be a problem. So caching is probably something that you have heard of, who's heard of caching? Raise your hands. If it's running on your website, that's great, you should absolutely do that. But caching is a band-aid for the database because what happens is the cache page is built from the database information, and then we skip right over it every single time after. So if you have a slow database and you're caching on, it's fine, you're never going to know until you do. So you always want to test with caching off, make sure you're really getting the correct results from the database and not from the cache. One more slide about that. Particularly, this is Zach's talk in one slide. Zach's talk from yesterday was great. Caching builds your HTML web pages once and then saves them for future use. So we don't have to talk about the database anymore. It makes wait time super fast because you are no longer doing that step. You're ready to go. But it is not a fix for dynamic pages and pages that have to be generated on the fly. So if you were a logged in user, if you were on the back end of your site, none of that's cached. If you have a site with thousands of pages that can't all be cached, I have one client who does have about 3,000 or 4,000 blog posts. And if you wanted to cache all of that, that's not something that would be very realistic. So if you do want to do some caching, if you're not using it, I like caching anywhere. I like WP Rocket. It's a great plugin. It's really easy to use. But again, this is not going to be a fix for all situations and we want to make sure we are testing our database and learning about it. And then for performance, we're going to be the opposite table because that's loading every time. The post meta table because that's where plugin data goes to die. And then also posts and comments can get out of hand. And of course, any plugin tables that get added really want to be policing. So here's some database detective tools that we can use to start getting into this. Some WordPress plugins we're going to look at. And also SQL. Ultimately, you have to write some code if you really want to get into advanced cleanup and do it yourself. No plugin can do it for you because you have to be the one to say, I think this is from this plugin that I don't use and I need to delete this specific thing. And let's find out how much information that that is using. And we're going to learn that today if we don't run out of time here. And you can also go on, you can do any of this in PHP My Admin. This is a MySQL tool that probably is on your server. It's certainly on a scene panel with a MySQL and you can do any of the same code. But you probably have PHP My Admin and you probably have another similar tool that you can use to interact with your database. You don't want to be doing this in the WordPress dashboard with a plugin because that leaves you really vulnerable to hacking and you want to be doing it with an outside tool. So before you do anything always backup your database because as soon as you delete something if you're not 100% sure what that's going to do you want to have your backup ready to go. I use WP MigrateDB. The plugin does have a pro version but works great free. It's super reliable. Just save your database, do something, save another copy, make sure you've got that database back up ready to go before you do anything. So here is a great tool called server status. This is a plugin that people are busy. And this can help us start to understand what is going on on our server if we don't have any information about it. I don't know if that's too small to see but it gives us some good information and as you can see here we have nine gigabytes of space on our server. We're only using 27 megabytes of our database so that's great. You might have a situation where you have a 2 gigabyte database and a 5 gigabyte server and that can tell you well it's time to clean the database we'll upgrade the server, get some more room so that's a great place to start just looking at the size of everything you can get your PHP version your MySQL version companies are rolling out 7.3 and 7.2 is supported by WordPress right now might not be supported by some of your older plugins but certainly most things should be ready for 7.0 at this time and you should be safe too after. So WP Optimize we talked a little bit about it doesn't solve every problem but it can solve some really easy ones that we can knock out. So when we look at this plugin this gives us basically some information about what they call rows and also the data size which is our megabytes that are being filled up by Facebook share counter plugins from 2013 that never got released. So this is a really great time to just use some common sense and say what are the biggest tables as far as rows, what are the biggest tables as far as data? I have 300 posts on my blog why do I have 30,000 rows in the post table or if you have an MP options table you really want that to be as small as possible it should just be one or two megabytes maybe about 500 rows WordPress comes with about 250 rows of built-in options and so once you start getting to 1,000 2,000, 5 megabytes, 10 megabytes 252 megabytes that's a time when you want to go in and really see what's going on. So we can use some common sense usually learn about our database to see what we need to start owning it up. So some things that the WP Optimize can do the first thing you want to do is clean your post revisions anytime you hit save or publish on a post or page in WordPress what that is doing is saving a version of that post which is awesome because with every version you've ever published on your site but if you have 5,000 Pride and Prejudice blog posts and you have 30 copies of each one you don't have a gigantic database so you should go in and clean every so often especially at an older site you really want to make sure you're cleaning that out and you don't have 5 years of drafts from your 5,000 blog posts that are all saved out that you don't need anymore you can clean out spam and trash comments that's a one-click thing that's great to do. One thing that this plugin does that you don't need to do anymore is clean out expired transients which is temporary data that can be generated by loop commerce sessions and things like that I might know actually through that F4 so we probably don't need to do that anymore and the other thing is checking the optimized database tables at the top and that will just empty the recycle bin basically and make sure you actually clean out your trash and you can get a clean database so this is spring cleaning basically you want to look in on this make sure you're doing it every so often but it's not going to solve advanced problems it's not going to delete old plugin data it does have a setting for orphan relationship data and orphan post meta data which means if you have a post it has some post meta data maybe somehow that post got deleted and it didn't delete its five rows of meta data so that's something you can clean out here but that's not going to be a major problem in general because WordPress does a good job of cleaning that stuff out and what this plugin cannot do is look at orphan data from its plugins so that's something that we have to do by hand which we're going to do in a couple of slides so advanced cleanup that humans have to do, I don't know if there are any advanced plugins which can do this so we're going to get into it right now we're going to look at the options table and post meta and of course plugins tables are also what we want to make sure we are keeping an eye on so what causes some problems bad actor plugins currently on your site which are just filling up your database you didn't even know abandoned data for old plugins that you haven't used since 2013 which are slowing your site to a crawl really want to make sure you get that stuff out and then another edge case I found is import data so if you brought your site over from Blogger in 2010 like I did I found all the stuff that was supposed to go into post which did also went into post meta so I had like an entire extra copy of my site sitting in post meta not a big deal but something that should be cleaned out that doesn't need to be in your database so a lot of these issues are for older sites if you have a site that's been around for a few years you have more older information older code from the WordPress was not as wonderful as it is now of course older plugins you probably used a lot of different plugins and deleted them so if you have a site that's two months old you're not going to have a lot of these problems if your client's site is five years, eight years old these are things that you really want to go through and be looking for so facts only most serious database issues are because of plugins so that's what we want to focus on if you're running 20 different plugins on your site your client has all this stuff that's been sitting there since 2012 they don't know what it is we really need to go on and see what's going on so some problem plugins to watch out for social media share counters anything that is saving data for every post on your site that's a whole one row on your database for every single post popular post counters same kind of thing they might be saving all the popular posts from every day for as long as you've been running the counters you might have five years of data sitting there WordFence keeps a live log of every IP address that hits your website as part of its security measures you don't need that live traffic on turn that off and you will not be writing to your database and storing all that extra information and then search program search plugins like relevancy that creates a database in your database so that you can have more stuff indexed and better search results that's really great but it also takes up a lot of space so I'm not saying not to use these things I'm saying make sure you're aware of what kind of load these plugins are having on your site maybe you do need to upgrade your server so you can use the plugins you want to and just be aware of what's going on in there so something really important to do is vet your plugins WordFence is a great example because what that does is you have to go all the way through the 5000 options and check a box that says please delete my database stuff all my information when you delete this plugin if you don't do it it leaves its tables in your database forever and that's something that you have to go in and turn on it is not a default so you really want to go through the options of your plugins make sure you are checking that box so it doesn't leave stuff behind you want to do a test delete and see if it doesn't have that option if it is going to take it stuff with it I think WP Optimize I'm pretty sure it doesn't actually clean up after itself and it will leave a couple of rows in your database which is hilarious because there's a clean up plugin I'm not 100% sure it still does that but it did before so these are plugins that you are going to be using on these sites for years so it's worth it to take 15 minutes put it on a test site make sure you know what it's doing and you give it a good examination before you actually give it to the client and get going on your site so let's do some actual painting our goals today our mission if you choose to accept it we want to get the options table under 500 rows if we can under 2 megabytes auto loading and then we want to drill down into any other big tables with SQL queries and find the jump database table find the jump plugin data and get rid of it so it's not taking out memory taking up space we can be using for faster results so this is an SQL query and we do have some time so we are going to try to teach you all a little bit of SQL this is written SQL before that's amazing I was expecting 0.7 so basically the magic of getting into your database is the second function here we have our select statements so we are going to do a search we are going to count everything as an auto load row count so we are going to count all the rows in the options table that are auto loading and then this big thing that takes up a bunch of lines here round sum, length and cap what we are doing in there is getting we are adding up all the data and then we are going to get that data for the rows that we are looking at so you can apply this function to any table in the database you just have to change the columns so in case the meta tables say the options table has option ID option name and a meta table would have a different list same for the post tables but all you have to do is put in your the column names of the table so you can get the total information the total megabyte data you can do our where auto load equals yes so we are going to run this slide we are going to switch over to the computer so I use MAC to do my local development that comes with phd myadmin any tool is going to give you a pretty similar setup but basically this is a database the client database as you can see it has 5 million tables in here from all the plugins that they have been using so this is a good way to get started you can say am I using rg the prefix is where you are going to get the information on what plugin this is and sometimes you have to do some googling but if you know what tables are supposed to be there already you can look in and say ect that is not something that goes before press oh I know that is an image plugin so you can look and see what are the extra tables that are getting added to your database and if you did your vetting you already know but if you see anything in here or you can back up your database and then you can just delete it and you save yourself that space so if this site was no longer using the EWWW plugin you can just check this box and go all the way down to the bottom keep scrolling all the way down and then with that selected table we can just hit drop and delete it and then it is gone so again, back it up before you start dropping tables you don't want to break anybody's budget so that is the first thing that we can do and we can also can you really see can you make this a little bigger we can see how many rows we have we can see what the size is so if we do the number of rows here we have 400,000 rows in post meta so there is a lot of plugin junk in there that we can probably get rid of and then we can see here top 10 daily top 10 is a plugin that this site is using and I happen to know that they have some settings to say cap the data at 30 days and then clear it out if you don't do that it stores it forever which is why we have 100,000 rows instead of 20,000 so you can look at this and start to see where the problems are you can look at the size and again this is where I really want to look so we have 68 megabytes of stuff in posts we have already cleaned out and for this particular site and other revisions are cleaned and you can't do a lot about this table you're post your content you can't have less content on your website so that's something you have to live with and we just have to clean everything out around it so let's do some code on this and see what's going on in here and I definitely do not have this all memorized so we're going to copy pay a little bit and then I'm going to explain what I'm doing so let's get a look here and so you would click the SQL tab so you can write actual code in here and so what we're going to do here is select account and this is going to be the name of your information so you know like this from the WP options table in this case they use a different prefix so we actually have to change our SQL here so when you take these home make sure you are matching it to the actual prefix on your site so we're just going to do iu j a k b o and we're going to look for anything that matches transient so if you use the light keyword in your query that means it's not going to do an exact match but it's going to look for a parcel match so that allows us to look for keywords for terms within our information so we'll go on that we have exactly one auto loading transient in the options table so this options table is clean that's great if you get 2,000 rows then it's time to go in and probably delete some of those and figure out what is generating those transients it's probably WooCommerce it's probably an old plugin so let's find something a little bit more interesting on the site let's go into the options table and see what's going on here so we can just hit browse here and a great way to get started is just to look at the database just put it out to a couple hundred rows and I know that the options table starts with about 250 rows so you can scroll down and see what's on the next page so here we have WPSCO site map and again we're looking at the prefix here in this option name so I know WPSCO that's not WordPress that's something to plug in at it you can keep going down and here we get ECPT that's from a plugin TubePress that sounds like a plugin also so again this is like where you have to do it yourself and Google is your friend trying to figure out what plugin and what data do I need it anymore this can't really be automated you have to go in and look at it and make some decisions and here is Pyre and I think that's from a page builder so let's check that out let's see what information we can get about Pyre so I'm going to go back to SQL around this query and we can just hit go so we have 45 rows from this Pyre plugin and so if we're not using that anymore and we want to delete them we can just switch that over from a select statement which is a search statement delete statement SQL and something to do first is always run the select first don't delete something without knowing what you're deleting so we did our search we know exactly what we're going to get rid of we can hit simulate make sure we're getting the right thing match rows 45 that's what we got in our previous test so that's great let's just delete it from this database why not do you really want to do it? sure we're ready to go we're going to get the 45 rows from our database so let's go into post meta because that is a little bit trickier and here this is where we have 400,000 rows and one thing we can do in here post meta gives you the meta key so in the options table every option is going to have different value because each one is one option whereas in post meta everyone is going to be a particular core value that goes on every post so if you have this underscore wp attached file which might be the picture the feature damage or something like that every post is going to have a meta key with wp attached file and the value will change so if you have 5000 posts you would have 5000 at this particular key so what we can do is see what are the top meta keys what meta keys are taking up space and that will tell us what plugins are causing us problems so we are going to use this gigantic statement over here so what we are doing here is we are doing a search of meta keys we are going to count them we are going to get a sum of all the data by using the column names all of them can be measured here we are going to group them by the meta keys we are going to get an order list we are going to order them by the size and the descending order and then we are going to limit that to 10 because otherwise it is going to give you when you are doing these kinds of searches to put in a limit so that your database is not just spinning over and over you can see with the top 5, top 10 that is where all your problems are going to be anyway you are not going to have 20 different things that are all causing a problem, we can hope usually it is one or two plugins that is going to be 80% of your problem and you can just get rid of them so let's see what information we get here that is bad so we got an error because let's get rid of that well this didn't work, this is the dangerous line you know what we can do is I have a pet code on my and we can grab that directly and I know that will work so this is the the GitHub repository, that's me sorry about that so you can go out here and get all the information that we are discussing down here to post meta and get this information and so we are going to go back up here into let's just go back up here into the database in SQL and again I am going to change the prefix from wp to and we will see what this gives us hopefully this one works so this is great because if you plug that in then you get a chart of what the biggest meta keys are so here we have wp attachment meta data the underscore wp that means it's WordPress wp attached file so we would expect to have a lot of information for those because WordPress makes that into every page but SEO smart cache that's from a plugin, that's something else same thing with radium post views count, radium is not WordPress, that's a plugin so what we can do here is say these are the top 10 things that are taking up space in our database, I know this is a plugin I am not using it anymore, I want to lead it so you can go ahead and get rid of radium clear those 14,000 rows and what you can do there is a really simple statement and you can just go back to SQL and hit just delete from the table where the meta key is that all you have to do, let's see so that's going to give us 14,000 like we saw before so we know we are leading the right thing this is safe to do yes we're sure please don't break our site and it will delete those 14,000 lines so this is basically what you want to do is you want to get your rank list and everything that's going on here and figure out what's from plugins I am not using anymore and same thing with the options table figure out what's the plug, what can I get rid of and that's basically how to clean up your options table and you can customize these queries and really get a lot of good information and that's the end of my talk and I can take some questions now we went from 0 to 60 on this talk so I hope you can all take away a really good theoretical basis for how this stuff works and then get a few applications this might not have a lot to do with your talk but with the MyISM and NodV tables what's your thinking of those going forward well, so I'm not an expert on it but WordPress does use NodV as the default WordPress, I think 4.4 on just in my NodV experience it is a little bit faster and it gives you some benefits as far as being able to back up with transactional stuff and have safer backups so yeah definitely using the more modern version and I think that's going to be the default on any new WordPress site you're setting up and generally it is pretty safe to convert if you're on MySQL 5.6 so as always take a backup and change all the tables make sure you just break anything so I would definitely go ahead and modernize that so I'm wondering about moving a site to be internationalized if you have something with the default encoding and you want to convert it to UTF-8 are there good commands you could use to can you do that with just SQL or do you have to do some custom PHP code plus SQL to convert your entire database no you can absolutely do it in SQL and you can switch from UTF-8 to UTF-8 M4 or whatever you want yeah it's just a command and I think you do have to go table by table because I just did this the other day it was a little bit aggravating you can actually just go in in MySQL here and you can go over to go into your table and hit operations and you can just switch that over in the storage engine bring in the collation and you can put that over into you know whichever one of these you want to use and then you just hit go and you're all done so you can just do it that way there is some codes to do it which I don't know and you can certainly just do it with a couple lines of code and just the thing to watch there that I've run into is if you have different versions of MySQL that you're moving between 5.5, 5.6 for instance 5.6 is not friendly with some of the new UTF-8 or 5.5 is not friendly with some of the M4 versions so just make sure you're saving everything everywhere make sure everything actually works in the right environment when you're moving things around and just go in there I was just wondering if you know of a good plugin or easy method for routinely dumping revisions like I have a site where there's a lot of editorial process that happens to publish but then when they're published revisions aren't really needed anymore so something that like just doesn't have a regular job or process just a good plugin for that or is that easiest to do with the WordPress schedule tasks in MySQL? Yeah, you know there's a couple ways to deal with that one is that you can set the amount of revisions in WP conflict so you can set it to zero and not have any you can set it to three that's one problem so that's one thing to just limit it from there as far as clearing it, I don't know if there is a plugin that automatically quizzes but what you could do is just write out the SQL to delete revisions and just run it like with a cron job every day or every week or whatever it is or you could go in with WP Optimize and just check that box and just do it once a week To delete the last week or the last two weeks for revisions also Okay, so that's great I think it's in like the advanced settings it's not, we just click the bottom on the home page and then they will delete all of them and you can set it to a week or two and then some of the other data is cleaning apps will do that or plugins will do that to let you set like how many days or how many, how many so it's a solve problem in a number of plugins Excellent, and you could write a query that just says look for stuff in the last, that's older than DateX and all that stuff But yeah, that's great, that's a excellent plugin to use anymore, I'll set Alright, good luck cleaning your databases Thanks everybody