Commit 21446be6 authored by dwentzel's avatar dwentzel

init commit

parents
-- active set in the buffer pool
SELECT (PagesData*PageSize)/POWER(1024,3) DataGB FROM
(SELECT variable_value PagesData
FROM information_schema.global_status
WHERE variable_name='Innodb_buffer_pool_pages_data') A,
(SELECT variable_value PageSize
FROM information_schema.global_status
WHERE variable_name='Innodb_page_size') B;
-- recommended innodb buffer pool size in GB
SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM
(SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
FROM information_schema.tables WHERE engine='InnoDB') A;
-- then set innodb_buffer_pool_size=8G
-- service mysql restart
-- innodb buffer pool size (or 75%, whichever is smaller)
SELECT
CONCAT(IB_BB/POWER(1024,1),'K') IB_KB,
CONCAT(IB_BB/POWER(1024,2),'M') IB_MB,
CONCAT(IB_BB/POWER(1024,3),'G') IB_GB
FROM (SELECT SUM(data_length+index_length) IB_BB
FROM information_schema.tables WHERE engine='InnoDB') A;
\ No newline at end of file
This diff is collapsed.
/*
this script truncates the necessary MySQL performance_schema tables to "reset" them, for instance,
for a load test
*/
use performance_schema;
truncate performance_schema.io_waits_summary_by_table;
truncate performance_schema.io_waits_summary_by_index_usage;
truncate performance_schema.file_summary_by_event_name;
truncate performance_schema.file_summary_by_instance;
truncate performance_schema.events_stages_history_long;
truncate performance_schema.events_statements_history_long;
truncate performance_schema.events_waits_current;
truncate performance_schema.events_waits_history;
truncate performance_schema.events_waits_history_long;
truncate performance_schema.events_waits_summary_by_account_by_event_name;
truncate performance_schema.events_waits_summary_by_host_by_event_name;
truncate performance_schema.events_waits_summary_by_instance;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
truncate performance_schema.events_waits_summary_by_user_by_event_name;
truncate performance_schema.events_waits_summary_global_by_event_name;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment