%3CLINGO-SUB%20id%3D%22lingo-sub-1113388%22%20slang%3D%22en-US%22%3ETransport%20database%3A%20understand%2C%20size%20and%20troubleshoot%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1113388%22%20slang%3D%22en-US%22%3E%3CP%3E%3CFONT%20size%3D%225%22%3EIntroduction%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EOver%20time%2C%20we%20have%20seen%20multiple%20support%20tickets%20where%20the%20transport%20database%20%E2%80%9Cmail.que%E2%80%9D%20file%20grows%20unexpectedly%2C%20which%20in%20turn%20causes%20various%20mail%20flow%20related%20issues.%20In%20this%20article%2C%20we%20will%20provide%20details%20about%20the%20transport%20database%20mail.que%20and%20help%20you%20avoid%20issues%20caused%20by%20large%20database.%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EUnderstanding%20backpressure%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EBefore%20jumping%20into%20the%20issue%20and%20possible%20solution%2C%20we%20need%20to%20understand%20how%20Exchange%20Transport%20Service%20monitors%20and%20reacts%20to%20the%20various%20system%20resources%20like%20memory%20and%20disk%20space.%20This%20is%20also%20known%20as%20%E2%80%9CBack%20pressure%E2%80%9D.%20Back%20pressure%20is%20a%20system%20resource%20monitoring%20feature%20of%20the%20Microsoft%20Exchange%20Transport%20service%20that%20exists%20on%20Hub%20Servers%20(2010)%2C%20Mailbox%20servers%20and%20Edge%20Transport%20servers.%20Back%20pressure%20detects%20when%20vital%20system%20resources%20(hard%20drive%20space%2C%20memory%20etc.)%20are%20overused%2C%20and%20takes%20action%20to%20prevent%20the%20server%20from%20becoming%20completely%20overwhelmed%20and%20unavailable.%20You%20can%20read%20more%20about%20backpressure%20in%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fmail-flow%2Fback-pressure%3Fview%3Dexchserver-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Earticle%3C%2FA%3E.%20The%20net%20result%20is%20that%20if%20the%20disk%20space%20utilization%20on%20the%20drive%20that%20holds%20the%20Mail%20Queue%20Database%20or%20Log%20files%20exceeds%20a%20certain%20threshold%2C%20Transport%20service%20will%20delay%20or%20even%20stop%20accepting%20new%20messages.%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EWhat%E2%80%99s%20stored%20inside%20the%20Mail.que%20database%3F%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3ETransport%20storage%20capacity%20is%20driven%20by%20two%20needs%3A%20temporary%20queuing%20of%20inbound%20and%20outbound%20messages%20(including%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fmail-flow%2Ftransport-high-availability%2Fshadow-redundancy%3Fview%3Dexchserver-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eshadow%20queuing%3C%2FA%3E)%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fmail-flow%2Ftransport-high-availability%2Fsafety-net%3Fview%3Dexchserver-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESafety%20Net%3C%2FA%3E%20(earlier%20known%20as%20transport%20dumpster).%20You%20can%20think%20of%20the%20transport%20storage%20capacity%20requirement%20as%20the%20sum%20of%20message%20content%20on%20disk%20in%20a%20worst-case%20scenario.%20Broadly%2C%20your%20mail.que%20consists%20of%20following%20elements%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThe%20current%20day%E2%80%99s%20message%20traffic%2C%20along%20with%20messages%20which%20exist%20on%20disk%20longer%20than%20normal%20expiration%20settings%20(like%20poison%20queue%2C%20Journal%20messages%20etc.)%3C%2FLI%3E%0A%3CLI%3EShadow%20redundancy%20queuing%3C%2FLI%3E%0A%3CLI%3ESubmission%20queue%20and%20messages%20waiting%20for%20delivery%3C%2FLI%3E%0A%3CLI%3EMessages%20persisted%20in%20Safety%20Net%20in%20case%20they%20are%20required%20for%20re-delivery%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EAlso%20note%20that%2C%20like%20with%20other%20Exchange%20databases%2C%20when%20email%20is%20deleted%20from%20Transport%20Database%20(mail.que)%2C%20the%20database%20size%20does%20not%20shrink%3B%20instead%2C%20during%20online%20maintenance%20activity%2C%20%E2%80%98white%20space%E2%80%99%20is%20created%20inside%20the%20database%20for%20future%20use.%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EWhy%20is%20my%20transport%20database%20growing%20so%20large%3F%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EThe%20size%20of%20transport%20database%20depends%20on%20its%20usage.%20The%20database%20size%20is%20directly%20proportional%20to%20the%20average%20size%20of%20messages%2C%20as%20well%20as%20number%20of%20messages%20per%20day.%20If%20an%20email%20with%20a%20larger%20attachment%20is%20sent%20to%20all%20company%20employees%2C%20the%20size%20of%20the%20transport%20database%20will%20increase%20more%20on%20that%20day.%20The%20following%20are%20some%20of%20the%20causes%20of%20the%20growth%20of%20your%20transport%20database%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESudden%20increase%20of%20internal%2Fexternal%20email%20traffic%3C%2FLI%3E%0A%3CLI%3ERecent%20configuration%20change%20in%20SafetyNet%20hold%20time%20(increased%20from%20default%20value)%3C%2FLI%3E%0A%3CLI%3ESetting%20Message%20Expiration%20timeout%20to%20more%20than%20the%20default%20number%20of%20days%3C%2FLI%3E%0A%3CLI%3EShadow%20Message%20Auto%20Discard%20Interval%20was%20configured%20with%20a%20high%20value%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ESo%2C%20it%E2%80%99s%20good%20practice%20to%20compare%20the%20following%20values%20in%20your%20environment%20to%20their%20defaults%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EGet-TransportConfig%20%7C%20FL%20SafetyNetHoldTime%20(default%20is%202%20days)%3C%2FLI%3E%0A%3CLI%3EGet-TransportConfig%20%7C%20FL%20ShadowMessageAutoDiscardInterval%20(default%20is%202%20days)%3C%2FLI%3E%0A%3CLI%3EGet-TransportService%20%7C%20FL%20MessageExpirationTimeout%20(default%20is%202%20days)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ERegarding%20the%20number%20of%20sent%20and%20received%20messages%20per%20day%2C%20you%20need%20to%20use%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-in%2Fdownload%2Fdetails.aspx%3Fid%3D24659%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELog%20Parser%3C%2FA%3E%20with%20Message%20tracking%20logs%20to%20know%20how%20many%20messages%20sent%20or%20received%20recently%20with%20average%20message%20size.%20There%20are%20also%20many%20Powershell%20Scripts%20that%20you%20can%20take%20help%20from%20and%20modify%20based%20on%20your%20environment%20to%20find%20this%20out.%20One%20such%20example%20is%20GetMessageStatstoFile%20Powershell%20script%20which%20is%20available%20in%20%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2Foffice%2FExchange-200720102013-0ea7662b%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ETechNet%20Gallery.%20%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EHow%20to%20calculate%20the%20required%20space%20for%20your%20transport%20database%3F%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3ETo%20determine%20the%20maximum%20size%20of%20the%20transport%20database%2C%20we%20can%20look%20at%20the%20entire%20messaging%20system%20as%20a%20unit%20(all%20of%20the%20servers)%20and%20then%20come%20up%20with%20a%20per-server%20value.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOverall%20Daily%20Messages%20Traffic%20%3D%20number%20of%20users%20x%20message%20profile%20(use%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexchange-team-blog%2Fgenerating-user-message-profiles-for-use-with-the-exchange%2Fba-p%2F610916%22%20target%3D%22_blank%22%3Ethis%3C%2FA%3E%20article%20to%20calculate%20message%20profile%20for%20your%20organization).%3C%2FLI%3E%0A%3CLI%3EOverall%20Transport%20DB%20Size%20%3D%20average%20message%20size%20x%20overall%20daily%20message%20traffic%20x%20(1%20%2B%20(percentage%20of%20messages%20queued%20x%20maximum%20queue%20days)%20%2B%20Safety%20Net%20hold%20days)%20x%202%20copies%20for%20high%20availability%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ELet%E2%80%99s%20use%20the%20100%2C000%20user%20sizing%20example%20and%2075KB%20average%20message%20size.%20The%20size%20the%20transport%20database%20using%20the%20simple%20method%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOverall%20Transport%20DB%20Size%20%3D%2075KB%20x%20(100%2C000%20users%20x%20200%20messages%2Fday)%20x%20(1%20%2B%20(50%25%20x%202%20maximum%20queue%20days)%20%2B%202%20Safety%20Net%20hold%20days)%20x%202%20copies%20%3D%2011%2C444GB%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20our%20example%20scenario%2C%20we%20have%208%20DAGs%2C%20each%20containing%2016-nodes%2C%20and%20we%20are%20designing%20to%20handle%20double%20node%20failures%20in%20each%20DAG.%20This%20means%20that%20in%20a%20worst-case%20failure%20event%20we%20would%20have%20112%20servers%20online%20with%202%20failed%20servers%20in%20each%20DAG.%20We%20can%20use%20this%20value%20to%20determine%20a%20per-server%20transport%20database%20size%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F165692iCE2F9542AC562E97%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22transportdb01.jpg%22%20title%3D%22transportdb01.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20mentioned%20earlier%2C%20when%20email%20is%20deleted%20from%20the%20transport%20database%20mail.que%2C%20the%20database%20does%20not%20shrink%2C%20instead%20we%20create%20white%20space%20in%20the%20database%20for%20future%20use.%26nbsp%3BSo%2C%20if%20your%20Safety%20Net%20gets%20set%20to%202%20days%2C%20you%20will%20find%20that%20initially%20the%20database%20size%20is%20growing%20exponentially.%20After%202%20days%20of%20Hold%20Time%2C%20we%20will%20start%20deleting%20the%20messages%20from%20the%20database%20and%20create%20white%20space.%20So%2C%20from%20that%20point%20onwards%2C%20data%20will%20be%20written%20into%20the%20white%20space%2C%20and%20the%20database%20size%20won%E2%80%99t%20increase%20at%20the%20same%20rate.%20The%20best%20way%20to%20check%20the%20white%20space%20of%20a%20Transport%20Database%20is%20checking%20the%20below%20performance%20counter%3A%3C%2FP%3E%0A%3CP%3E%5CMSExchangeTransport%20Database%5CTransport%20Queue%20Database%20Internal%20Free%20Space%20(MB).%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EHow%20can%20I%20recover%20from%20issues%20related%20to%20large%20transport%20database%3F%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EUnless%20you%20are%20facing%20mailflow%20slowness%20or%20stoppage%2C%20a%20large%20mail.que%20of%20hundreds%20of%20GBs%20is%20not%20actually%20an%20issue%2C%20it%E2%80%99s%20completely%20expected%20because%20of%20the%20high%20mailflow%20traffic%20in%20your%20organization.%20But%20if%20you%20are%20facing%20a%20backpressure%20issue%20because%20of%20large%20Mail.que%20file%2C%20the%20first%20thing%20you%20could%20do%3B%20to%20solve%20the%20issue%20quickly%3B%20is%20move%20the%20Transport%20database%20or%20Transport%20database%20Log%20file%20path%20or%20both%20to%20a%20different%20drive%20which%20has%20more%20free%20space%20following%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fmail-flow%2Fqueues%2Frelocate-queue-database%3Fview%3Dexchserver-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%3C%2FA%3E%20article.%3C%2FP%3E%0A%3CP%3EIf%20there%20is%20no%20other%20drive%20available%20to%20move%20the%20transport%20database%2C%20you%20can%20recreate%20the%20database%20so%20that%20the%20immediate%20problem%20is%20resolved.%20And%20to%20ensure%2C%20there%20is%20no%20data%20loss%2C%20we%20must%20make%20sure%20there%20is%20no%20email%20waiting%20in%20the%20queue%20to%20be%20sent%20out.%20The%20steps%20are%20mentioned%20below%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CUL%3E%0A%3CLI%3EFailover%20Exchange%20databases%20to%20a%20different%20server%20to%20avoid%20downtime%20for%20submission%20from%20local%20databases%3C%2FLI%3E%0A%3CLI%3EPause%20the%20Microsoft%20Exchange%20Transport%20Service%3C%2FLI%3E%0A%3CLI%3ERun%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fexchange%2Fmail-flow%2Fget-queue%3Fview%3Dexchange-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGet-queue%3C%2FA%3E%20command%20on%20the%20Exchange%20server%20and%20make%20sure%20that%20all%20messages%20have%20been%20processed%20and%20no%20email%20is%20stuck%20in%20the%20queue.%3C%2FLI%3E%0A%3CLI%3EMake%20sure%20no%20other%20servers%20have%20shadow%20messages%20waiting%20for%20this%20server%20(otherwise%20they%20would%20get%20delivered%20again).%20You%20can%20run%20the%20following%20command%20to%20see%20all%20the%20shadow%20queues%20for%20a%20particular%20server%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Eget-transportserver%20%7C%20get-queue%20%7C%20%3F%7B%24_.deliveryType%20-eq%20%22ShadowRedundancy%22%20-and%20%24_.NextHopDomain%20-eq%20%22Servername%22%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CUL%3E%0A%3CLI%3EStop%20the%20Microsoft%20Exchange%20Transport%20and%20Microsoft%20Exchange%20Frontend%20Transport%20services%3C%2FLI%3E%0A%3CLI%3ENavigate%20to%20queue%20folder%20path%20and%20rename%20it%20to%20something%20like%20QueueOld%3C%2FLI%3E%0A%3CLI%3EStart%20the%20Microsoft%20Exchange%20Transport%20and%20Microsoft%20Exchange%20Frontend%20Transport%20services%3C%2FLI%3E%0A%3CLI%3EA%20new%20queue%20folder%20would%20be%20created%2C%20make%20sure%20that%20Application%20event%20ID%207005%20has%20appeared%3A%20%22A%20new%20database%20file%20mail.que%20has%20been%20created.%22%3C%2FLI%3E%0A%3CLI%3EIf%20the%20transport%20service%20starts%20successfully%2C%20you%20can%20move%20the%20QueueOld%20to%20a%20different%20location%20for%20backup%20and%20delete%20it%20later.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FUL%3E%0A%3CP%3EAs%20mentioned%20earlier%2C%20initially%20the%20mail.que%20would%20grow%20exponentially%20and%20once%20the%20initial%20SafetyNetHoldTime%20time%20is%20reached%2C%20we%20will%20start%20deleting%20the%20messages%20from%20the%20database%20and%20create%20white%20space.%20So%2C%20from%20this%20time%2C%20data%20will%20be%20written%20in%20the%20white%20space%2C%20and%20the%20size%20won%E2%80%99t%20increase%20at%20the%20same%20rate.%20But%20if%20the%20issue%20was%20not%20caused%20by%20any%20recent%20increase%20in%20mail%20traffic%20or%20configuration%20change%2C%20eventually%20the%20size%20of%20mail.que%20will%20reach%20to%20what%20you%20had%20earlier.%20If%20you%20still%20cannot%20afford%20a%20large%20mail.que%2C%20you%20might%20want%20to%20change%20some%20configuration%20parameters%20and%20reduce%20the%20values%20from%20the%20current%20setting.%20For%20example%2C%20you%20might%20want%20to%20reduce%20the%20Safety%20Net%20hold%20time%20to%201%20day%20instead%20of%20default%202%20days%20using%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ESet-TransportConfig%20-SafetyNetHoldTime%201.00%3A00%3A00%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOr%20maybe%20reduce%20the%20Shadow%20message%20discard%20interval%20using%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ESet-TransportConfig%20-ShadowMessageAutoDiscardInterval%201.00%3A00%3A00%20%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EAdditional%20Information%20regarding%20Safety%20Net%20maximum%20supported%20size%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EIn%20Microsoft%20Exchange%20Server%202019%20and%202016%2C%20the%20maximum%20supported%20database%20size%20for%20the%20transport%20Safety%20Net%20JET%20database%20is%202%20TB.%20When%20a%20Hub-and-spoke%20topology%20is%20used%2C%20the%20transport%20Safety%20Net%20JET%20database%20can%20grow%20beyond%202%20TB%20on%20Transport%20Servers%20which%20are%20part%20of%20the%20Hub%20site.%20Disable%20SafetyNet%20on%20these%20transport%20servers%20following%20our%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2FExchange%2Fmail-flow%2Ftransport-high-availability%2Fsafety-net%3Fview%3Dexchserver-2019%23safety-net-maximum-supported-sizes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eguidelines%3C%2FA%3E%20to%20stay%20within%20the%20supported%20limit%20of%202%20TB.%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%225%22%3EMonitor%20the%20performance%20of%20transport%20database%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EIt%E2%80%99s%20also%20a%20good%20practice%20to%20monitor%20various%20transport%20database%20performance%20counters%20to%20understand%20if%20there%20are%20any%20underlying%20issues%20or%20if%20there%20is%20a%20sudden%20spike%20in%20mailflow%20traffic%20that%20is%20increasing%20the%20size%20of%20your%20transport%20database.%20Following%20are%20some%20of%20the%20performance%20counters%20with%20expected%20values%3A%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3ECOUNTER%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3E%3CSTRONG%3ECheck%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%3CSTRONG%3EExpected%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3EMSExchange%20Database(Information%20Store)%5CDatabase%20Page%20Fault%20Stalls%2Fsec%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EAvg%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B10%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B100%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3EMSExchange%20Database%20%3D%3D%26gt%3B%20Instances(edgetransport%2FTransport%20Mail%20Database)%5CLog%20Generation%20Checkpoint%20Depth%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D1000%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3EMSExchange%20Database%20%3D%3D%26gt%3B%20Instances(edgetransport%2FTransport%20Mail%20Database)%5CVersion%20buckets%20allocated%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D200%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3ELogicalDisk%5CAverage%20Disk%20sec%2FRead%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EAvg%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B20ms%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D50ms%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3ELogicalDisk%5CAverage%20Disk%20sec%2FWrite%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EAvg%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B20ms%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D50ms%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CAggregate%20Delivery%20Queue%20Length%20(All%20Queues)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EAvg%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D3000%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D5000%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CActive%20Remote%20Delivery%20Queue%20Length%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D250%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CActive%20Mailbox%20Delivery%20Queue%20Length%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D250%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CSubmission%20Queue%20Length%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D100%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CActive%20Non-Smtp%20Delivery%20Queue%20Length%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D250%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CRetry%20Mailbox%20Delivery%20Queue%20Length%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D100%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CRetry%20Non-Smtp%20Delivery%20Queue%20Length%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D100%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CRetry%20Remote%20Delivery%20Queue%20Length%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D100%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22417%22%3E%0A%3CP%3E%3CSTRONG%3E%5CMSExchangeTransport%20Queues(_total)%5CUnreachable%20Queue%20Length%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2266%22%3E%0A%3CP%3EMax%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2272%22%3E%0A%3CP%3E%26lt%3B%3D100%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3EHope%20you%20find%20this%20useful!%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22author%22%3EAbdelrahman%20Ahmed%3C%2FSPAN%3E%20and%20%3CSPAN%20class%3D%22author%22%3EArindam%20Thokder%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1113388%22%20slang%3D%22en-US%22%3E%3CP%3ELet's%20talk%20about%20your%20transport%20database%3A%20what%20impacts%20it's%20size%2C%20as%20well%20as%20how%20to%20troubleshoot%20it.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1113388%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOn%20Premises%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETips%20'n%20Tricks%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Etransport%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETroubleshooting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1147299%22%20slang%3D%22en-US%22%3ERe%3A%20Transport%20database%3A%20understand%2C%20size%20and%20troubleshoot%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1147299%22%20slang%3D%22en-US%22%3E%3CP%3Eedit%3A%20oops%20i%20asked%20a%20question%20that%20was%20answered%20in%20the%20article%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1114729%22%20slang%3D%22en-US%22%3ERe%3A%20Transport%20database%3A%20understand%2C%20size%20and%20troubleshoot%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1114729%22%20slang%3D%22en-US%22%3E%3CP%3EIt's%20a%20great%20article..%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fstareyes_40x40.gif%22%20alt%3D%22%3Astareyes%3A%22%20title%3D%22%3Astareyes%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E

