[MDEV-15404] Feature Request: Implement Worklog (WL) #1874 - Thread Priority for Replication Created: 2018-02-24  Updated: 2019-02-05

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Chris Calender (Inactive) Assignee: Ralf Gebhardt
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When CPU is high, replication can lag after a while.

It would be nice to have the ability to increase the replication thread OS priority.

This worklog task was originally reported here:

https://dev.mysql.com/worklog/task/?id=1874



 Comments   
Comment by Ralf Gebhardt [ 2018-03-23 ]

Elkin, serg I need your opinions about this feature request. I see negative impacts for other threads, when the replication thread would get higher OS priority. If you see this as a useful enhancement, would it be a high effort to get it implemented?

Comment by Sergei Golubchik [ 2018-03-23 ]

No, it's a rather small task, low effort.

Comment by Daniel Black [ 2018-03-24 ]

So this would be as a CHANGE MASTER TO option? The WL mentions IO starvation which is less of a problem as at least Linux nice levels correspond to IO priority levels for blocking relay log reads, however applying changes means io_reader threads could still cause delay. Seems xtradb had os_thread_set_priority.

Is there the case for the master's replication thread to also increase priority too?

Comment by Sergei Golubchik [ 2018-03-24 ]

I didn't think of that yet, first I'd like to understand whether thread priority will actually help. Like, create a load where CPU is 100% utilized so that replication lags. Then just hard-code pthread_setschedprio for slave threads, and see if that helps. If it does, we can come up with some syntax for that.

Comment by Andrei Elkin [ 2018-11-30 ]

ralf.gebhardt@mariadb.com serg's practical suggestion makes sense. Needs to be done at least to learn about effects. An even if our result (of always limited tries) would be not so encouraging, they could be contrary elsewhere I think.

Generated at Thu Feb 08 08:21:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.