High CPU usage by mariadb even after allocated more memory to mariadb?

Solution 1:

200% isn't a lot of CPU when you have 16 cores. 200% is two full cores (amongst the 16 you have in an r4.4xlarge). Considering the amount of memory you have in use, MariaDB is certainly up to something. The fact that you are only using 2 of your 16 cores, I'd say you were under utilising CPU.

Use the htop utility to better see mariaDB's use of the cores.

Solution 2:

There was a bug https://jira.mariadb.org/browse/MDEV-15016 . That bug got fixed. Use latest version (10.2.13, 10.3.5) and verify everything is OK again.