Introduction

Over time, we have seen multiple support tickets where the transport database “mail.que” file grows unexpectedly, which in turn causes various mail flow related issues. In this article, we will provide details about the transport database mail.que and help you avoid issues caused by large database.

Understanding backpressure

Before jumping into the issue and possible solution, we need to understand how Exchange Transport Service monitors and reacts to the various system resources like memory and disk space. This is also known as “Back pressure”. Back pressure is a system resource monitoring feature of the Microsoft Exchange Transport service that exists on Hub Servers (2010), Mailbox servers and Edge Transport servers. Back pressure detects when vital system resources (hard drive space, memory etc.) are overused, and takes action to prevent the server from becoming completely overwhelmed and unavailable. You can read more about backpressure in this article. The net result is that if the disk space utilization on the drive that holds the Mail Queue Database or Log files exceeds a certain threshold, Transport service will delay or even stop accepting new messages.

What’s stored inside the Mail.que database?

Transport storage capacity is driven by two needs: temporary queuing of inbound and outbound messages (including shadow queuing) and Safety Net (earlier known as transport dumpster). You can think of the transport storage capacity requirement as the sum of message content on disk in a worst-case scenario. Broadly, your mail.que consists of following elements:

  • The current day’s message traffic, along with messages which exist on disk longer than normal expiration settings (like poison queue, Journal messages etc.)
  • Shadow redundancy queuing
  • Submission queue and messages waiting for delivery
  • Messages persisted in Safety Net in case they are required for re-delivery

