maria-discuss team mailing list archive
Mailing list archive
Re: mariadb runs at lowest priority (nice -n 19) - PBXT code causing problems
On Jun 6, 2011, at 11:23 AM, Michael Widenius wrote:
"Paul" == Paul McCullagh <paul.mccullagh@xxxxxxxxxxxxx> writes:
Paul> The intension of this code was to set the priority of the
Paul> running thread only, not the entire program.
Paul> If the code is not working in this manner, then there is no
Paul> solution that to disable it.
Paul> However it would be nice in the cases where
Paul> does work, that it is called.
Agree, but I don't know how to test for this case :(
At least on linux, using setpriority() will not work with any modern
Paul> In the current code, pthread_setschedparam() is called when
Paul> pth_min_priority != pth_max_priority.
Current code ?
Do you mean that this has been changed recently ?
No, this has not been changed in years.
(It was not a long time ago when we merged with the latest pbxt, so I
assumed we have the latest code already).
The pbxt code in the MariaDB tree is bascily:
if (pth_min_priority == pth_max_priority)
It's the call to setpriority() that should be avoided in all cases.
Don't see how to fix this for linux except by adding an ifdef around
the call to setpriority().
Do you know of any system, except old obsolete linux systems, where
use setpriority() to set the priority for a thread?
I have done no research on this, so I think we should simply change
the code to:
if (pth_min_priority != pth_max_priority)
This would mean the thread priority is not changed, but that better
than mistakingly changing the program priority.