Ok so I have followed this tutorial, and restarted mysql server. However, whenever I go to run a query and then execute the query again, I see hardly any performance gain. It’s like a .200 sec gain which tells me that the cache isn’t working.
Here is the cache config from the my.cnf file.
# * Query Cache Configuration
#
query_cache_limit = 10M
query_cache_size = 256M
query_cache_type = 1
The way I am testing this is by running a Routine from the database. The routine consists of a simple SELECT statement that joins two small lookup tables.
show variable like '%query_cache%';
Results
have_query_cache YES
query_cache_limit 10485760
query_cache_min_res_unit 4096
query_cache_size 268435456
query_cache_type ON
query_cache_wlock_invalidate OFF
Edit 1
To add, when I look at the Server Health using Workbench. The query cache hitrate remains at 0%.
Ok so here is what solved my problem. I ended up enabling Remote Management in the MySql workbench. Then I went to the Configuration->Options File. It gave me an error stating that there was no section called [mysqld] and that it was going to add it. After that I went to the Performance tab, and noticed all of my checkboxes for the cache were unchecked. I checked all the values, MySql Workbench suggested I suffix my values with a K, M, or G when I input my cache values. After all of that I restarted the server and it was successfully caching my queries.
Not sure what all technical pieces changed in the config, but the workbench took care of everything for me.