Mail.queue DB file is increasing continuously

Arif Khan
Arif Khan used Ask the Experts™
on
I am using exchange 2016, its Mail.queue is located on C drive it is continously increasing due to which some times fail flow stopped and after restarting exchange services, it works. Current size is more than 14 GB. I have some of client who are using exchange 2010 and exchange 13, their mail.queue never increase while they have many mailboxes than this. I decreased Safety net time and other thing but stilll increasing. I followed below links.

Every time, Recreating Mail.queue is not possible for.

http://www.admin-enclave.com/en/articles/exchange/296-resolved-exchange-hub-transport-mail-que-file-large-in-size.html 

https://social.technet.microsoft.com/Forums/ie/en-US/c896f0fe-e5ba-4138-92e8-8ce657144112/mailque-file-size-is-rapidly-increasing?forum=exchangesvradmin
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Arif KhanSystem Administrator

Author

Commented:
I do not want to change the mail.queue location.

I want to stop its increasing size. Generally if mail is processed, it should automatically get release from Mail.queue but I think either this is not happening or happening very late. I need your support to fix large size 14 GB of mail.queuque
I hope you have already tried the option to restrict the safety Net hold time.

for your information, this seems to be expected behavior and if its growing usually faster then your best option is to move it to a different drive with more space.

https://blogs.technet.microsoft.com/exchange/2013/05/06/ask-the-perf-guy-sizing-exchange-2013-deployments/
https://social.technet.microsoft.com/Forums/lync/en-US/8fe755e5-bbac-470a-8031-727f6d4d64c0/temp-and-mailque-growing-very-large?forum=exchangesvradmin
E ATech Lead
Commented:
May be any third party antivirus/antispam acting on the queue db and causing it to grow.

Also, check if there are any large  attachments stuck in outbox which will cause the db's transport and mdb's to grow in a larger size.

Monitor your queue for any bundles of spam mails.

Get in detailed here:

https://social.technet.microsoft.com/Forums/lync/en-US/8fe755e5-bbac-470a-8031-727f6d4d64c0/temp-and-mailque-growing-very-large?forum=exchangesvradmin

http://expert-advice.org/2017/09/move-truncate-logs-exchange-server-2013/

Hope this helps!
Arif KhanSystem Administrator
Commented:
Thank you for your support.

I am trying below.......

To this issue, please refer to the following steps to check if the issue persist:

1. Lower Down the Values of SafetyNetHoldTime, ShadowMessageAutoDiscardInterval, MessageExpirationTimeout

Set-TransportConfig SafetyNetHoldTime 1.00:00:00 >> 1-Day

Set-TransportConfig ShadowMessageAutoDiscardInterval 1.00:00:00  >> 1-Day

Get-TransportService | Set-TransportService -MessageExpirationTimeout 1.00:00:00 >> 1-Day

2. To ensure that transport databases recover the whitespace efficiently, added below keys on Exchange 2016  Edgetransport.exe.Config file in the “C:\Program Files\Microsoft\Exchange Server\V15\Bin”

<add key="QueueDatabaseOnlineDefragSchedule" value="1:00:00" />

<add key="QueueDatabaseOnlineDefragTimeToRun" value="3:00:00" />

<add key="QueueDatabaseOnlineDefragEnabled" value="true" />

3. Restart the transport service.
Arif KhanSystem Administrator
Commented:
After above issue, i faced the same issue. I have logged the case with Microsoft, they export mails stuck in OUTBOX using below command. Some heavy size mails were stuck in queue. Deleted it. and recreated QUEUE folder.

get-mailbox -ResultSize Unlimited| Get-MailboxFolderStatistics -folderscope Outbox | Sort-Object Foldersize -Descending | select-object identity,name,foldertype,itemsinfolder,@{Name="FolderSize MB";expression={$_.folderSize.toMB()}} | export-csv OutboxItems.csvget-mailbox -ResultSize Unlimited| Get-MailboxFolderStatistics -folderscope Outbox | Sort-Object Foldersize -Descending | select-object identity,name,foldertype,itemsinfolder,@{Name="FolderSize MB";expression={$_.folderSize.toMB()}} | export-csv OutboxItems.csv


They suggested that in exchange 2010 mail.queue size is 2 GB and exchange 2013/16 its 15 GB. So no worry till 15 GB. I am waiting to grow it more. Will share the steps
System Administrator
Commented:
1. Deleted all stuck mail in outbox
2. Set mail flow size to 30 MB for all users
3. Reduced Safety net, Autoshadow, Message expiration from 2 days to 1 day
4. Added defrag key in EdgeTransport.exe.config file
5. Add safety net clear value in EdgeTransport.exe.config file
6. Re-created QUE folder


<add key="SafetyNetHoldTimeInterval" value="1.00:00:00" />
Arif KhanSystem Administrator

Author

Commented:
This fixed the problem

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial