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
Servers
SMTP reply codes
Troubleshooting
TATA Photon+: Error 638
Websites
How to Force detecting the Social Profiles associated with a Website
PHP
Enable memcache in WAMP
Optimization
PHP Code Optimization
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

MySQL
Script to convert InnoDB tables to MyISAM
Optimization
PHP Code Optimization
PHP
Apache Prefork versus Worker
Linux
Manage and Tweak Dedicated Linux Hosting Web Server

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

Our links

  • Chandigarh Business Information Directory
  • Chandigarh City Business Information Directory
  • Customer Services, Support, Helpline, Toll Free Numbers
  • HelpDesk Punjab Business Directory
  • Indian Business Helpline Directory
  • Indian Cities Yellow Pages
  • Nice Time Pass Jokes Quotes Stories
  • Online Applications for Admissions / Jobs / Positions / Employment
  • Technical, Engineering, Medical Directory
  • Technology Forum
  • The Chandigarh City Business Pages
  • Tricity Helpline Chandigarh, Mohali, Panchkula – Business Directory

Copyright © 2026 Technology Forum.

Theme: Oceanly News by ScriptsTown