You can sort of achieve it at database level to a limited extent, but
it will never be completely clear cut.
For RAM, you can do it with global allocations
(innodb_buffer_pool_size, innodb_log_buffer_size, key_buffer_size,
aria_pagecache_buffer_size), but not for everything that is allocated
per thread (join_buffer_size, sort_buffer_size) or per query
(max_allowed_packet) or multiple times per query (tmp_table_size).
Theoretical maximum memory usage can vastly outsize the global
allocations if you run with a lot of threads.
For CPU you could try to limit the number of threads
(innodb_thread_concurrency), and that will limit the CPU usage to that
many CPU cores, but if I remember correctly that setting went away
with 10.6 release, and without it I don't think there is another way.
So you are out of luck if you are not willing or able to use ulimit
and taskset to set hard limits on memory and CPU core usage.
On Fri, 21 Mar 2025 at 19:53, jaswanth.at.work--- via discuss
<discuss@lists.mariadb.org> wrote:
>
> We are running multiple instances of mariadb using mysqld_multi on RHEL Server. We want to allocate CPU, RAM based on their individual instance workloads. We had seen that configuring innnodb parameters will do that, but what are the exact parameters we need to configure to allocate CPU Cores, RAM to the specific instance. We want to do it at database level not at OS level. What is the way to do this ?
> _______________________________________________
> discuss mailing list -- discuss@lists.mariadb.org
> To unsubscribe send an email to discuss-leave@lists.mariadb.org
--
Gordan Bobic
Database Specialist, Shattered Silicon Ltd.
https://shatteredsilicon.net