Enabling the Compiler Cache in Cloud Native Compiler
Cloud Native Compiler comes with an experimental early access of the Compiler Cache feature. The Compiler Cache stores previously performed optimizations and serves them from the cache rather than recompiling whenever possible. Running your workloads with a Compiler Cache leads to lower CNC CPU usage and faster warmup time.
To enable Compiler Cache:
-
Install using Helm, passing in the values-cnccache.yaml config file:
$ helm install compiler cnc-helm/prime-cnc -n compiler -f values-cnccache.yaml
Once your CNC service is configured to use the Compile Cache, all JVMs requesting compilations from that service will use the Compiler Cache. It typically takes ten to twenty runs before the cache is populated enough to provide optimum performance.
Note
|
In this experimental early access, Compile Cache is not scalable and can only handle a set amount of transactions before the database gets overloaded. We have successfully run 30 JVMs warming up the finnagle-http Renaissance workload, which requests around 3500 compilations.
|
Troubleshooting Overloaded Cache Database
In this experimental early access release, the Compiler Cache database cannot be scaled and can eventually get overloaded. When the database is overloaded with too many requests, the Grafana dashboard for the Cloud Native Compiler service will show the MariaDB node hitting the maximum number of cores.
An overloaded database can also cause the MariaDB node to be restarted. When the MariaDB node restarts, the Compiler Cache is empty and Cloud Native Compiler repopulates it from scratch.