本文详细介绍PostgreSQL的磁盘空间占用问题
Asaneasyperformanceboostwithnodownside,makesurethefilesystemonwhichyourdatabaseiskeptismounted"noatime",whichturnsofftheaccesstimebookkeeping.
4.2TrytheAutoVacuumdaemon
ThereisalittleknownmoduleinPostgreSQLcontribdirectorycalledaspgavd.Itworksinconjunctionwithstatisticscollector.Itperiodicallyconnectstoadatabaseandchecksifithasdoneenoughoperationssincethelastcheck.Ifyes,itwillvacuumthedatabase.
Essentiallyitwillvacuumthedatabasewhenitneedsit.Itwouldgetridofplayingwithcronsettingsforvacuumfrequency.Itshouldresultinbetterdatabaseperformancebyeliminatingoverduevacuumissues.
4.3TryFreeBSD
Largeupdates,deletes,andvacuuminPostgreSQLareverydiskintensiveprocesses.Inparticular,sincevacuumgobblesupIObandwidth,therestofthedatabaseactivitiescouldbeaffectedadverselywhenvacuumingverylargetables.
OS'sfromtheBSDfamily,suchasFreeBSD,dynamicallyaltertheIOpriorityofaprocess.Soifyoulowerthepriorityofavacuumprocess,itshouldnotchewasmuchbandwidthandwillbetterallowthedatabasetoperformnormally.Ofcoursethismeansthatvacuumcouldtakelonger,whichwouldbeproblematicfora"vacuumfull."
IfyouarenotdonewithyourchoiceofOSforyourserverplatform,considerBSDforthisreason.
5TheCONFSettingGuide
AvailablehereisanAnnotatedGuidetothePostgreSQLconfigurationfilesettings,inbothOpenOffice.organdPDFformat.Thisguideexpandsontheofficialdocumentationandmayeventuallybeincorporatedintoit.
责编:豆豆技术应用