1 (edited by Vortex 2021-02-10 20:31:19)

Topic: AMAVIS - How to set Nice level

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: Ubuntu 18.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Apache/NGinx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hello, I want to set Amavis to a nice level around 15 so other services take priority.  I have done a lot of looking and found where the file is that can accept a nice level, say Nice=15.
However that file amavis.service is in  /run/systemd/generator.late and is  "Automatically generated by systemd-sysv-generator"  Any changes made to the file are overwritten. 
I've tried putting the file amavis.service in /etc/systemd/system and /lib/systemd/system but systemd-sysv-generator or Amavis doesn't like that and throws an error.

Does anyone have any pointer on where to put the Nice=15 directive so that it will work?

Thanks in advance. smile

SOLVED see post below...

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: AMAVIS - How to set Nice level

** Anybody??? ** I can set with renice, but that method isn't persistent.

3

Re: AMAVIS - How to set Nice level

FYI: https://www.freedesktop.org/software/sy … .exec.html
Search "LimitNICE".

4

Re: AMAVIS - How to set Nice level

ZhangHuangbin wrote:

FYI: https://www.freedesktop.org/software/sy … .exec.html
Search "LimitNICE".

Thanks Zhang much appreciated.  I had found that directive and changed them previously.  Tried again for both files /etc/systemd/user.conf and /etc/systemd/system.conf and this time added =+15 rather than =15.  Still no change after restart the service or even a reboot.  For example:

#DefaultLimitMSGQUEUE=
#DefaultLimitNICE=
## => https://www.freedesktop.org/software/systemd/man/systemd.exec.html
# 2021.02.05
DefaultLimitNICE=+15
##
#DefaultLimitRTPRIO=
PID       NI CMD
1913   0 /usr/sbin/amavisd-new (master)
2434   0 /usr/sbin/amavisd-new (ch1-avail)
sudo systemctl status amavis.service
● amavis.service - LSB: Starts amavisd-new mailfilter
   Loaded: loaded (/etc/init.d/amavis; generated)
   Active: active (running) since Fri 2021-02-05 15:27:32 AEDT; 22min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 890 ExecStart=/etc/init.d/amavis start (code=exited, status=0/SUCCESS)
    Tasks: 2 (limit: 2348)
   CGroup: /system.slice/amavis.service
           ├─1913 /usr/sbin/amavisd-new (master)
           └─2434 /usr/sbin/amavisd-new (ch1-avail)

Like I mentioned earlier, tried to set this in limits.conf but amavis doesn't like that.

Any other thoughts?  Perhaps a forum?  I looked around but couldn't find anything that looked worthwhile.
Thanks in advance.

5 (edited by Vortex 2021-02-07 08:43:16)

Re: AMAVIS - How to set Nice level

Me again... Hopefully, someone will come up with a proper solution and post it here. 
I cannot find a way to do this.  So for now I have created an hourly CRON job as a temporary fix.

renice -n 19 -u amavis >/dev/null #output on error only

The reason for the CRON is that the renice is temporary and every time the daemon restart occurs the renice is lost. It might be a bit messy but at least it solved the problem until a fix comes along. 

I've tried joining the amavis list but no reply as yet. https://lists.amavis.org/cgi-bin/mailma … avis-users
Until then...

6

Re: AMAVIS - How to set Nice level

SOLVED
Many thanks to Dominic at amavis users list.
https://lists.amavis.org/pipermail/amav … 06288.html