Friday, February 2, 2018

Postfix qmgr process causes heavy overload on RHEL 6

A RHEL 6 Server running some web service not Email service.

This morning found under heavy I/O delay.

Try check it out by:
free -m
vmstat 1
  wa  --order by wait I/O

The Postfix qmgr process causes heavy overload, which doesn't make any sense to me.

Have to check the mail queue.
mailq | wc -l

which give me over 40K queued emails.

by reading them, here is same example:
Message  2:
From root@PRODUCTION.localdomain  Thu Feb  2 16:41:01 2018
Return-Path: <root@PRODUCTION.localdomain>
X-Original-To: root
Delivered-To: root@PRODUCTION.localdomain
From: root@PRODUCTION.localdomain (Cron Daemon)
To: root@PRODUCTION.localdomain
Subject: Cron <root@PRODUCTION> /usr/local/
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Date: Thu,  2 Feb 2018 16:41:01 -0400 (EST)
Status: RO

It turn's out that one of the cron job runs every minute did not have a proprietary MAIL to settings.


* * * * *   root /usr/local/

I changed after:


* * * * *   root /usr/local/ >/dev/null 2>&1

Then purge all old emails both postfix queue and local mail:
$ postfix -d ALL

$ mail
& delete *
& q

Just want make it more clean, I try to remove the postfix package:
# chkconfig
# service postfix status
# service postfix stop
# chkconfig postfix off
# chkconfig

# yum erase postfix
But it also want remove

Which I still want it.

The cron require at lease one MTA on system.
Because we had smart host Email internal.
I did install my favorite SSMTP inside of sendmail.

First Backup the /etc/postfix
# cp -r /etc/postfix ~/etc_postfix_backup

# yum install ssmtp
# yum erase postfix

Setup the /etc/ssmtp/ssmtp.conf, did small test.

Everything looks good.

Please notice the server is not serve as an EMail server.


No comments:

Post a Comment