Threads_cached 0 while thread_cache_size > 0
When a client disconnects, the client's threads are put in the cache if there are fewer than thread_cache_size threads there.


In your case, it would read


  When a client disconnects, the client's threads are put in the cache if there are fewer than 4 threads there.


Also, note the following from the MySQL Documentation


  Normally, this does not provide a notable performance improvement if you have a good thread implementation. However, if your server sees hundreds of connections per second you should normally set thread_cache_size high enough so that most new connections use cached threads.


Given this statement, 4 would seem way too low. You should set it much higher or don't set it at all (letting MariaDB set it for you).