How to Fix Jenkins slowness when Running in AWS EC2 | Jenkins Slowness Fix when using AWS free-tier

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome back let's say that you have configured Jenkins in AWS cloud and you're using AWS free tire account and you're not using elastic IP address so every time you stop your genkins ec2 instance and then start your genkins is really acting up it is taking a lot of time uh even for UI to come up so how do you fix that that's exactly what we are going to learn in this short video so what is the root cause of this issue so as you all know that if you're using AWS free tire account they would not give you um elastic IP address isn't it so every time you stop your ec2 instance and then restart the IP address would actually change so due to this issue whenever you're trying to bring up genkins it would try to access in the background the old URL so the old URL did not exist isn't it so that is the reason why it would take a lot of time for enkin UI to come up okay so what we are going to do is we are going to learn how to actually fix the tisue you can do it in two different ways you can make changes through a command line or you can also make changes using UI so how do you do it through a command line all you have to do is you need to navigate to the Jenkin installation directory so this is the genkin installation directory especially if you have configured on wub to machine so once you navigate to this particular directory you need to look for this particular file okay and then open this file and then change the Jenkins URL as per your current URL and then make sure you restart the genkin service so that's it right so just three steps so navigate to the genkins installation directory open up this particular file and then modify your Jenkins URL as per the current URL and then restart the genkin service boom right your genkin should perform really well so the second option is you can also navigate to manage genkins and then system configuration and then you need to change the genkins url like that okay but again uh if you're going with a second option so you already have your genkins you know uh performing slow right so it would take a lot of time for you to navigate to here navigate to here and then you know make changes okay so I would prefer making changes through a command line okay so let's see how we can fix this right so if you see here I have already configured genkins on one of my ec2 instance because obviously right so that is a prerequisite so guys I just want to uh clarify uh this is purely if you're using AWS free tire account and your genkin is not really coming up this is not a recommendation for uh you know if you're already set up genkins in your you know if you're already using elastic IP address um you know if if your genkins is performing really slow it could be for some other reason okay so you might you might want to you might want to fine-tune your jvm you know configuration or anything like that okay so this solution talks about only if you have configured genkins on free tire account okay so great so this is my AWS console so this is my genkin cc2 instance I have already configured um so let's try to bring up so we already know that whenever you have this kind of a scenario your Jenkins is going to act extremely slow right so we are going to see that and then we are going to fix it right away so it would take a few seconds for Jenkins to come up anyway so let's see okay so Jenkins is up and running now uh let me pick up the public public DNS name go to browser 8080 wow I know it's going to take a lot of time for Jenkins UI to come up so we know the issue right so you all seeing it yourself I'm trying to refresh so you can literally see here it's trying to come up but it's trying to access the old URL somewhere in the background so that's the reason why it would not come so let's quickly fix this right so like I said uh let's try to fix this by accessing genkins through a command line okay so I'm going to log into Jenkins through a command line so I have already set up my keys and everything uh in my local machine so let me copy the URL I'm going to access through my git bash okay so there you go so I lock into genkins through a command line so we need to navigate to the genkins installation directory so generally speaking this is the genkin installation directory on a wub to machine so perfect and then we just need to navigate to this particular uh file right we just need to access this file so we can first see whether the file exists so obviously right I mean there are bunch of XML files would be there okay and then one of the file would be this one there you go so the file exist so all we have to do is we just need to edit the file so I'm going to put sudo Nano or VA editor whatever your favorite editor is there you go so now let's try to see the Jenkins URL right so you can clearly see here so this is a DNS name 52 160 234 91 there you go you see here right so that's exactly what I'm talking about so this is the current URL so now the genkins UI came up but again it took pretty much one to two minutes or even longer to bring up the UI but anyway so what I'm going to do I'm going to copy the this is the updated URL I'm going to copy that so let's try to change that over here so I'm removing the old URL so that is a new URL let me make sure okay there you go so this is a new URL perfect so let me save and come out of it so control o enter for saving and then control X there you go perfect and if you want you can also verify that there you go the URL got changed 109 is sending 109 perfect okay so let me come out of it so all we have to do is just restart the genkin service so how do you do that you're going to say pseudo service genkins restart that's it so it's going to take few seconds since we made some configuration changes in the XML file so so that's the reason why we have to restart the genkin service and then if you want to make sure that the service is up and running you can also say status there you go and press Q to come out of it perfect okay so now if I go back here all I have to do is just refresh wow so let's try to log in wow do you all see the difference guys it came up immediately right so the second way is so I know the genkins UI is really coming up now but let's say say you know if you have to change through the UI let's say you didn't like the CLA part of it you wanted to change through genkins UI so this is where you would come and change it right so there you go okay since we have already changed through a command line so both are both are in sync okay but if you already have the old URL here uh you might want to put the latest URL by copying from here and then replacing that over here and then click on apply and Save all right I hope this was really useful for you guys especially uh if you're new to uh Jenkins if you're new to AWS Cloud you are just learning genkins and then if you stumble upon this particular issue so this is how you would overcome that isue awesome guys so thank you for watching this video
Info
Channel: DevOps Coach
Views: 463
Rating: undefined out of 5
Keywords:
Id: j5OyyeB-sKQ
Channel Id: undefined
Length: 8min 19sec (499 seconds)
Published: Sun Apr 21 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.