Also note that, like with other Exchange databases, when email is deleted from Transport Database (mail.que), the database size does not shrink; instead, during online maintenance activity, ‘white space’ is created inside the database for future use.

Why is my transport database growing so large?

The size of transport database depends on its usage. The database size is directly proportional to the average size of messages, as well as number of messages per day. If an email with a larger attachment is sent to all company employees, the size of the transport database will increase more on that day. The following are some of the causes of the growth of your transport database:

  • Sudden increase of internal/external email traffic
  • Recent configuration change in SafetyNet hold time (increased from default value)
  • Setting Message Expiration timeout to more than the default number of days
  • Shadow Message Auto Discard Interval was configured with a high value

So, it’s good practice to compare the following values in your environment to their defaults:

  • Get-TransportConfig | FL SafetyNetHoldTime (default is 2 days)
  • Get-TransportConfig | FL ShadowMessageAutoDiscardInterval (default is 2 days)
  • Get-TransportService | FL MessageExpirationTimeout (default is 2 days)

Regarding the number of sent and received messages per day, you need to use Log Parser with Message tracking logs to know how many messages sent or received recently with average message size. There are also many Powershell Scripts that you can take help from and modify based on your environment to find this out. One such example is GetMessageStatstoFile Powershell script which is available in TechNet Gallery.  

