Amavisd cant fork with a lot of emails

Antonio Gutiérrez Mayoral agutierr at gmail.com
Fri Feb 24 12:31:22 CET 2012


>From the logs:

[1975854.842224] 51730 total pagecache pages
[1975854.842226] 51672 pages in swap cache
[1975854.842227] Swap cache stats: add 8314730, delete 8263058, find
134959310/135609572
[1975854.842228] Free swap  = 0kB
[1975854.842229] Total swap = 1534168kB
[1975854.871486] 1048560 pages RAM
[1975854.871488] 50144 pages reserved
[1975854.871489] 27220 pages shared
[1975854.871490] 962447 pages non-shared
[1975854.871493] Out of memory: kill process 6695 (amavisd) score
509563 or a child
[1975854.871495] Killed process 6701 (amavisd)

I think that now the problem is clear, isn it? :-(

Antonio.



El día 24 de febrero de 2012 12:27, Antonio Gutiérrez Mayoral
<agutierr at gmail.com> escribió:
> I think that the problem is exactly that, also. I have only 1,5 GB of swap
> space, and 4 GB of ram. When this problem occurs, the RAM goes down to 1 GB
> free and swap about 350 MB :-(
>
> Im going to try increasing the swap space and observe the server :-). Thank you
> so much for your advice.
>
> Regards.
>
> Antonio.
>
> 2012/2/24 Mark Martinec <Mark.Martinec+amavis at ijs.si>:
>> Antonio,
>>
>>> First of all, sorry if this is not the right place to ask this
>>> question. We are setting upan antispam server using spamassassin,
>>> maia, amavisd-new, etc. All is ok. But, once in a while, we have
>>> problems in amavis, when create a new process to check attached data
>>> in an email.
>>>
>>> We are getting an strange message on postfix logs after a while. The
>>> message is like that:
>>>
>>> (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing,
>>> id=11968-01-10, mime_decode-1 FAILED: run_command (open pipe):
>>>
>>> Can't fork at /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/IO/File.pm
>>> line 188. at /usr/sbin/amavisd line 1657. (in reply to end of DATA
>>> command))  YYYYY <at> foo.bar
>>>
>>> I am afraid that the problem is there isn't enough resources to
>>> allocate a new thread. The message goes to the deferred queue. The
>>> problem is, that when its occurs, the deferred queue starts to
>>> increase quickly, and the memory goes down quickly also. For this
>>> reason I have configured via limits.conf to increase the process on
>>> the * account, but it doesnt works:
>>>
>>> /etc/security/limits.conf
>>>
>>> *       soft    nofile  65535
>>> *       hard    nofile  65535
>>> *       soft    nproc   65535
>>> *       hard    nproc   65535
>>>
>>> Amavis is running under the amavis user account. My server is a SLES
>>> 11 (virtual running under VMWARE), with 4 GB of ram
>>> and 1,5 GB of swap. When I have this problem, the free memory quickly
>>> goes down, like the swap. :(((
>>>
>>> Any ideas? So much thanks.
>>
>> See man page on fork(2). Besides nproc and MAXPROC limits, the next
>> likely cause for failing to fork is that the system run out of
>> swap space. My guess is that you hit the swap space exhaution,
>> and from then on things can only get worse. Make sure to have
>> sufficient swap space. It is common to allocate twice or four times
>> the size of RAM to swap.
>>
>>  Mark
>
>
>
> --
> --
> Antonio Gutiérrez Mayoral <agutierr at gmail.com>



-- 
--
Antonio Gutiérrez Mayoral <agutierr at gmail.com>


More information about the amavis-users mailing list