cPanel LIVE! Get started with NGINX Caching featuring Adam Wien
cPanel LIVE! Get started with NGINX Caching featuring Adam Wien
and welcome to another cpanel live i'm your host jason nickerson and in today's broadcast we'll be talking about nginx caching with cpanel product owner adam wein today we're broadcasting live on cpanel live facebook twitch and youtube we'll be taking your questions after the presentation so please start getting your questions ready to share in the chat so now let's hand it over to adam and find out more about web server caching and nginx good afternoon everyone for those who don't know me my name is adam weed i'm a product owner at cpanel currently assigned to easy apache i've been with the easy apache team for four years and with cpanel for 17. our most recent feature was to add a caching layer for use with easy apache to do this we used engine x for those that aren't familiar with nginx it's a web server that also has the ability to act as a reverse proxy for use with other web servers to speed up their ability to serve content what does this mean for you for you it means lower system resources being used to serve websites and for your customers faster loading times for those websites in previous cp livestocks i've spoken about nginx standalone in standalone mode nginx will serve websites directly to the end user in this talk i'll be speaking only about reverse proxy mode in this mode engine x relies heavily on another web server to generate the content that it then serves to the end user in our case that web server is apache first i'd like to go over the user the experience for those customers on version 94 of our software that's the version currently in our released here in this version you'll use easy apache to install nginx and it will set up caching for all users on the system we've provided some command line features so you can still receive all the benefits of caching without the same user experience as in our upcoming version version 96 so before i start let me apologize i am using a mechanical keyboard yes i'm that guy so first thing you want to do is log into whm those customers on version 96 will be presented with this feature showcase option to set up nginx with reverse burst proxy caching we're just going to exit to whm while i am on version 96 the steps i'm about to show will work for any supported version of cpanel mainly version 94. so the first thing we want to do is we want to navigate over to easy apache we're going to customize our currently provisioned profile we're going to come down to additional packages see here nginx we're going to choose engine x click next and then provision so if you've been to my previous talks about standalone you you know what's happening here right now we're moving apache to a non-default port 81 and 444 in my in my case and we're standing up nginx in its place so now that the position provision process is complete enginex is stood up and caching is enabled for all users on this system so like i said we provide some command line utilities for using nginx on version 94. let me show you those now for this we're going to come over to our terminal application we're going to call slash scripts ea gen x so if you've used engine x previously or our implementation of it this should look very familiar to you but there is a couple new commands we have cache and we have clear cache what cache does it allows you to interact with the overall system when it comes to caching and also the individual user when it comes to caching so uh we'll call it real quick with the system flag and this is the global settings for nginx uh you can modify these not on the command line but there's a um a json file you can modify to change these settings i think it's somewhere and that's somewhere in here okay so there is cash.json so you can modify things like enabling disable caching globally you can change the cache times you can turn on x headers things like that but we've automated a couple of steps for you so let's say you want to disable caching system-wide you can do that via the command line utility so we call cash with the global system flag enabled equals zero so now when we call that cache command again you can see that nginx caching is now disabled so let's enable that so you can also interact on a per user basis with this so i think i have one user set up on this system we can disable caching this way for a specific user so now for that globally nginx caching is enabled but for that uh user it's disabled so one of the things we added to version 94 is a little breadcrumb for the end user so they can actually see if n2x caching is enabled or disabled on their user so let me show you what that looks like we're going to come over to list accounts we're going to masquerade as a cpanel user and over here on the right under general information you'll see nginx caching is inactive so we're going to come back to our terminal and we're going to enable it for that user same command just enabled equals one back over to cpanel we'll reload this page and as you can see nginx caching is now active right there so that's how you turn caching on and off let's say we a user has contacted you and they're having an issue and you think they have a stale cash or a bad cash for for their account we've given you tools so you can actually clear their cash you can use the all flag the all flag is going to clear cache for every user on the system or you can provide the username let's see what was that username again and now just that user's cache is cleared so that's what it looks like on version 94. for 96 we've actually introduced a ui to help customers perform this perform these tasks so we're going to reset our system back to the way it was before we started we're again going to customize our installed profile come down to additional packages uncheck engine x and again provision so now we're removing engine x from the system uh just like before where we're uninstalling nginx and putting apache in its place so now that that's complete our our system is restored to it was before we even got started so in version 96 we've introduced a ui for our customers to perform these tasks it's called the nginx manager so when you click on nginx manager it prevents you it presents you with this splash screen and it lets you know what's going to happen when you install nginx so we're going to click install this should look familiar it's just like easy apache for but we put it in one convenient place so everything internet related will be in this interface and that's it nginx is set up in reverse proxy with caching for all users on the system so now we're going to proceed to the nginx manager so you should be able to perform everything i demonstrated on command line through this easy to use ui we can clear cache for all users we can restart nginx we can rebuild its configuration or reset users to the system default so to jump ahead a little bit when you come over to the users tab you can enable and disable caching on a per user basis if you have not made a modification to enable or disable cache for this user you can then reset users to use the system default so now all users will be reset to enabled or disabled but back to that user settings tab so here again we can enable or disable caching on a per user basis and we can also clear cache for uh for each individual user i only have one user on the system but if it here would be listed all of your accounts if you have more than one we also give you the opportunity to uninstall nginx so say you've nginx has introduced some kind of incompatibility with your system you can uninstall it from here too so these are the tools we've provided to work with nginx so what are some of the benefits so a customer has turned me on to a piece of software called seat siege does exactly what it sounds like it puts your server under siege it's a it's a benchmarking slash regression testing regression testing software so if you've made changes you can rerun siege and see if you've it's improved your site's performance or caused a detriment to performance so i have about 150 wordpress sites set up on this server so let me choose one okay so we're going to put this wordpress site under siege first i want to ensure that nginx caching is disabled so you can see what kind of performance we're getting out of the box so we'll just come over here go to our user settings and disable caching and now we'll run our test uh so what this is is it's 50 concurrent users so this is 50 users accessing your one site and we're going to run our test for 10 seconds 10 seconds should be enough to to show the difference so as you can see with internet caching disabled we were able to do 1759 hits and 188 transactions per second with caching disabled this is the faulty panel out of the box so let's enable caching and see if we see an improvement come back to our users tab and then enable come back here and we'll rerun our test so as you can see we've seen quite an improvement um that looks like what over three times the hits and it looks like we've over tripled our transactions per second and the cool thing about caching the more you run this and the more things you have in your cache the faster this will this will get so that that's great that's what it looks like for a single site what does it look like for a busy server one of the cool things about cs is you can actually provide it with a url list and give it you know 50 100 1 000 websites on the single server to test with so let's try that again we're going to go back to our baseline where we disable caching and now rather than a single url we're going to give it a url list this is 50 randomly generated wordpress sites as you can see so we're going to run suits this way again 10 seconds is usually enough to give us a good barometer on how our performance is okay we were able to do 1400 hits and about 155 transactions per second let's see what that looks like with caching enabled enable caching and we run our test so as you can see our results are pretty similar we were able to triple our transactions and we were able to uh um triple our transaction rate um and this is at this is at scale this is 50 websites hit it being hit by 50 users for for 10 seconds as you can see the numbers really speak for themselves while website caching isn't new a cpanel supported caching layer built into easy apache is if you have any questions please stick around for the question and answer portion of today's cpanel live or email me directly adam at cpanel.net [Music] i'm sorry about that friends uh we've had a very interesting day today here with uh battling technical difficulties but we're on top of it so uh just uh i'm sure you're used to that though um unmute i'm sure everybody is in zoom calls and forgets to unmute occasionally so that's per par for today um so what i was saying was wow that was really great adam um it looks like we've got it down to a one click installation yeah that's after that right yeah and after that it's one click for everything one click clear the cache one click this and that you know that's that's really i think where this whole industry is going now is um automation ease of use and anybody can do it you know and that's what our customers are really looking for i think so that was a really really great to see that coming um so if you have any questions for adam please start posting them in the chat on facebook twitch or youtube and before we get started with your questions i'd like to share some of the latest cp news so as adam was saying um version 96 is coming and it has some nice features including the nginx caching activesync and alma linux and speaking of alma linux we just announced in our blog that we will be supporting amalytics in version 94 and 96 moving forward as a replacement for cent os i'm going to share that blog link now if you'd like to read more about what we're doing and when to expect all the linux to come in and we have a another update to um our cpanel live survey sweepstakes so every cpanel live we've been giving you guys the chance to win something with our survey and everybody everybody's asking us what happened to our cpanel swag because we went to a format of giving away some gift cards so we're happy to report that the cpanel swag has returned and it's easier than ever to get your hands on it um we've changed our terms and so now the first 20 people to fill out our survey will get a chance to spin the new cpanel lucky will wheel to take home some cool cpanel swag and everyone who's registered for this broadcast will receive an email with the survey link in it so make sure to register for all the upcoming cpanel lives and you have a chance still if you haven't registered yet go to cpanel.live and register today before this session is over and you'll be entered to get that survey link and a chance to win some cool cpanel swag and coming up next month uh we have a really special cpanel live um i'm happy to announce our next cpanel live is going to be april 22nd and feature a discussion about mail node and this is going to be really special we have some special guests and i think you're all going to want to check this out because it's some new features coming out in cpanel and something that's very interesting so if you haven't subscribed to cpanel.live yet make sure to sign up today at www.cpanel.live sign up for the notifications for our email list so you'll know when we open the registration for next month as well we have something coming up big next week if you've never been to cloudfest in germany now's your chance to do it virtually you can join cpanel and our partners at cloudfest 2021 online cloudfest is the world's largest cloud computing and hosting conference and it goes online next week for three days of keynotes sessions networking and as the name says festival style parties so you can register today at cloudfest.com or you can click this link that we're sharing right now and you can get free tickets courtesy of cpanel so let's see do how do we have some questions for us now because i i do have a question for you adam but um we can throw that out in a minute here and see what we've got so looking at this is there any plans to add this into the customer cpanel to allow them to disable and enable it themselves that's something i was wondering yeah i mean of course that that's always the the eventual progression of our features is give it access to the admin and then let that come down to the end user so the answer to your question is yes uh when that comes i'm not really sure hopefully by the next lts but uh we'll see how that goes yeah okay so um are there any other caching solutions that we're suggesting that people use i mean other other than our own the one i just showed well um i mean sure the uh the one that lightspeed ships i hear is really great uh the wordpress integration for lightspeed i i hear is wonderful so i'm pretty sure we can make that recommendation fantastic so how does the improved performance compare against the light speed options that we provide for websites such as wordpress is there a comparison available i i have not made that comparison uh but of course just uh follow the steps i i showed in the uh the demo and and you could run those numbers yourself um i think you can use lightspeed for free under a certain amount of memory or certain amount of domains i'm not real positive so speaking to 94 uh uh as with nginx like i know that the nginx manager is coming in 96 but we did provide those command line utilities for people on 94 because we know a lot of customers like to stick to that lts and get that long-term support but those customers on 94 and on lts will still get the full functionality of nginx with caching can we get a copy of this video of course you can just go after the broadcast go to our youtube page or our twitch page or our facebook and you can re-watch the broadcast and all these broadcasts are available on cpanel.live under the past events we've shared all the youtube links there with the youtube videos and i guess that kind of brings me to one of my questions adam is uh this is a this is server side caching right um can you talk a little bit about you know the whole caching structure for maybe somebody who doesn't know the the different levels of caching that take place getting to the browser so like you said this is server side caching uh there there's other types of caching like cloudflare uh offers caching there's companies like um akamai if you remember them um that that provides cdn type caching that get your your data as close to the end user as possible but our implementation is very much server-side on the server we want you to be able to control that cache and control your data and and who has access to it and so um would you get better performance out of cash or is it just overkill like let's say i have a wordpress site and i'm using some kind of speed cache or a caching plug-in that does the caching and then i've got you know i'm using cloudflare and then i add another layer with um nginx would would i be able to do that add two layers nginx and cloudflare oh sure yeah we actually worked a little bit to ensure the cloudflare worked with our nginx implementation so i mean as long as nothing as long as you don't have any incompatibilities between these different caching services there's really no reason you shouldn't be able to use multiple levels of caching nice and so that does work to provide even faster it's not just overkill yeah and i think we have a few more questions if you're if you have your own server environment running apache does the upgrade uh for nginx work live yes uh so um cpanel has really good support for running apache on a non-default port so really all we're doing is moving apache to a non-default port and putting enginex in its place this is actually a non-destructive change so if you set up nginx and you decide to don't like it just uninstall it you'll go right back to it patching no problem so if most websites on a server are not using wordpress will it work of course it will yeah uh so i know wordpress is is the hotness right now and everybody wants faster wordpress but uh this this works for all domains um all your all your static content should be cached by nginx it works with joomla and drupal all the really content management system doesn't matter it's just it's server side so it doesn't matter what tool you use it just does it for that that's right all static content your website is serving should be cached if you cluster cpanel do all hosts have to run nginx um so i'm not sure of what type of cluster clustering you're talking about uh but probably not um like i said the um the experience with nginx and with apache should be exactly the same other than the speed element you know so it really shouldn't matter you should be able to mix and match a different web servers okay here's a long one we previously rolled out into drawn previously so i can confirm it does speed up a website a lot the added benefit if you guys supporting it would be user control for sure would you be considering a plug-in for the major cms's like wordpress i don't think we're really in the plug-in state are we um at this point we do it on the server side uh so i'm um like we said previously i'm the easy apache uh product owner so i i provide the the nginx service i'm not really the wordpress product owner uh so i don't know if that's on their roadmap but you never know exactly and since this is i mean we have wordpress toolkit now that might there might be some caching layer added to that or something but just to make it out of the box were a free wordpress plugin that to work with it it's that doesn't really that's not server-side caching does the nginx been enabled to use the remote ip feature to allow passing through of the external ip uh i think i know what you're talking about and yes um but again if you could email me uh uh away from this talk and we'll we'll talk and we'll try to drill down on what you're trying to ask all right and we have some more questions coming i did want to remind everybody that we have changed our survey sweepstakes to uh giveaway so if you have registered for this cpanel live or for some upcoming ones you're going to get a survey link by email after the broadcast is over and please check your spam if you signed up for that because some things go to spam if you want to get that survey link for a chance to win some cool cpanel swag and let's see we're rolling up on about 30 minutes here so we're going to give it about one or two more minutes and see if we get some more questions because uh this was a very a good demonstration of how easy this is to turn on and off i was laughing with adam beforehand saying i wonder how many questions we're going to get all we what we really added is a a great little thing it's a on and off switch so thanks everybody for your great questions that's always our hope to to automate this stuff and make it as easy as possible for everybody to use and i think we have another question and that looks like it's a um looks like it's an obvious one that we didn't point out that i think we were talking about earlier i think it was before that this one but we'll answer this one and um hey lucas how you doing we're gonna we're gonna bump you um real quick because we we know we we know lucas uh personally so we'll bump him real quick sorry lucas um can we get a trial of nginx or do we have to purchase it so um i know the answer i'll let adam explain uh it comes with easy apache so it's part of your base license price um it should be available to all customers that are using easy apache with cpanel and if the nginx project is a open source free product right yep and yeah we we in our industry really love the the open source communities and what they do we rely on a lot of that stuff and it's really great uh so that might be worth mentioning to the point of running plugs inside of cms is to do more intelligent caching on the server side you really can't make a proper caching solution without being able to control that you're absolutely right i don't think that was a question from lucas i think he was just you know chiming in and letting us know that you know the intelligent side of caching on the server side all right so um i think this has been a really great cpanel live and we've shared a lot of good information on here so uh we'll go ahead and come to a close so again i want to thank everybody for the great questions and i you know want to take one moment to remind you to uh about our updated sweepstakes that we're doing for some cool swag and to register for the upcoming event that is taking place on april the 22nd cpanel live and come visit our booth and check out our talks at cloudfest and we'll share the the link for cloudfest again for any of you that uh haven't uh joined that and we'll see you next time and hopefully we'll see at cloudfest and thank you adam it was really a fun talk today and thanks again everybody for the great questions thanks everybody