How to calculate the required space for your transport database?

To determine the maximum size of the transport database, we can look at the entire messaging system as a unit (all of the servers) and then come up with a per-server value.

 

  • Overall Daily Messages Traffic = number of users x message profile (use this article to calculate message profile for your organization).
  • Overall Transport DB Size = average message size x overall daily message traffic x (1 + (percentage of messages queued x maximum queue days) + Safety Net hold days) x 2 copies for high availability

Let’s use the 100,000 user sizing example and 75KB average message size. The size the transport database using the simple method:

 

Overall Transport DB Size = 75KB x (100,000 users x 200 messages/day) x (1 + (50% x 2 maximum queue days) + 2 Safety Net hold days) x 2 copies = 11,444GB

 

In our example scenario, we have 8 DAGs, each containing 16-nodes, and we are designing to handle double node failures in each DAG. This means that in a worst-case failure event we would have 112 servers online with 2 failed servers in each DAG. We can use this value to determine a per-server transport database size:

transportdb01.jpg

 

As mentioned earlier, when email is deleted from the transport database mail.que, the database does not shrink, instead we create white space in the database for future use. So, if your Safety Net gets set to 2 days, you will find that initially the database size is growing exponentially. After 2 days of Hold Time, we will start deleting the messages from the database and create white space. So, from that point onwards, data will be written into the white space, and the database size won’t increase at the same rate. The best way to check the white space of a Transport Database is checking the below performance counter:

