Mail server often slow

Discussion in 'General' started by Lorenzo Martini, Oct 9, 2019 at 2:22 PM.

  1. Lorenzo Martini

    Lorenzo Martini New Member

    About 6 months ago, I have bought a VPS from Aruba, to use as a web and mail server for my projects.
    I have installed ISP Config following this tutorial https://www.howtoforge.com/tutorial...-stretch-apache-bind-dovecot-ispconfig-3-1/3/. I use web server, ftp server and database server without problem, but the only flaw is the mail server.
    It's usually unreachable from mail client such as Mail (WIN10) or Thunderbird: it stays about five minutes trying to donwload messages, and at the end it fails with timeout.
    Domains which point to VPS are mrtsolutions.it and tech.croceverdeponte.it (last only mail server).
    About 1 time of 3 it's all ok and I can do everything without waiting.
    For example on Mail (WIN10) I have 2 outgoing email from ***@tech.croceverdeponte.it and after 20 minutes they're always in "outgoing" section.
    Sometimes it gives me "error in login into this account", it let me change the password and that's all ok, i can send/receive email. After 10 minutes same errors again.

    Can you help me?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    It is hard to help with the little information you provided.
    Show the output of the following commands, and show the in CODE tags, please.
    Code:
    free -h
    uptime
    df -hT
    mailq
     
  3. Lorenzo Martini

    Lorenzo Martini New Member

    free -h
    Code:
    [email protected]:~# free -h
                  total        used        free      shared  buff/cache   available
    Mem:           991M        650M        124M         20M        216M        185M
    Swap:          1.0G        906M        117M
    
    uptime
    Code:
     15:29:09 up 3 days, 44 min,  1 user,  load average: 0.01, 0.04, 0.04
    
    df -hT
    Code:
    Filesystem             Type      Size  Used Avail Use% Mounted on
    udev                   devtmpfs  485M     0  485M   0% /dev
    tmpfs                  tmpfs     100M   15M   85M  15% /run
    /dev/mapper/vg-lv_root ext4       19G  4.1G   14G  24% /
    tmpfs                  tmpfs     496M     0  496M   0% /dev/shm
    tmpfs                  tmpfs     5.0M     0  5.0M   0% /run/lock
    tmpfs                  tmpfs     496M     0  496M   0% /sys/fs/cgroup
    /dev/sda1              ext2      236M   63M  161M  28% /boot
    tmpfs                  tmpfs     100M     0  100M   0% /run/user/0
    
    mailq
    Code:
    Mail queue is empty
    
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    One GB memory may be a bit cramped, but at the moment the load is very small (as seen by uptime). That host uses almost all swap, and swap is 4 orders of magnitude slower than RAM. If you can add memory, another GB would help.
    I would install htop and dstat, and keep them running in separate terminal windows. Then when you notice there is that very slow service, see what htop and dstat show.
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Just an idea: maybe that host already runs out of memory. I think this should show if that is the case, but I do not have out of memory host right now to check:
    Code:
    grep -i "out of memory" /var/log/syslog /var/log/messages
     
    till likes this.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    In addition to what @Taleman posted, check if you have any out or memory errors in the syslog and it might be that your internet access provider has a very bad connection to your vps.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    There I was a bit too late :D
     
  8. Lorenzo Martini

    Lorenzo Martini New Member

    empty output! so no errors
     
  9. Lorenzo Martini

    Lorenzo Martini New Member

    i don't think so, italian best hosting provider :)
     
  10. Lorenzo Martini

    Lorenzo Martini New Member

    I give 1 extra gb to ram, so now it's 2 gb
    Code:
    [email protected]:~# free -h
                  total        used        free      shared  buff/cache   available
    Mem:           2.0G        1.2G        148M         46M        613M        550M
    Swap:          1.0G         17M        1.0G
    I will try if this upgrade will increase performance. Thank you
     
  11. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If that host still runs out of memory, addig more swap would prevent out of memory situations. But that 2 G RAM + 1 G swap should be enough, of course depending on what else is using memory on that host.
     
  12. Lorenzo Martini

    Lorenzo Martini New Member

    Now i can't connect again to my mailbox. My /var/log/mail.info:
    Code:
    Oct  9 18:57:57 srv postfix/smtpd[22064]: warning: hostname cata4.atacado.sampa.br does not resolve to address 185.36.81.16: Name or service not known
    Oct  9 18:57:57 srv postfix/smtpd[22064]: connect from unknown[185.36.81.16]
    Oct  9 18:57:57 srv postfix/smtpd[22064]: lost connection after AUTH from unknown[185.36.81.16]
    Oct  9 18:57:57 srv postfix/smtpd[22064]: disconnect from unknown[185.36.81.16] ehlo=1 auth=0/1 commands=1/2
    Oct  9 18:58:15 srv postfix/smtpd[21850]: connect from unknown[45.142.195.5]
    Oct  9 18:58:16 srv postfix/smtpd[21850]: disconnect from unknown[45.142.195.5] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Oct  9 18:58:21 srv postfix/smtpd[22064]: connect from unknown[46.38.144.202]
    Oct  9 18:58:25 srv postfix/smtpd[22064]: disconnect from unknown[46.38.144.202] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Oct  9 18:58:26 srv dovecot: imap-login: Disconnected (no auth attempts in 1 secs): user=<>, rip=198.108.67.80, lip=80.211.111.241, TLS: Disconnected, session=<Qc2CMX2$
    Oct  9 18:58:48 srv postfix/smtpd[21850]: connect from unknown[141.98.10.55]
    Oct  9 18:58:48 srv postfix/smtpd[21850]: lost connection after AUTH from unknown[141.98.10.55]
    Oct  9 18:58:48 srv postfix/smtpd[21850]: disconnect from unknown[141.98.10.55] ehlo=1 auth=0/1 commands=1/2
    Oct  9 18:59:03 srv postfix/smtpd[22064]: connect from unknown[45.142.195.5]
    Oct  9 18:59:04 srv postfix/smtpd[22064]: disconnect from unknown[45.142.195.5] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    Oct  9 18:59:08 srv postfix/smtpd[22064]: connect from unknown[46.38.144.17]
    Oct  9 18:59:12 srv postfix/smtpd[22064]: disconnect from unknown[46.38.144.17] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
    
    I see a lot of connection, is this normal?
     
  13. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Your connecting to mailbox is that dovecot line. The other lines in log are about postfix sending and receiving e-mails, or other mail servers disconnecting or being disconnected by your server. Usual things in e-mail server.
    Is rip=198.108.67.80 your IP-number where you try to connect to mailbox?
    Try
    Code:
    tail -f /var/log/mail.log | grep dovecot
    and let that run in one terminal window, then try connecting to your mailbox.
     

Share This Page