[systemd-devel] setting cpulimit/iolimit on mysql thread not entire process

Michal Koutný mkoutny at suse.com
Wed Dec 20 16:58:26 UTC 2023


Hello.

On Tue, Nov 28, 2023 at 08:35:29AM +0200, Mantas Mikulėnas <grawity at gmail.com> wrote:
> 1) the limits are per-cgroup and the entire service is a single cgroup;

They could create own service unit for the DB with Delegate=cpu,io and
create a subtree manually.

> 2) the threads are created by mysqld, 

That^^ Picking random threads out of the service and enforcing control
on them without considering their internal dependencies is asking
for^W^W creating hard-to debug troubles.

> 3) afaik, in cgroups v2 it isn't even allowed for threads of a single
> process to straddle multiple cgroups anymore.

It depends on enabled controllers, threaded subtrees for controllers
have thread granularity (cpu does, io not).

> I'm not a DBA but I've heard that one common way to handle this would be to
> create a separate MySQL instance (probably on a separate machine, even)
> that would replicate all the data, for the heavy users to query.

That sounds like much more sensible approach.

SCNR,
Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20231220/34f8b85d/attachment.sig>


More information about the systemd-devel mailing list