\MSExchangeTransport Database\Transport Queue Database Internal Free Space (MB).

How can I recover from issues related to large transport database?

Unless you are facing mailflow slowness or stoppage, a large mail.que of hundreds of GBs is not actually an issue, it’s completely expected because of the high mailflow traffic in your organization. But if you are facing a backpressure issue because of large Mail.que file, the first thing you could do; to solve the issue quickly; is move the Transport database or Transport database Log file path or both to a different drive which has more free space following this article.

If there is no other drive available to move the transport database, you can recreate the database so that the immediate problem is resolved. And to ensure, there is no data loss, we must make sure there is no email waiting in the queue to be sent out. The steps are mentioned below:

    • Failover Exchange databases to a different server to avoid downtime for submission from local databases
    • Pause the Microsoft Exchange Transport Service
    • Run the Get-queue command on the Exchange server and make sure that all messages have been processed and no email is stuck in the queue.
    • Make sure no other servers have shadow messages waiting for this server (otherwise they would get delivered again). You can run the following command to see all the shadow queues for a particular server:

 

get-transportserver | get-queue | ?{$_.deliveryType -eq "ShadowRedundancy" -and $_.NextHopDomain -eq "Servername"}

 

    • Stop the Microsoft Exchange Transport and Microsoft Exchange Frontend Transport services
    • Navigate to queue folder path and rename it to something like QueueOld
    • Start the Microsoft Exchange Transport and Microsoft Exchange Frontend Transport services
    • A new queue folder would be created, make sure that Application event ID 7005 has appeared: "A new database file mail.que has been created."
    • If the transport service starts successfully, you can move the QueueOld to a different location for backup and delete it later.

