"nice" - boost process priority

Hello!

I would like to give Pi-hole, i.e. the dnsmasq network infrastructure part, a better process priority.
Is there a comfortable solution to set a static nice value that persists even on a reboot or update?

Thank you very much!

Hi
No, you would have to set a startup script to set it again.
To be exact you have to set it every time, the process is started again.
But why do you want to set a priority? Do you have so many processes that require the resources?

EDIT:
You can add an entry to the cronjob file to execute a command on startup.
Edit your cronjobs:
sudo crontab -e

Add the line:
@reboot renice -20 $(pidof dnsmasq)

renice sets your "niceness" value.
pidof gets the PID of the process named "dnsmasq".

But in my opinion I wouldn't change the nice value of any process.

Thank you very much for your reply.
My Pi-hole is running on a RPi3 beside some other home automation and reporting projects. One project is gathering different informations, these informations are periodically wraped, compressed and send away for further actions. The compressing part can last up to 3 minutes. During this time the cpu load is critical and Pi-hole (dnsmasq) on default settings as problems catching up.

If I set dnsmasq on nice -15 the service is fast even on constant 100% cpu load (short test with 'stress').

Ok. Maybe you should buy a second Raspberry to distribute the load ;).

Another RPi only for Pi-hole would be a easy solution but sheer waste of performance, money and energy. Because Pi-hole has a undemanding nature it is a very nice "en passant" service. Therefore I don't mind to give Pi-hole alot more priority, to ensure a fast and reliable service.

From my perspective I don't have to add performance, I have to steer performance. I don't care if the compressing in the backround lasts seconds or minutes longer as long Pi-hole is rock solid.

Aftermath:
I found a faulty USB flash drive that cause the trouble. Everytime data was writen on the drive the load of the system get out of control. Nontheless the system never encounter corrupt data or a crash.

I replaced the USB flash drive and everything is fast an smooth again.