Skip to content

Technology Forum

SEO, Speed Up website, Server Optimization, Linux, Open Source Softwares

  • Home
  • General
    • Web Server
    • Website Formatting
  • IT Companies
  • Optimization
    • PHP
  • Linux
  • Home
  • Optimization
  • PHP
  • Calculate Query Cache
Plesk Panel
Plesk: Disable Nginx and Rebuild Httpd Configuration
IT Companies
Hewlett Packard (HP) Journey
HTML
HTML: Attributes of rel
General
Popular Sites run on which Platforms?
PHP
Apache Prefork versus Worker
Domain Name
Guide to Domain Name Status Codes

Calculate Query Cache

Posted on May 6, 2018June 18, 2022 By admin No Comments on Calculate Query Cache
MySQL, PHP

Calculate the Query cache using MySQL command:

SELECT FORMAT(((QCACHE_HITS / (Qcache_hits + Qcache_inserts + Qcache_not_cached))*100),2) AS query_cache_hit_rate_percentage, QCACHE_FREE_BLOCKS, QCACHE_FREE_MEMORY, QCACHE_HITS, QCACHE_INSERTS, QCACHE_LOWMEM_PRUNES, QCACHE_NOT_CACHED, QCACHE_QUERIES_IN_CACHE, QCACHE_TOTAL_BLOCKS
FROM (
SELECT
MAX(IF(VARIABLE_NAME = ‘QCACHE_FREE_BLOCKS’, VARIABLE_VALUE, NULL)) QCACHE_FREE_BLOCKS,
MAX(IF(`VARIABLE_NAME` = ‘QCACHE_FREE_MEMORY’, VARIABLE_VALUE, NULL)) QCACHE_FREE_MEMORY,
MAX(IF(`VARIABLE_NAME` = ‘QCACHE_HITS’, VARIABLE_VALUE, NULL)) QCACHE_HITS,
MAX(IF(`VARIABLE_NAME` = ‘QCACHE_INSERTS’, VARIABLE_VALUE, NULL)) QCACHE_INSERTS,
MAX(IF(`VARIABLE_NAME` = ‘QCACHE_LOWMEM_PRUNES’, VARIABLE_VALUE, NULL)) QCACHE_LOWMEM_PRUNES,
MAX(IF(`VARIABLE_NAME` = ‘QCACHE_NOT_CACHED’, VARIABLE_VALUE, NULL)) QCACHE_NOT_CACHED,
MAX(IF(`VARIABLE_NAME` = ‘QCACHE_QUERIES_IN_CACHE’, VARIABLE_VALUE, NULL)) QCACHE_QUERIES_IN_CACHE,
MAX(IF(`VARIABLE_NAME` = ‘QCACHE_TOTAL_BLOCKS’, VARIABLE_VALUE, NULL)) QCACHE_TOTAL_BLOCKS
FROM information_schema.global_status
WHERE VARIABLE_NAME LIKE “QCACHE%”
) AS stats;

Post navigation

❮ Previous Post: Resolving Public DNS Server List
Next Post: WCAG 2.0 checklist ❯

You may also like

PHP
Using PHP script to delete a multiple files
PHP
SSL Certificate
PHP
TIPS
PHP
Goodbye to DDOS

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

View Posts

  • PHP FPM modification – Plesk
  • HTML: Link rel – Preload
  • HTML: Attributes of rel
  • Linux Commands
  • Security HTTP Headers

Categories

  • Domain Name
  • General
    • Servers
    • Web Server
    • Website Formatting
  • IT Companies
  • Linux
  • MySQL
  • Optimization
    • PHP
  • Troubleshooting
  • Web Hosting Control Panel
    • Plesk Panel
  • Websites
    • CSS
    • HTML
    • Optimization
  • Windows
    • Windows 10

Recent Posts

  • PHP FPM modification – Plesk
  • HTML: Link rel – Preload
  • HTML: Attributes of rel
  • Linux Commands
  • Security HTTP Headers

Copyright © 2025 Technology Forum.

Theme: Oceanly News by ScriptsTown