As mentioned earlier, initially the mail.que would grow exponentially and once the initial SafetyNetHoldTime time is reached, we will start deleting the messages from the database and create white space. So, from this time, data will be written in the white space, and the size won’t increase at the same rate. But if the issue was not caused by any recent increase in mail traffic or configuration change, eventually the size of mail.que will reach to what you had earlier. If you still cannot afford a large mail.que, you might want to change some configuration parameters and reduce the values from the current setting. For example, you might want to reduce the Safety Net hold time to 1 day instead of default 2 days using the following command:

 

Set-TransportConfig -SafetyNetHoldTime 1.00:00:00

 

Or maybe reduce the Shadow message discard interval using the following command:

 

Set-TransportConfig -ShadowMessageAutoDiscardInterval 1.00:00:00 

 

Additional Information regarding Safety Net maximum supported size

In Microsoft Exchange Server 2019 and 2016, the maximum supported database size for the transport Safety Net JET database is 2 TB. When a Hub-and-spoke topology is used, the transport Safety Net JET database can grow beyond 2 TB on Transport Servers which are part of the Hub site. Disable SafetyNet on these transport servers following our guidelines to stay within the supported limit of 2 TB.

Monitor the performance of transport database

It’s also a good practice to monitor various transport database performance counters to understand if there are any underlying issues or if there is a sudden spike in mailflow traffic that is increasing the size of your transport database. Following are some of the performance counters with expected values:

