Trouble with Amavisd

Discussion in 'Installation/Configuration' started by stef157, Nov 13, 2014.

  1. stef157

    stef157 Member

    Hello all,
    I get 5 to 10 times per day an error with amavisd.

    I get this error from Monit :
    I've read that should come from the memory…
    But here is some information :

    As you see… the server seem not overused…
    I'm running debian 7.4
    With ISPConfig 3.0.5.4 - dovecot - postfix - patch DKIM - Nginx - PHP5

    An idea where I can investigate ?

    Thanks
     
  2. zion

    zion Member

    Same here

    I have the same problem.

    amavisd-release version 1.51
    debian 7.7 - ISPConfig 3.0.5.4p3 - dovecot 2.1.7 - postfix 2.9.6-2 - apache 2.2.22 - PHP5

    I'm without solution too.
    Thank you for your help in advance.
     
  3. stef157

    stef157 Member

    up…
    Nobody have an idea ?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    you can try to increase the number of amavisd instances and the postfix connections to amavisd.
     
  5. stef157

    stef157 Member

    Thanks !

    I've to do like this ?
    Code:
    amavis unix - - - - 2 smtp
            -o smtp_data_done_timeout=1200
            -o smtp_send_xforward_command=yes
            [COLOR="Red"]-o max_use=20[/COLOR]
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    No, you have to change:

    amavis unix - - - - 2 smtp

    to

    amavis unix - - - - 5 smtp

    and then add:

    $max_servers = 5;

    in amavisd.conf file (or in one of the files in /etc/amavis/conf.d/ on debian and ubuntu) and then restart postfix and amvisd.

    20 daemons are too much, try 5 first and you can increase that later if nescessary.
     
  7. Numerizen

    Numerizen Member

    Just to clarify, for Debian, as per : https://help.ubuntu.com/community/PostfixAmavisNew, you have to :

    - Change the line in /etc/postfix/master.cnf

    amavis unix - - - - X smtp
    (NOT : smtp-amavis unix - - - - X smtp)

    ... where X is the number of processes to allow.

    - Add the following line at the end of /etc/amavis/conf.d/50-user :

    $max_servers = X;

    ... where X must be the same number as above.

    Then :

    sudo /etc/init.d/amavis restart
    sudo postfix reload
    __________

    Don't know if it will solve the recurring crashes problem, but will tell you if it seems to stabilize the situation.

    I hope so, because it's a very annoying problem.
     
    Last edited: Nov 21, 2014
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    the post you referred to is for a different kind of setup, so it does not apply to an ispconfig server. The line in master cf is named:

    amavis unix - - - - 2 smtp

    and not

    smtp-amavis unix - - - - X smtp

    Do not alter the name of the line as it will break your server.
     
  9. stef157

    stef157 Member

    Work fine ;-) !
     
  10. Numerizen

    Numerizen Member

    Edited my post to emphasis the difference.

    Sorry for the mistake.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    No problem at all :) I just wanted to prevent that someon accidently breaks his setup.
     
  12. Numerizen

    Numerizen Member

    The solution didn't solve the problem : amavis crached again yesterday, with the same side effects.

    I searched the web a lot about this issue, but couldn't find anything else than workarounds.

    It doesn't seem to be ISPC specific though, but it definitely affects the Perfect Server Tutorial for Wheezy.

    Would really love to find a viable solution to this, as it involves server access to be solved and is critical/urgent when it appears.
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    I maintain many servers for clients and just one server ahs this issue as well, it is a system virtualized with vmware. I was not able to find the reason for that, it is a exact copy of other systems that dont have any issues. So it might be related to the virtualisation or mybe even hardware (ram).

    The workaround that works there is to monitor amavisd with monit to restart it when it failed. As postfix and dovecot are not affected, the amavis failures for max. 60 seconds that happens 1-2 timesa month have no negative impact, jus spam scanning is delaeyd for a few seconds during the failure.
     
  14. Numerizen

    Numerizen Member

    OK thanks for this. I already thought about "moniting" amavis, but don't know how to tell monit to restart another service when one fails.

    As I have to start clam (also down on these occasions) and restart postfix, didn't think it would be enough.

    Are you sure restarting amavis will suffice ?

    If yes, will this in monitrc will be OK ? :

    check process amavisd with pidfile /var/run/amavis/amavisd.pid
    group mail
    start program = "/etc/init.d/amavis start"
    stop program = "/etc/init.d/amavis stop"
    if failed port 10024 protocol smtp then restart
    if 5 restarts within 5 cycles then timeout
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    In my case, its enough. If you want to restart multiple services, why not just create 2 short bash scripts, one that contains all stop commands and another one with all start commands and call these scripts from within monit in case of a failure.
     
  16. Numerizen

    Numerizen Member

    Well, I'm not that good with monit (nor bash either).

    I went with this :

    monitrc :

    check process amavisd with pidfile /var/run/amavis/amavisd.pid
    group mail
    start program = "/etc/init.d/amavis start"
    stop program = "/etc/init.d/amavis stop"
    if failed port 10024 protocol smtp then exec /usr/src/restart_mailserver.sh
    if 5 restarts within 5 cycles then timeout

    restart_mailserver.sh

    !#/bin/sh

    /etc/init.d/amavis start
    /etc/init.d/clamav-daemon start
    /etc/init.d/postfix restart
    postqueue -f

    Tried to shutdown amavis manually but everything got messed up. The services don't seem to appreciate that way of managing them. I guess each command has to wait until the previous is finished, what do you think ?
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    First, the bash line is wrong, it shuld be "#!/bin/bash". Then I would create a start script and a stop script and I would call them as "start program" and "start program" instead of the amavis init script.
     

Share This Page