View previous topic :: View next topic |
Author |
Message |
araxon Tux's lil' helper
Joined: 25 May 2011 Posts: 83
|
Posted: Tue Sep 20, 2016 8:47 am Post subject: [SOLVED] What is changing the priority of my daemons? |
|
|
I have several dedicated physical Gentoo servers. They are usually running only one "main" daemon per server (one physical server for apache, one physical server for postgresql, one physical server for NFS, etc.). Sometimes this main daemon suddenly changes its nice level from 0 to 2 (priority from 20 to 22). When I first noticed this, it happened to the postgresql-9.0, maybe one year ago. I dismissed it at the time as a memory glitch and restarted the daemon. It then got its priority back to 20. But it happened again to postgresql-9.5 on another server (on Aug 26), and apache-2.2 on yet another server (on Sep 15). In all cases the priority has changed to 22. It is just too much of a coincidence and it got me uneasy about what is going on.
There must be something that is doing renice of these daemons, but I did not install any such package, nor do I remember such setting in linux kernel. I searched the web (and this forum) as best as I can, but no other user seems to experience this behavior. All the search results point either to renice command (which is invoked manually), or to autonice daemon (which I do not have installed).
The message log is not showing anything unusual for that day, neither the dmesg. I'm the only person that is logging to these servers. It is not a big problem, as there is literally nothing else on these servers that could benefit from the "niceness" of the "main" daemon. But I like my servers being deterministic and I would really like to get to the root of the issue - what process is doing this and why?
The servers are IBM xSeries, with ECC memory, Gentoo linux 64bit, OpenRC, and apart from its main daemon are running only acpid, atd, fail2ban, iptables, nfsclient, sendmail, sshd, syslog-ng, and vixie-cron.
Did anyone else experience this behavior? Is it something that is related to Gentoo only? Can I debug or trace this somehow during normal operation?
EDIT: marked as SOLVED
Last edited by araxon on Tue Sep 20, 2016 5:14 pm; edited 1 time in total |
|
Back to top |
|
|
araxon Tux's lil' helper
Joined: 25 May 2011 Posts: 83
|
Posted: Tue Sep 20, 2016 5:14 pm Post subject: |
|
|
Well, it seems that I have to answer myself.
I did find out what was causing this. I backtraced to what I did on Sep 14 and Aug 25 (exactly one day before the priority changes). I was updating the servers and I needed to restart the service. But I just didn't want to do it straight away. So I used at, like this:
Code: | server # at 03:30
at> /etc/init.d/apache2 restart
at> CTRL+D
job 3 at Wed Sep 15 03:30:00 2016 |
Apparently the at commands are being executed with nice level of 2 when no queue is specified. The nice level then transpires to any processes spawned from the commands. So nothing was changing the priority of my running daemons. The daemons were restarted from within a niced environment.
Mystery solved. |
|
Back to top |
|
|
|
|
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 You cannot vote in polls in this forum
|
|