COUNTER

Check

Expected

MSExchange Database(Information Store)\Database Page Fault Stalls/sec

Avg

<10

 

Max

<100

MSExchange Database ==> Instances(edgetransport/Transport Mail Database)\Log Generation Checkpoint Depth

Max

<=1000

MSExchange Database ==> Instances(edgetransport/Transport Mail Database)\Version buckets allocated

Max

<=200

LogicalDisk\Average Disk sec/Read

Avg

<20ms

 

Max

<=50ms

LogicalDisk\Average Disk sec/Write

Avg

<20ms

 

Max

<=50ms

\MSExchangeTransport Queues(_total)\Aggregate Delivery Queue Length (All Queues)

Avg

<=3000

 

Max

<=5000

\MSExchangeTransport Queues(_total)\Active Remote Delivery Queue Length

Max

<=250

\MSExchangeTransport Queues(_total)\Active Mailbox Delivery Queue Length

Max

<=250

\MSExchangeTransport Queues(_total)\Submission Queue Length

Max

<=100

\MSExchangeTransport Queues(_total)\Active Non-Smtp Delivery Queue Length

Max

<=250

\MSExchangeTransport Queues(_total)\Retry Mailbox Delivery Queue Length

Max

<=100

\MSExchangeTransport Queues(_total)\Retry Non-Smtp Delivery Queue Length

Max

<=100

\MSExchangeTransport Queues(_total)\Retry Remote Delivery Queue Length

Max

<=100

\MSExchangeTransport Queues(_total)\Unreachable Queue Length

Max

<=100

Hope you find this useful!

Abdelrahman Ahmed and Arindam Thokder

2 Comments
Microsoft

It's a great article.. :stareyes:

Senior Member

edit: oops i asked a question that was answered in the article