MariaDB thread_pool_size tuning
Yes, it is going to be counterproductive. You can set it slightly higher than CPU count, maybe 2*CPU count, but not 12.5*CPU count. You do not want 500 connection to execute at the same time, CPU-bound. you only want to use as many  CPUs as you got.