How to Fix 503 Service Unavailable Error: 7 Steps That Work

文章推薦指數: 80 %
投票人數:10人

The 503 service unavailable error can happen due to connectivity issues between the server chain hosting your application. Thus, if you have root access to your ... WordPress VPS Joomla! Drupal Email Glossary VideoTutorials Webinars search Copylink Copied! Errors May26,2022 NabillaR.&FreddyM. 8minRead HowtoFix503ServiceUnavailableError:7StepsThatWork Copylink Copied! Everytimevisitorsaccessawebsite,thewebbrowsersendsarequesttothewebserver.Sometimes,insteadofcomplyingwiththerequest,theserversendsablankpagewithanHTTPstatuscode.Thisindicatesanerror. DownloadeBook:BuildYourFirstWebsitein9EasySteps Don’tworry,however–mostsitesexperienceerrorsatleastonceintheirlifetime.The503serviceunavailableerrorisoneofthemostfrequentlyencounteredproblems.WebserversreturntheHTTP503errorwhenevertheyareunabletoprocessarequest. Likeanyserverissues,the503serviceunavailableerrorcannegativelyimpactasitewhenleftunsolved.Thus,thisguidewilldiveintothepossiblecausesofthiserrorandhowtofixiteffectively. First,let’sstartwithwhatexactlythe503serviceunavailableerroris. Errorcode503serviceunavailableerrorErrortypeServer-sideerrorErrorvariations503ServiceUnavailableError503ServiceUnavailable503ServiceTemporarilyUnavailableHTTPError503HTTPSError503HTTPServerError503HTTPError503.Theserviceisunavailable.Theserveristemporarilyunabletoserviceyourrequestduetomaintenancedowntimeorcapacityproblems.Pleasetryagainlater.ErrorcausesResourceusageexhaustionServercommunicationproblemsSuddentrafficspikesDistributedDenialofService(DDoS)attackIncorrectDNSconfigurationPluginorthemeincompatibility WhatIs503ServiceUnavailableErrorandWhatCausesIt?7StepstoFindRootCauseandResolvethe503Error:1.CheckResourceUsage2.CheckforOngoingMaintenance3.StopRunningProcesses4.ResetFirewall5.CheckServerLogsandFixtheCode6.RestartYourServerandNetworkingEquipment7.CheckYourDNSTroubleshootingOther5xxErrors WhatIs503ServiceUnavailableErrorandWhatCausesIt? WebbrowsersandwebserversinteractusingtheHTTP(HypertextTransferProtocol)statuscodes. Wheneveryouaccessawebsite,yourbrowsersendsrequeststothewebserverhostingthecontent.ThewebserverthenfetchestherequestedresourcesalongwithanHTTPresponsestatuscode. Herearethefiveserverresponsecodes: 1xx–informational2xx–success3xx–redirection4xx–client-sideerror5xx–server-sideerror Usually,theserversonlysendbacktherequestedwebsiteandbrowsersdon’tdisplayHTTPstatuscodes,indicatingthattheconnectionissuccessful.However,wheneveranerroroccurs,theserverswillforwardanerrormessagealongwiththeerrorcode. The503serviceunavailableerrorisoneamongtheseerrorcodes.It’scommonandhappensontheserverside,showingthattheservertemporarilycannothandletherequest. BelowarethemostcommonwaystheHTTPerror503messagescanappearin: 503ServiceUnavailableError503ServiceUnavailable503ServiceTemporarilyUnavailableHTTPError503HTTPSError503HTTPServerError503HTTPError503.Theserviceisunavailable.Theserveristemporarilyunabletoserviceyourrequestduetomaintenancedowntimeorcapacityproblems.Pleasetryagainlater. Unlikeotherserver-sideerrors,theHTTPerror503serviceunavailablemeansthatyourwebserveroperatesproperlybutcan’tbereachedatthemoment.Typically,it’scausedbyahighnumberofrequestssenttotheserver,whichexhaustsavailableresources. Inmostcases,the503serviceunavailableerrorwilldisappearassoonasthetrafficgoesdown.Hence,allowingvisitorstoviewyourcontentafteralittlewhile.However,whentheerrorpersistsforanextendedperiod,itmightbeanindicationofamoreseriousproblemwithinyourserver. Therefore,thenextsectionwillshowyoutheseveneffectivewaystofindtherootcauseandresolvethe503serviceunavailableerror. 7StepstoFindRootCauseandResolvethe503Error: Fromcheckingyourresourceusagetoviewingserverlogs,wewillwalkyouthroughsevenwaystodiagnoseandfixtheHTTP503errors. 1.CheckResourceUsage TheresourcesthataserverusesareRAM,CPU,I/O,entryprocesses,andwebsiteinodes.Checkingthesemetricscanhelpyouconfirmwhethertheissueisrelatedtolimitedresources.Forexample,youcanmonitorincomingtrafficanddetectwheneveranunusualtrafficsurgeoccurs. Hostinger’shPanelhasexcellentfunctionalitytomonitorresourceusage.UserscanaccessthedashboardandnavigatetoOrder->OrderUsage. Fromthere,youwillfindvariousmetricsrelatedtoyourwebsite’sresourceusage,including: CPU–theamountofCPUpowerconsumedbyyoursite.Memorylimit–totalmemoryusedbyyourwebsitetoprocessrequests.Processes–thenumberofprocessesrunningonyourhostingaccount.Throughput(I/O)–thespeedofdatatransfersbetweentheharddiskandRAM.Totalrequests–theamountofHTTPandHTTPSrequestsofallhostingaccounts.Bandwidth–datatransferredwithinaspecificperiodoftime. Thesemetricscanhelpyousolvethe503serviceunavailableerror.Forexample,lookatthefollowingmetric: Inthegraphabove,theredlinerepresentsyourcurrentplan’slimit,andtheblueoneshowstheamountofmemoryusedbyyourwebsite.Whenyourwebsiteexceedsthememorylimit,itwillslowdownyouroverallperformance,triggeringtheHTTPerror503. Agoodruleofthumbistoupgradeyourhostingpackagetoincreasethesethreeservercomponents: CPU.AlthoughtheCPUcanprocessnumerousrequestssimultaneously,aconstantstraincanexhausttheCPUandslowdownyoursite’sperformance.Therefore,ifyouhavealargevolumeofrequests,it’sbesttoupgradeyourCPUcapacity.RAM.AwebsitewithlargetrafficneedstohavemoreRAMtokeepitupandrunning.Themorememoryyourwebsitehas,thelessstrainitwillhaveonyourCPU,allowingtheservertorunfasterandprocessmorerequests.Bandwidth.Themorebandwidthyouhave,thefasterdatatravelsbetweenyoursite,users,andtheinternet.Ifyoursitehasalotofdynamiccontent,suchasimagesandvideos,youwillneedahigherbandwidthallowanceforoptimizedloadingtime. 2.CheckforOngoingMaintenance Regularservermaintenanceisvitaltooptimizesiteperformanceandminimizesecurityrisks. ProTip UsetoolslikeGTMetrixtogetinsightsonoptimizingyoursiteperformance. Generally,awebserverorapplicationissettoshutdownwheneverit’sgoingthroughmaintenance. Withthatinmind,theHTTPerror503serviceunavailablemightoccurduringthisunexpectedmaintenance.Forinstance,somewebhostsusuallyprovidetheiruserswithautomaticupdateswheneveranewWordPressversionisreleased.Thesystemautomaticallyissuesthe503serviceunavailableerrorduringtheprocess. Contactyourhostingprovidertocheckifthe503erroriscausedbyscheduledmaintenance.Hostingeruserscansimplygotoourstatuspageandseereal-timeupdatesofthesystem. Alternatively,youcanchoosetomodifyyourserverconfigurationoptionsanddisableautomaticupdates.Thatway,youwillhavecompletecontroloveryourservermaintenance. BelowarethestepstodisableautomaticupdatesviaHostinger’shPanel: AccessyourhPaneldashboardandgotoWebsite->AutoInstaller.Then,selectWordPress. Next,fillinallnecessaryinformation,fromyourdomainnametoadministratorlogincredentials.Atthebottomofthepage,youwillseethreeautomaticupdateoptions.ContinuebyselectingTurnoffautomaticapplicationupdates. ClickInstallandwaitfortheprocesstocomplete. 3.StopRunningProcesses Anothercommonproblemcausingthe503serviceunavailableerrorisexceedingthemaximumprocesslimit.Whenyourwebserverprocessestoomanyprocessessimultaneously,itcanoverloadandstopworking. Togetyoursitebackonline,youwillneedtostoprunningprocesses.ForVPShostingusers,youcankillaprocessusingthekillcommandline. Meanwhile,sharedhostinguserscannavigatetothehostingcontrolpanelandgototheOrderUsagepage.Fromthere,scrolldowntothebottomofthepageuntilyoufindtheStoprunningprocessesoption. ClickingontheStopbuttonwillkillallongoingprocessesonyourwebsite.Keepinmindthatthissolutionisjustatemporaryfix–youstillhavetodofurtherinvestigationtoidentifywhatiscausingmanyprocessestorunsimultaneously. StartbyexaminingyourWordPressthemesandpluginsastheycanuseupresourcesandconflictwitheachother. IfyouencountertheHTTP503errorafterinstallingaspecificplugin,itmeansyouhavefoundtheculprit.However,ifyoucan’tidentifywhichpluginiscausingtheproblem,youmightneedtodisableallpluginsandenablethemonebyone. Asidefromplugins,poorly-codedWordPressthemescanalsotriggerthe503errors.Tofixthis,trytochangeyourWordPressthemetoadefaultone,suchasTwentyNineteenorTwentyTwenty. Ifyoukeepexceedingthemaximumprocesslimit,somescriptsorapplicationsmightbeusingmoreresourcesthanyourcurrentplanprovides.Inthiscase,youwillneedtoeitheroptimizeyourwebsitespeedorupgradeyourhostingplanaltogether. 4.ResetFirewall Awebapplicationfirewall(WAF)blocksanysuspicioustrafficfromcomingintoyoursite.Inotherwords,thefirewallprotectsyourwebsiteagainstmaliciousactivities,frombruteforceandDDoSattackstocross-sitescriptingandSQLinjections. Thatbeingsaid,improperfirewallconfigurationcandetectfalsepositivesandblockconnectionsfromaspecificclient.Forexample,yourfirewallmightmistakeasaferequestfromacontentdeliverynetwork(CDN)asmalicious,blockingcriticaltrafficandtriggeringthe503errors. Resolvethisproblembyresettingyourfirewallconfiguration.HostingerVPSuserscangototheadminpanel,navigatetotheVPSManagementsection,andclickResetFirewall. However,thestepswillvarydependingonyourhostingprovider.It’sbesttocontactthesupportteamandaskforassistance. 5.CheckServerLogsandFixtheCode Ifthe503errorstillpersists,trycheckingyourerrorlog. Server-sidelogsrecordinformationaboutyourwebsite’sactivities,fromwebpagesrequestedbyvisitorstoerrorshappeninginthesystem.Usinginformationfromthelogs,youcanidentifyandfixerrorsmoreefficiently. Usually,yourhostingproviderfeaturesthewebsiteerrorlogthroughtheadmindashboard.HostingerusersshouldaccesshPanelandgotoAdvanced->PHPConfiguration. ThenextstepistoswitchtothePHPOptionstabandcheckthelogErrorsoption. Scrolldowntosavethechanges.Gotothepublic_htmldirectory,openthewp_contentfolder,andviewtheerrorlogfilewheneveranerroroccurs. Additionally,youcanalsoenableerrorloggingbyaddingtheWP_DEBUGPHPconstantinthewp-config.phpfile. Togetstarted,openyourwebsiterootdirectoryandlocatethewp-config.phpfile.HostingeruserscanaccesshPanelandgotoFiles->FileManager. Clickonthepublic_htmlfolderandchoosewp-config.php. Addthefollowingcodeinsidethefile:define('WP_DEBUG',true);define('WP_DEBUG_LOG',true);define('WP_DEBUG_DISPLAY',false); Onceyou’redone,clicktheSaveandclosebutton. Moreover,youcanchecktheservererrorlogonyourwebserversoftwarebyaccessingthefollowingfileaccordingly: Nginxserver:/var/log/nginx/error.log/Apacheserver:/var/log/apache2/error.log/ 6.RestartYourServerandNetworkingEquipment The503serviceunavailableerrorcanhappenduetoconnectivityissuesbetweentheserverchainhostingyourapplication. Thus,ifyouhaverootaccesstoyourwebsite,oneoftheeasiestwaystofixthe503servicetemporarilyunavailableerroristorebootyourserver.Ifyoursiteishostedonmultipleservers,makesuretorefresheachservertoreturnittonormal. Todoso,HostingeruserscanaccesstheServerManagementpageandclickontheRebootbutton. Ifthe503serviceunavailableerrorpersists,theproblemmightcomefromtemporaryissueswithinyourcomputerdevicesandhomeconnection.Thiscanhappenduetonetworkmisconfigurationthatpreventsyourdevicesfromprocessingrequests. Inthiscase,asimplerestartcangetthejobdone–switchoffallnetworkingequipment,waitforasecond,andturnitbackonagain.Oncedone,reconnectyourcomputertothenetworkandreloadyourwebsite. 7.CheckYourDNS Anotherpossiblefactorcausingthe503errorisaDNS-relatedissue,suchasunresolvedIPaddresses,unresponsiveDNSservers,oracorruptedDNScache. OneeffectivewaytofixthisissueistoflushyourDNS.ThewaytoflushDNScachedependsonyouroperatingsystem.Below,wewillshowyouhowtoperformthistaskonWindows,macOS,andGoogleChrome. MicrosoftWindows OnWindows,openthecommandpromptandinputthefollowingdirective: ipconfig/flushdns ThecommandwillclearouttheDNSfilesandrestarttheDNSresolvercache.AconfirmationmessagewillappearoncetheDNSissuccessfullyflushed. macOS MacuserscanpressF4toaccessTerminalandrunthefollowingcommand: sudokillall-HUPmDNSResponder Important!DifferentmacOSversionsrequiredifferentcommands. GoogleChrome GoogleChromeuserscanflushtheirDNScacheontheirwebbrowser. OpentheprogramandenterthefollowingURLintotheaddressbar: chrome://net-internals/#dns Itwilltakeyoutotheinternalsettingspage.Fromthere,selecttheClearhostcacheoption. TemporarilyswitchingyourDNSserversisanothermethodtotry.YourDNSserversareassignedbyyourISPbydefault,butyoucanalwayschangethemtothird-partyservers,suchasGooglePublicDNS. TroubleshootingOther5xxErrors HowtoSolveHTTPError500? HowtoFix502Error–BadGateway? HowtoSolveHTTPError504? Conclusion The503errorisanHTTPstatuscodethatappearswhenevertheserverisunabletohandlearequest.Usually,thiserroroccursduringservermaintenance.However,the503errorscanalsobearesultofresourceoutages. Althoughtheerrorusuallygoesawayonitsown,itcannegativelyimpactyoursiteperformanceanduserexperienceifleftunattended.Withthisinmind,wehavelookedatseveneffectivewaystosolvethisproblemandreturnyoursitetonormal. Let’sdoaquickrecap: Checkresourceusage–monitoryourresourcemetricstoconfirmiftheissueisrelatedtoexcessiveuse.Ifnecessary,upgradeyourhostingplan.Checkforongoingmaintenance–contactyourhostingserviceprovidertoseeifscheduledmaintenanceisinprogress.Stoprunningprocesses–killongoingprocessesthatareoverwhelmingyourserver’scapacity.Resetfirewall–revertanimproperlyconfiguredfirewallbyresettingitthroughyourhostingadminpanel.Checkserverlogsandfixthecode–combthroughyourwebsiteerrorlogsandresolveanyunusualcodes.Restartyourserverandnetworkingequipment–rebootyourserverandnetworkingequipmenttoresolveanypossiblemisconfiguration.CheckyourDNS–flushyourDNScacheandtemporarilyswitchyourservertopublicDNS. Allinall,wehopethesetroubleshootingstepshelpyouremovetheHTTPerror503andgetyourwebsitebackup.Shouldyouhaveanyfurtherquestions,don’thesitatetoleavetheminthecommentsectionbelow. Wasthistutorialhelpful? Yes No Theauthor NabillaR. NabillaisaDigitalContentWriteratHostinger.Shehasapassionforwebsitehostinganddevelopmentandiskeentoshareherknowledgetohelppeoplefurthertheironlinejourney.Whenshe'snotbusywriting,shelikestoexplorenatureandgoonadventures. MorefromNabillaR. TheCo-author FreddyM. FreddyisaWordPressthemerevieweratWPThemeRaves,apublishedWordPressblogger,webdevandfounderofVistaMediaEnterprises–anonlinebusinessdedicatedtoWordPressuserslookingtoboostconversionratesthroughcontentmarketing.Heshareshiswealthofexperiencehere. MorefromFreddyM. Relatedtutorials 22Mar• Errors • HowtoFixtheERR_CONNECTION_RESETErrorinChrome:7QuickWays Encounteringconnectionerrors,suchasGoogleChrome’sERR_CONNECTION_RESET,isanirritatingexperienceforwebsitevisitors.Ifyou’re... ByHasnaAvni 15Mar• Errors • NET::ERR_CERT_COMMON_NAME_INVALID:10SolutionstotheError ItisanimportantsecuritypracticetosecureyourwebsiteusingHTTPSextension.However,anerrormessagelikeNET::ERR_CERT_COMMON_NAME_INVALID... ByNoviantikaGita 15Mar• Errors • ERR_CONNECTION_REFUSEDonChrome:WhatItIsand11WaystoFixIt ERR_CONNECTION_REFUSEDisanerrormessageyoumightencounterwhenaccessingawebsiteusingGoogleChrome.Althoughfrustrating,itusually... ByHasnaAvni Whatourcustomerssay Trustpilot



請為這篇文章評分?