Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Postfix/amavis issue
PostPosted: Tue Aug 14, 2012 11:56 pm 
Offline
Newbie

Joined: Mon Mar 14, 2011 12:22 pm
Posts: 2
I am hoping someone can help me. I have been running a Linode 512 for approximately 1 year and in the last couple of weeks the server is having issues. It is a LAMP server also running Postfix, Dovecot and MySQL on Ubuntu 10.04. In addition I run SpamAssassin and Amavis. The issue is intermittently Amavis can no longer get a connection to localhost and all emails are refused with error messages as these
Aug 14 21:49:10 mail postfix/smtp[1032]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused

In addition, CPU usage and I/O spikes around the time these problems occur. I am not sure if the CPU and I/O issue cause the problem or vice versa the problem causes the CPU and I/O issues. I have tried adjusting the number of concurrent Amavis processes with not much luck. Also, when I do a top command it doesn't show either CPU or memory maxed out. I am both a newbie at Linux sysadmin and lost at this point. Any help would be much appreciated.
Thanks,
George

The mail server went down tonight and I found one additional clue in the log which looks like it ran out of memory
Aug 19 21:47:47 mail amavis[18888]: (!)Net::Server: 2012/08/19-21:47:31 Bad fork [Cannot allocate memory]\n at line 166 in file /usr/share/perl5/Net/Server/PreForkSimple.pm
Aug 19 21:47:50 mail amavis[18888]: Net::Server: 2012/08/19-21:47:48 Server closing!

Running out of memory late Sunday night seems odd since the server is working under a light load. Regardless, I bought another 90Mb but the server immediately consumed it.

Any suggestions on how to deal with this would be much appreciated.

Thanks
George


Top
   
 Post subject: Re: Postfix/amavis issue
PostPosted: Wed Aug 22, 2012 6:38 pm 
Offline
Senior Newbie

Joined: Sat Jan 28, 2012 8:08 am
Posts: 5
Newb here taking a shot at this one since I'm thinking of setting up something similiar.

Based on thread #12 of this post it seems like you are running OOM

Edit: But you purchased more memory it was consumed immediately. I wonder if you purchased enough?


Top
   
 Post subject: Re: Postfix/amavis issue
PostPosted: Wed Aug 22, 2012 10:19 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Not knowing anything about your setup, my initial suspicion would be that Apache is consuming all available memory. To control this, make sure MaxClients is set to a reasonable value (5 to 25 depending on how heavyweight your web application is).


Top
   
 Post subject: Re: Postfix/amavis issue
PostPosted: Wed Aug 22, 2012 11:48 pm 
Offline
Newbie

Joined: Mon Mar 14, 2011 12:22 pm
Posts: 2
I am definitely running out of memory - here is a log entry from yesterday
Aug 19 21:47:47 mail amavis[18888]: (!)Net::Server: 2012/08/19-21:47:31 Bad fork [Cannot allocate memory]\n at line 166 in file /usr/share/perl5/Net/Server/PreForkSimple.pm
I played around with apache settings and I am setup now as follows after tweaking it several times.
StartServers 1
MinSpareServers 3
MaxSpareServers 9
ServerLimit 9
MaxClients 9
MaxRequestsPerChild 3000
Also I raised the swap file size to be equal to the RAM size. I realize Linode recommends 1/2 RAM size but that seemed not to be enough as SWAP was filled up within 1/2 hour of running at the recommended value.
Also the max memory for Php was 128M which I lowered to 64M. This did not have much impact but none of the sites on the server need more than 64M so it seemed like a reasonable setting to change to.
With the current settings it's running OK right now and hopefully it remains so but only time will tell since the problem is intermittent.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group