This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

New PostgreSQL using too many resources when high mail load.

For over two years I have been dealing with a massive DDOS dictionary style email attack from thousands of bots all over the world. Instead of blocking the entire Asia Pacific Supernet which is where most of the bots originate, Astaro handled the mass load pretty well as a mail proxy. That is until I upgraded to the 7.400 version. Ever since Astaro began to using Postgresql I have been forced to disable all reporting just to keep the server from overloading. But even with reporting disabled, the server still overloads during high peak times. On a normal rate, we get 30 to 40 emails per second, most of these emails are being blackholed, but the server does something it never did before, it hangs on to the smtp session with postgresql. I am not familiar with how exim interacts with the database when receiving email, but during a high peak mail attack there are thousands of processes seen when running "ps aux" that look like this:

postgres: postgres smtp 127.0.0.1(51177) INSERT

or this:

postgres: postgres smtp 127.0.0.1(51185) startup

After 5 seconds or so the processes end, but its not fast enough to keep up with the email coming in.

I am running 7.401 installed on a dual xeon server with 2 gig of ram. I only have the mail proxy configured and running, all other features have been disabled. I am using the exim.conf option "smtp_accept_max_per_host = 20" to keep the connections down, I thought it would help but these connections rarely reconnect from the same ip. 

I know you are probably thinking fix the botnet problem, but the server was handling this mass attack without a problem, everything started choking when the database was updated to postgresql. I am almost determined to go back to the Mysql version and never update again. If anyone can think of a better way, please let me know.


This thread was automatically locked due to age.
Parents
  • ...On a normal rate, we get 30 to 40 emails per second...

    ...I am running 7.401 installed on a dual xeon server with 2 gig of ram....

    ...I, like many people, do not pay for Astaro. It has always been free if you use less than 10 IP addresses...


    It's free if you're a "home" user - and up to 10 IP's are allowed to transit the gateway.  Otherwise, you should be paying.

    That's one heck of a setup if you are just a home user.

    The license terms also specifically mention those who use it as an e-mail gateway - and states that you're required to license each individual e-mail account.
  • If you aren't running a honey pot, why don't you get your ISP to null route the top five or six offending subnets?  I bet that would nail 90% of the traffic for you.

    Other than that, Eric may be right.  If an Astaro is used in a business, even a non-profit, Astaro's licensing terms for "home-use" are violated.  The "home-use" license is just that, strcitly for use at home.  You can click on my name and email the number of mailboxes to get an idea of how much the license would cost.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Couldn't have said it any better myself, Bob...  sure does sound like a popular personal email account otherwise...

    CTO, Convergent Information Security Solutions, LLC

    https://www.convergesecurity.com

    Advice given as posted on this forum does not construe a support relationship or other relationship with Convergent Information Security Solutions, LLC or its subsidiaries.  Use the advice given at your own risk.

  • Couldn't have said it any better myself, Bob...  sure does sound like a popular personal email account otherwise...

    I have 10 e-mail accounts and one of them gets over 500 messages a day.  I can see where he MAY have issues(i have been mailbombed before).

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

Reply
  • Couldn't have said it any better myself, Bob...  sure does sound like a popular personal email account otherwise...

    I have 10 e-mail accounts and one of them gets over 500 messages a day.  I can see where he MAY have issues(i have been mailbombed before).

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

Children
  • I will definitely take care of the licensing. As for the null routing, I would have to null route all of the Asia Pacific supernets because the bots all have different residential internet IPs from the APNIC. Astaro handled all of this mail like a champ when it used MYSQL, but eversince this change over to Postgre it can't handle load. William, 500 emails a day would be nice, but I get hit with an average of 400,000 to 600,000 emails a day, only about 100 or so actually are legit. Only I am going to roll back to the old version, and not update until I can get better server. Astaro is perfect for mail filtering, I would never change. But if anyone has any suggestions please reply.
  • I think 7.202 was the last with MySQL.

    BarryG did a great https://community.sophos.com/products/unified-threat-management/astaroorg/f/54/t/39136

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • I will definitely take care of the licensing. As for the null routing, I would have to null route all of the Asia Pacific supernets because the bots all have different residential internet IPs from the APNIC. Astaro handled all of this mail like a champ when it used MYSQL, but eversince this change over to Postgre it can't handle load. William, 500 emails a day would be nice, but I get hit with an average of 400,000 to 600,000 emails a day, only about 100 or so actually are legit. Only I am going to roll back to the old version, and not update until I can get better server. Astaro is perfect for mail filtering, I would never change. But if anyone has any suggestions please reply.


    If you get 400k to 600k of e-mails every day, and only 100 are legit, maybe it would make sense to bring up an entirely new domain name - or would a new domain get targeted too?  Is this for a controversial business?  Why are they a target?
  • I doubt a new domain would get targeted, that would definitely solve all problems. Unfortunately our domain name has been our main source of online business for over 19 years. The domain already gets tons of false email due to the fact that its been around for so long, but these attacks never stop and are very consistent, they are intended to take the mail server offline. Astaro does a great job of blackholing everything, but this database change is forcing me to either get a beefier server, or roll back to the MYSQL server version of Astaro.