MySQL 100% CPU every 12-18 hours












1















I've inherited a Windows Server (2016) and we have a proprietary piece of software not written by me which uses a MySQL db. I am a novice w/ SQL.



There is client software that will connect to the server randomly throughout the day. Anywhere between 10 and 200 different computers will log into this server throughout the day depending on how busy we are.



We use a VPS w/ 4 virtual cores and 8GB of RAM and a 204GB local disk.



It seems like every 12-18 hours we have issues where our software will hang, Task Manager then shows 99-100% CPU usage for mysqld



It doesn't act normally again until I force quit the software and then restart the mysql service.



Here is the settings file I tracked down that was previously set up.



my.ini settings:



[client]
port=3306
[mysql]
no-beep=
default-character-set=utf8
[mysqld]
port=3306
datadir=C:/ProgramData/MySQL/MySQL Server 5.7Data
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-output=FILE
general-log=0
general_log_file="xyz.log"
slow-query-log=1
slow_query_log_file="xyz-slow.log"
long_query_time=10
log-error="xyz.err"
server-id=1
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"
max_connections=151
table_open_cache=2000
tmp_table_size=249M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=486M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=8M
innodb_log_file_size=48M
innodb_thread_concurrency=13
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000


Here's a pic of MySQLTuner for Windows and it's results:
mysql_tuner



Just looking for some insight into what we can do here to help alleviate this issue. It appears we need to run OPTIMIZE to fix the fragmentation of the tables.



It also shows 23M selects with 0% caching.



The innodb data size / buffer pool is 687M/8M



Any help would be appreciated.



[EDIT]



I just ran the following command that I found in another thread:



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;


I got a value of 2 back, so I should probably set innodb_buffer_pool_size=2G?



SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024;

will be fine. You have 8GB machine. I will take a while for MySQL to dynamically get this in place. Check in 30 minutes with SELECT @@innodb_buffer_pool_size; to see if it has accomplished your dynamic request.



Here's what SHOW CREATE TABLE recipes looks like:



mysql> USE xyz; SHOW CREATE TABLE recipes;
Database changed
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| recipes | CREATE TABLE `recipes` (
`id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`dname` varchar(64) NOT NULL DEFAULT '',
`descrpara` text NOT NULL,
`category` varchar(32) NOT NULL,
`costperserving` float NOT NULL DEFAULT '0',
`batchsize` int(11) NOT NULL DEFAULT '1',
`servname` varchar(32) NOT NULL DEFAULT 'Serving',
`rectype` tinyint(4) NOT NULL DEFAULT '0',
`servweight` float NOT NULL DEFAULT '0',
`servflvol` float NOT NULL DEFAULT '0',
`flags` tinyint(4) NOT NULL DEFAULT '0',
`isapproved` tinyint(4) NOT NULL DEFAULT '0',
`isapproved2` tinyint(4) NOT NULL DEFAULT '0',
`tags` varchar(128) NOT NULL DEFAULT '',
`allrestr` tinyint(4) NOT NULL DEFAULT '0',
`numsides` tinyint(4) NOT NULL DEFAULT '0',
`utensils` varchar(64) NOT NULL DEFAULT '',
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


Again, I'm a super novice but could there be something where our my.ini file shows a default character set of utf8, but in this, it shows latin1?



I'll update these again after 24h



PasteBin links for



SHOW GLOBAL STATUS



SHOW GLOBAL VARIABLES



SHOW ENGINE INNODB STATUS





MySQLTuner after >1 day uptime. This is also after changing innodb_buffer_pool_size=8M to 1G. Total RAM usage for mysqld has been about 1.25G since then.



MySQL Tuner 0.8.3 - Peter Chapman <peter@conglomo.co.nz>
Performing tests on localhost:3306 at Friday, 16 November 2018 6:13:41 AM
Currently running supported MySQL version 5.7.24-log
Archive Engine Installed
Berkeley DB Engine Not Installed
Federated Engine Not Installed
InnoDB Engine Installed
ISAM Engine Not Installed
NDBCLUSTER Engine Not Installed
Data in InnoDB tables: 687M (Tables: 257)
Data in MyISAM tables: 6M (Tables: 32)
Total fragmented tables: 67
All database users have passwords assigned
Up for: 1d 10h 33m 15s (49M q [397.000 qps], 38K conn, TX: 43G, RX: 3G)
Reads / Writes: 99% / 1%
Total buffers: 1.0G global + 1.1M per thread (151 max threads)
Maximum possible memory usage: 1.2G (14% of installed RAM)
Slow queries: 1% (4/49M)
Highest usage of available connections: 26% (38/151)
Key buffer size / total MyISAM indexes: 8.0M/1.0M
Key buffer hit rate: 98% (630 cached / 9 reads)
Query cache efficiency: 0% (0 cached / 47M selects)
Query cache prunes per day: 0
Sorts requiring temporary tables: 1% (2K temp sorts / 377K sorts)
Joins performed without indexes: 13254
Temporary tables created on disk: 3% (2K on disk / 79K total)
Thread cache hit rate: 99% (41 created / 38K connections)
Table cache hit rate: 26% (2K open / 7K opened)
Open file limit used: 0% (10/6K)
Table locks acquired immediately: 100% (682 immediate / 682 locks)
InnoDB data size / buffer pool: 687.0M/1.0G
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
query_cache_limit (> 1M, or use smaller result sets)
join_buffer_size (> 256.0K, or always use indexes with joins)
Scan Completed at Friday, 16 November 2018 6:13:44 AM


SHOW GLOBAL STATUS - > 1 day uptime



SHOW GLOBAL VARIABLES - > 1 day uptime










share|improve this question




















  • 1





    Nope, if you see the mysql_tuner pic I linked, it's definitely 687M/8M. It actually used to run on linux but the programmer decided he wanted to run everything on Windows Server.

    – sla_seth
    Nov 14 '18 at 17:20













  • @sla_seth Your Windows platform will be fine for now - you have enough challenges at this time. Additional information request, please. Post on pastebin.com or here. A) complete (not edited) my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME, if possible C) SHOW GLOBAL VARIABLES; D) complete MySQLTuner report if you can get 24 hours of uptime E) SHOW ENGINE INNODB STATUS; for server tuning analysis.

    – Wilson Hauck
    Nov 14 '18 at 17:40













  • Run the mysqladmin pr -vvv command so you can view what queries are going on when this event happens. Could just be your software issuing a silly query that will take far too long to finish.

    – nos
    Nov 14 '18 at 17:42








  • 1





    Thank you all, I will try to update once we hit >24 hours uptime.

    – sla_seth
    Nov 14 '18 at 17:51











  • You have the Slowlog turned on; what does it tell you?

    – Rick James
    Nov 14 '18 at 17:58
















1















I've inherited a Windows Server (2016) and we have a proprietary piece of software not written by me which uses a MySQL db. I am a novice w/ SQL.



There is client software that will connect to the server randomly throughout the day. Anywhere between 10 and 200 different computers will log into this server throughout the day depending on how busy we are.



We use a VPS w/ 4 virtual cores and 8GB of RAM and a 204GB local disk.



It seems like every 12-18 hours we have issues where our software will hang, Task Manager then shows 99-100% CPU usage for mysqld



It doesn't act normally again until I force quit the software and then restart the mysql service.



Here is the settings file I tracked down that was previously set up.



my.ini settings:



[client]
port=3306
[mysql]
no-beep=
default-character-set=utf8
[mysqld]
port=3306
datadir=C:/ProgramData/MySQL/MySQL Server 5.7Data
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-output=FILE
general-log=0
general_log_file="xyz.log"
slow-query-log=1
slow_query_log_file="xyz-slow.log"
long_query_time=10
log-error="xyz.err"
server-id=1
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"
max_connections=151
table_open_cache=2000
tmp_table_size=249M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=486M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=8M
innodb_log_file_size=48M
innodb_thread_concurrency=13
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000


Here's a pic of MySQLTuner for Windows and it's results:
mysql_tuner



Just looking for some insight into what we can do here to help alleviate this issue. It appears we need to run OPTIMIZE to fix the fragmentation of the tables.



It also shows 23M selects with 0% caching.



The innodb data size / buffer pool is 687M/8M



Any help would be appreciated.



[EDIT]



I just ran the following command that I found in another thread:



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;


I got a value of 2 back, so I should probably set innodb_buffer_pool_size=2G?



SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024;

will be fine. You have 8GB machine. I will take a while for MySQL to dynamically get this in place. Check in 30 minutes with SELECT @@innodb_buffer_pool_size; to see if it has accomplished your dynamic request.



Here's what SHOW CREATE TABLE recipes looks like:



mysql> USE xyz; SHOW CREATE TABLE recipes;
Database changed
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| recipes | CREATE TABLE `recipes` (
`id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`dname` varchar(64) NOT NULL DEFAULT '',
`descrpara` text NOT NULL,
`category` varchar(32) NOT NULL,
`costperserving` float NOT NULL DEFAULT '0',
`batchsize` int(11) NOT NULL DEFAULT '1',
`servname` varchar(32) NOT NULL DEFAULT 'Serving',
`rectype` tinyint(4) NOT NULL DEFAULT '0',
`servweight` float NOT NULL DEFAULT '0',
`servflvol` float NOT NULL DEFAULT '0',
`flags` tinyint(4) NOT NULL DEFAULT '0',
`isapproved` tinyint(4) NOT NULL DEFAULT '0',
`isapproved2` tinyint(4) NOT NULL DEFAULT '0',
`tags` varchar(128) NOT NULL DEFAULT '',
`allrestr` tinyint(4) NOT NULL DEFAULT '0',
`numsides` tinyint(4) NOT NULL DEFAULT '0',
`utensils` varchar(64) NOT NULL DEFAULT '',
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


Again, I'm a super novice but could there be something where our my.ini file shows a default character set of utf8, but in this, it shows latin1?



I'll update these again after 24h



PasteBin links for



SHOW GLOBAL STATUS



SHOW GLOBAL VARIABLES



SHOW ENGINE INNODB STATUS





MySQLTuner after >1 day uptime. This is also after changing innodb_buffer_pool_size=8M to 1G. Total RAM usage for mysqld has been about 1.25G since then.



MySQL Tuner 0.8.3 - Peter Chapman <peter@conglomo.co.nz>
Performing tests on localhost:3306 at Friday, 16 November 2018 6:13:41 AM
Currently running supported MySQL version 5.7.24-log
Archive Engine Installed
Berkeley DB Engine Not Installed
Federated Engine Not Installed
InnoDB Engine Installed
ISAM Engine Not Installed
NDBCLUSTER Engine Not Installed
Data in InnoDB tables: 687M (Tables: 257)
Data in MyISAM tables: 6M (Tables: 32)
Total fragmented tables: 67
All database users have passwords assigned
Up for: 1d 10h 33m 15s (49M q [397.000 qps], 38K conn, TX: 43G, RX: 3G)
Reads / Writes: 99% / 1%
Total buffers: 1.0G global + 1.1M per thread (151 max threads)
Maximum possible memory usage: 1.2G (14% of installed RAM)
Slow queries: 1% (4/49M)
Highest usage of available connections: 26% (38/151)
Key buffer size / total MyISAM indexes: 8.0M/1.0M
Key buffer hit rate: 98% (630 cached / 9 reads)
Query cache efficiency: 0% (0 cached / 47M selects)
Query cache prunes per day: 0
Sorts requiring temporary tables: 1% (2K temp sorts / 377K sorts)
Joins performed without indexes: 13254
Temporary tables created on disk: 3% (2K on disk / 79K total)
Thread cache hit rate: 99% (41 created / 38K connections)
Table cache hit rate: 26% (2K open / 7K opened)
Open file limit used: 0% (10/6K)
Table locks acquired immediately: 100% (682 immediate / 682 locks)
InnoDB data size / buffer pool: 687.0M/1.0G
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
query_cache_limit (> 1M, or use smaller result sets)
join_buffer_size (> 256.0K, or always use indexes with joins)
Scan Completed at Friday, 16 November 2018 6:13:44 AM


SHOW GLOBAL STATUS - > 1 day uptime



SHOW GLOBAL VARIABLES - > 1 day uptime










share|improve this question




















  • 1





    Nope, if you see the mysql_tuner pic I linked, it's definitely 687M/8M. It actually used to run on linux but the programmer decided he wanted to run everything on Windows Server.

    – sla_seth
    Nov 14 '18 at 17:20













  • @sla_seth Your Windows platform will be fine for now - you have enough challenges at this time. Additional information request, please. Post on pastebin.com or here. A) complete (not edited) my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME, if possible C) SHOW GLOBAL VARIABLES; D) complete MySQLTuner report if you can get 24 hours of uptime E) SHOW ENGINE INNODB STATUS; for server tuning analysis.

    – Wilson Hauck
    Nov 14 '18 at 17:40













  • Run the mysqladmin pr -vvv command so you can view what queries are going on when this event happens. Could just be your software issuing a silly query that will take far too long to finish.

    – nos
    Nov 14 '18 at 17:42








  • 1





    Thank you all, I will try to update once we hit >24 hours uptime.

    – sla_seth
    Nov 14 '18 at 17:51











  • You have the Slowlog turned on; what does it tell you?

    – Rick James
    Nov 14 '18 at 17:58














1












1








1


1






I've inherited a Windows Server (2016) and we have a proprietary piece of software not written by me which uses a MySQL db. I am a novice w/ SQL.



There is client software that will connect to the server randomly throughout the day. Anywhere between 10 and 200 different computers will log into this server throughout the day depending on how busy we are.



We use a VPS w/ 4 virtual cores and 8GB of RAM and a 204GB local disk.



It seems like every 12-18 hours we have issues where our software will hang, Task Manager then shows 99-100% CPU usage for mysqld



It doesn't act normally again until I force quit the software and then restart the mysql service.



Here is the settings file I tracked down that was previously set up.



my.ini settings:



[client]
port=3306
[mysql]
no-beep=
default-character-set=utf8
[mysqld]
port=3306
datadir=C:/ProgramData/MySQL/MySQL Server 5.7Data
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-output=FILE
general-log=0
general_log_file="xyz.log"
slow-query-log=1
slow_query_log_file="xyz-slow.log"
long_query_time=10
log-error="xyz.err"
server-id=1
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"
max_connections=151
table_open_cache=2000
tmp_table_size=249M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=486M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=8M
innodb_log_file_size=48M
innodb_thread_concurrency=13
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000


Here's a pic of MySQLTuner for Windows and it's results:
mysql_tuner



Just looking for some insight into what we can do here to help alleviate this issue. It appears we need to run OPTIMIZE to fix the fragmentation of the tables.



It also shows 23M selects with 0% caching.



The innodb data size / buffer pool is 687M/8M



Any help would be appreciated.



[EDIT]



I just ran the following command that I found in another thread:



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;


I got a value of 2 back, so I should probably set innodb_buffer_pool_size=2G?



SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024;

will be fine. You have 8GB machine. I will take a while for MySQL to dynamically get this in place. Check in 30 minutes with SELECT @@innodb_buffer_pool_size; to see if it has accomplished your dynamic request.



Here's what SHOW CREATE TABLE recipes looks like:



mysql> USE xyz; SHOW CREATE TABLE recipes;
Database changed
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| recipes | CREATE TABLE `recipes` (
`id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`dname` varchar(64) NOT NULL DEFAULT '',
`descrpara` text NOT NULL,
`category` varchar(32) NOT NULL,
`costperserving` float NOT NULL DEFAULT '0',
`batchsize` int(11) NOT NULL DEFAULT '1',
`servname` varchar(32) NOT NULL DEFAULT 'Serving',
`rectype` tinyint(4) NOT NULL DEFAULT '0',
`servweight` float NOT NULL DEFAULT '0',
`servflvol` float NOT NULL DEFAULT '0',
`flags` tinyint(4) NOT NULL DEFAULT '0',
`isapproved` tinyint(4) NOT NULL DEFAULT '0',
`isapproved2` tinyint(4) NOT NULL DEFAULT '0',
`tags` varchar(128) NOT NULL DEFAULT '',
`allrestr` tinyint(4) NOT NULL DEFAULT '0',
`numsides` tinyint(4) NOT NULL DEFAULT '0',
`utensils` varchar(64) NOT NULL DEFAULT '',
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


Again, I'm a super novice but could there be something where our my.ini file shows a default character set of utf8, but in this, it shows latin1?



I'll update these again after 24h



PasteBin links for



SHOW GLOBAL STATUS



SHOW GLOBAL VARIABLES



SHOW ENGINE INNODB STATUS





MySQLTuner after >1 day uptime. This is also after changing innodb_buffer_pool_size=8M to 1G. Total RAM usage for mysqld has been about 1.25G since then.



MySQL Tuner 0.8.3 - Peter Chapman <peter@conglomo.co.nz>
Performing tests on localhost:3306 at Friday, 16 November 2018 6:13:41 AM
Currently running supported MySQL version 5.7.24-log
Archive Engine Installed
Berkeley DB Engine Not Installed
Federated Engine Not Installed
InnoDB Engine Installed
ISAM Engine Not Installed
NDBCLUSTER Engine Not Installed
Data in InnoDB tables: 687M (Tables: 257)
Data in MyISAM tables: 6M (Tables: 32)
Total fragmented tables: 67
All database users have passwords assigned
Up for: 1d 10h 33m 15s (49M q [397.000 qps], 38K conn, TX: 43G, RX: 3G)
Reads / Writes: 99% / 1%
Total buffers: 1.0G global + 1.1M per thread (151 max threads)
Maximum possible memory usage: 1.2G (14% of installed RAM)
Slow queries: 1% (4/49M)
Highest usage of available connections: 26% (38/151)
Key buffer size / total MyISAM indexes: 8.0M/1.0M
Key buffer hit rate: 98% (630 cached / 9 reads)
Query cache efficiency: 0% (0 cached / 47M selects)
Query cache prunes per day: 0
Sorts requiring temporary tables: 1% (2K temp sorts / 377K sorts)
Joins performed without indexes: 13254
Temporary tables created on disk: 3% (2K on disk / 79K total)
Thread cache hit rate: 99% (41 created / 38K connections)
Table cache hit rate: 26% (2K open / 7K opened)
Open file limit used: 0% (10/6K)
Table locks acquired immediately: 100% (682 immediate / 682 locks)
InnoDB data size / buffer pool: 687.0M/1.0G
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
query_cache_limit (> 1M, or use smaller result sets)
join_buffer_size (> 256.0K, or always use indexes with joins)
Scan Completed at Friday, 16 November 2018 6:13:44 AM


SHOW GLOBAL STATUS - > 1 day uptime



SHOW GLOBAL VARIABLES - > 1 day uptime










share|improve this question
















I've inherited a Windows Server (2016) and we have a proprietary piece of software not written by me which uses a MySQL db. I am a novice w/ SQL.



There is client software that will connect to the server randomly throughout the day. Anywhere between 10 and 200 different computers will log into this server throughout the day depending on how busy we are.



We use a VPS w/ 4 virtual cores and 8GB of RAM and a 204GB local disk.



It seems like every 12-18 hours we have issues where our software will hang, Task Manager then shows 99-100% CPU usage for mysqld



It doesn't act normally again until I force quit the software and then restart the mysql service.



Here is the settings file I tracked down that was previously set up.



my.ini settings:



[client]
port=3306
[mysql]
no-beep=
default-character-set=utf8
[mysqld]
port=3306
datadir=C:/ProgramData/MySQL/MySQL Server 5.7Data
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-output=FILE
general-log=0
general_log_file="xyz.log"
slow-query-log=1
slow_query_log_file="xyz-slow.log"
long_query_time=10
log-error="xyz.err"
server-id=1
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"
max_connections=151
table_open_cache=2000
tmp_table_size=249M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=486M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=8M
innodb_log_file_size=48M
innodb_thread_concurrency=13
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000


Here's a pic of MySQLTuner for Windows and it's results:
mysql_tuner



Just looking for some insight into what we can do here to help alleviate this issue. It appears we need to run OPTIMIZE to fix the fragmentation of the tables.



It also shows 23M selects with 0% caching.



The innodb data size / buffer pool is 687M/8M



Any help would be appreciated.



[EDIT]



I just ran the following command that I found in another thread:



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;


I got a value of 2 back, so I should probably set innodb_buffer_pool_size=2G?



SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024;

will be fine. You have 8GB machine. I will take a while for MySQL to dynamically get this in place. Check in 30 minutes with SELECT @@innodb_buffer_pool_size; to see if it has accomplished your dynamic request.



Here's what SHOW CREATE TABLE recipes looks like:



mysql> USE xyz; SHOW CREATE TABLE recipes;
Database changed
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| recipes | CREATE TABLE `recipes` (
`id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`dname` varchar(64) NOT NULL DEFAULT '',
`descrpara` text NOT NULL,
`category` varchar(32) NOT NULL,
`costperserving` float NOT NULL DEFAULT '0',
`batchsize` int(11) NOT NULL DEFAULT '1',
`servname` varchar(32) NOT NULL DEFAULT 'Serving',
`rectype` tinyint(4) NOT NULL DEFAULT '0',
`servweight` float NOT NULL DEFAULT '0',
`servflvol` float NOT NULL DEFAULT '0',
`flags` tinyint(4) NOT NULL DEFAULT '0',
`isapproved` tinyint(4) NOT NULL DEFAULT '0',
`isapproved2` tinyint(4) NOT NULL DEFAULT '0',
`tags` varchar(128) NOT NULL DEFAULT '',
`allrestr` tinyint(4) NOT NULL DEFAULT '0',
`numsides` tinyint(4) NOT NULL DEFAULT '0',
`utensils` varchar(64) NOT NULL DEFAULT '',
`active` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


Again, I'm a super novice but could there be something where our my.ini file shows a default character set of utf8, but in this, it shows latin1?



I'll update these again after 24h



PasteBin links for



SHOW GLOBAL STATUS



SHOW GLOBAL VARIABLES



SHOW ENGINE INNODB STATUS





MySQLTuner after >1 day uptime. This is also after changing innodb_buffer_pool_size=8M to 1G. Total RAM usage for mysqld has been about 1.25G since then.



MySQL Tuner 0.8.3 - Peter Chapman <peter@conglomo.co.nz>
Performing tests on localhost:3306 at Friday, 16 November 2018 6:13:41 AM
Currently running supported MySQL version 5.7.24-log
Archive Engine Installed
Berkeley DB Engine Not Installed
Federated Engine Not Installed
InnoDB Engine Installed
ISAM Engine Not Installed
NDBCLUSTER Engine Not Installed
Data in InnoDB tables: 687M (Tables: 257)
Data in MyISAM tables: 6M (Tables: 32)
Total fragmented tables: 67
All database users have passwords assigned
Up for: 1d 10h 33m 15s (49M q [397.000 qps], 38K conn, TX: 43G, RX: 3G)
Reads / Writes: 99% / 1%
Total buffers: 1.0G global + 1.1M per thread (151 max threads)
Maximum possible memory usage: 1.2G (14% of installed RAM)
Slow queries: 1% (4/49M)
Highest usage of available connections: 26% (38/151)
Key buffer size / total MyISAM indexes: 8.0M/1.0M
Key buffer hit rate: 98% (630 cached / 9 reads)
Query cache efficiency: 0% (0 cached / 47M selects)
Query cache prunes per day: 0
Sorts requiring temporary tables: 1% (2K temp sorts / 377K sorts)
Joins performed without indexes: 13254
Temporary tables created on disk: 3% (2K on disk / 79K total)
Thread cache hit rate: 99% (41 created / 38K connections)
Table cache hit rate: 26% (2K open / 7K opened)
Open file limit used: 0% (10/6K)
Table locks acquired immediately: 100% (682 immediate / 682 locks)
InnoDB data size / buffer pool: 687.0M/1.0G
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
query_cache_limit (> 1M, or use smaller result sets)
join_buffer_size (> 256.0K, or always use indexes with joins)
Scan Completed at Friday, 16 November 2018 6:13:44 AM


SHOW GLOBAL STATUS - > 1 day uptime



SHOW GLOBAL VARIABLES - > 1 day uptime







mysql database windows innodb database-performance






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 11:54







sla_seth

















asked Nov 14 '18 at 16:54









sla_sethsla_seth

63




63








  • 1





    Nope, if you see the mysql_tuner pic I linked, it's definitely 687M/8M. It actually used to run on linux but the programmer decided he wanted to run everything on Windows Server.

    – sla_seth
    Nov 14 '18 at 17:20













  • @sla_seth Your Windows platform will be fine for now - you have enough challenges at this time. Additional information request, please. Post on pastebin.com or here. A) complete (not edited) my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME, if possible C) SHOW GLOBAL VARIABLES; D) complete MySQLTuner report if you can get 24 hours of uptime E) SHOW ENGINE INNODB STATUS; for server tuning analysis.

    – Wilson Hauck
    Nov 14 '18 at 17:40













  • Run the mysqladmin pr -vvv command so you can view what queries are going on when this event happens. Could just be your software issuing a silly query that will take far too long to finish.

    – nos
    Nov 14 '18 at 17:42








  • 1





    Thank you all, I will try to update once we hit >24 hours uptime.

    – sla_seth
    Nov 14 '18 at 17:51











  • You have the Slowlog turned on; what does it tell you?

    – Rick James
    Nov 14 '18 at 17:58














  • 1





    Nope, if you see the mysql_tuner pic I linked, it's definitely 687M/8M. It actually used to run on linux but the programmer decided he wanted to run everything on Windows Server.

    – sla_seth
    Nov 14 '18 at 17:20













  • @sla_seth Your Windows platform will be fine for now - you have enough challenges at this time. Additional information request, please. Post on pastebin.com or here. A) complete (not edited) my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME, if possible C) SHOW GLOBAL VARIABLES; D) complete MySQLTuner report if you can get 24 hours of uptime E) SHOW ENGINE INNODB STATUS; for server tuning analysis.

    – Wilson Hauck
    Nov 14 '18 at 17:40













  • Run the mysqladmin pr -vvv command so you can view what queries are going on when this event happens. Could just be your software issuing a silly query that will take far too long to finish.

    – nos
    Nov 14 '18 at 17:42








  • 1





    Thank you all, I will try to update once we hit >24 hours uptime.

    – sla_seth
    Nov 14 '18 at 17:51











  • You have the Slowlog turned on; what does it tell you?

    – Rick James
    Nov 14 '18 at 17:58








1




1





Nope, if you see the mysql_tuner pic I linked, it's definitely 687M/8M. It actually used to run on linux but the programmer decided he wanted to run everything on Windows Server.

– sla_seth
Nov 14 '18 at 17:20







Nope, if you see the mysql_tuner pic I linked, it's definitely 687M/8M. It actually used to run on linux but the programmer decided he wanted to run everything on Windows Server.

– sla_seth
Nov 14 '18 at 17:20















@sla_seth Your Windows platform will be fine for now - you have enough challenges at this time. Additional information request, please. Post on pastebin.com or here. A) complete (not edited) my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME, if possible C) SHOW GLOBAL VARIABLES; D) complete MySQLTuner report if you can get 24 hours of uptime E) SHOW ENGINE INNODB STATUS; for server tuning analysis.

– Wilson Hauck
Nov 14 '18 at 17:40







@sla_seth Your Windows platform will be fine for now - you have enough challenges at this time. Additional information request, please. Post on pastebin.com or here. A) complete (not edited) my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME, if possible C) SHOW GLOBAL VARIABLES; D) complete MySQLTuner report if you can get 24 hours of uptime E) SHOW ENGINE INNODB STATUS; for server tuning analysis.

– Wilson Hauck
Nov 14 '18 at 17:40















Run the mysqladmin pr -vvv command so you can view what queries are going on when this event happens. Could just be your software issuing a silly query that will take far too long to finish.

– nos
Nov 14 '18 at 17:42







Run the mysqladmin pr -vvv command so you can view what queries are going on when this event happens. Could just be your software issuing a silly query that will take far too long to finish.

– nos
Nov 14 '18 at 17:42






1




1





Thank you all, I will try to update once we hit >24 hours uptime.

– sla_seth
Nov 14 '18 at 17:51





Thank you all, I will try to update once we hit >24 hours uptime.

– sla_seth
Nov 14 '18 at 17:51













You have the Slowlog turned on; what does it tell you?

– Rick James
Nov 14 '18 at 17:58





You have the Slowlog turned on; what does it tell you?

– Rick James
Nov 14 '18 at 17:58












2 Answers
2






active

oldest

votes


















0














Suggestion to consider for immediate relief



SET GLOBAL innodb_buffer_pool_size=1*1024*1024*1024


from your MySQL command prompt



will make a world of difference for you and possibly let you survive while other details are sorted out.



Change your my.ini [mysqld] section to 1G for your next stop/start services.






share|improve this answer
























  • @sla_seth SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024; will be fine. Change your my.ini for next stop/start of services, please. MAKE this change now so the rest of your day is reasonable. This is a DYNAMIC Global Variable.

    – Wilson Hauck
    Nov 14 '18 at 17:51








  • 1





    Thank you @wilson-hauck, If we're currently at 75% RAM used out of 8GB, then will this still be reasonable?

    – sla_seth
    Nov 14 '18 at 17:58













  • @sla_seth You should be fine with 2G for innnodb_buffer_pool_size.

    – Wilson Hauck
    Nov 14 '18 at 18:26











  • These are all good suggestions, but they will only help a little. Bang for the buck goes to tuning what's going on. I would check to see if things are stacking up first and then looking at the process_list. "SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM information_schema.innodb_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;

    – T Gray
    Nov 14 '18 at 22:25











  • @TGray I am hoping sla_seth will post his observations on how much the suggestions have helped. He has not been back here since Nov 18, 18. Hoping he returns and shares net result so we know how he is doing at this time.

    – Wilson Hauck
    Nov 28 '18 at 19:42





















0














Additional suggestions to consider for your my.ini [mysqld] section
Rate Per Second=RPS



innodb_buffer_pool_size=2G  # from 1G reported in SHOW GLOBAL STATUS of 11/16
innodb_lru_scan_depth=100 # from 1024 to conserve CPU cycles every SECOND
thread_cache_size=100 # from 10 to increase threads_cached for increased performance
innodb_io_capacity=1600 # from 200 to allow higher IOPS
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 63407
innodb_log_buffer_size=16M # from 1M for ~ 30 minutes in RAM before WD
open_files_limit=8192 # from 6209 to reduce opened_files RPHour of 152
table_open_cache=3000 # from 2000 to reduce opened_tables RPHour of 258
query_cache_size=0 # from 1M to conserve RAM since QC is OFF


For additional assistance please view my profile, Network profile for contact info.



If you add a comment, please start with @wilsonhauck for me to be alerted by SO automatically.






share|improve this answer
























  • @sla_seth Please go to my website, select Utility Scripts+ and download findfragtables.sql and find-redundant-indexes.sql and post the results of each query on pastebin.com. Share the pastebin.com link with us, please. These scripts are Free and may be used as often as you wish. Create account will be requested during the process, NO credit card will be requested for your $0.00 Cart amount of your Order/Invoice. Looking forward to see the results posted.

    – Wilson Hauck
    Nov 21 '18 at 17:36











  • @sla_seth Applied the Nov 19 suggestions? Did they make a difference?

    – Wilson Hauck
    Nov 26 '18 at 17:52











  • not yet. The original suggestions have made a huge improvement so far though. I'm still waiting on approval to make the rest of the changes. Thanks again!

    – sla_seth
    Dec 1 '18 at 14:40











  • @sla_seth Would you be kind, review my FAQ for Review suggested format and post a review on the SHOP, FREE My TOP 4 Global Variable Suggestions page for the success you have already experienced? Thanks web site is mysqlservertuning.com

    – Wilson Hauck
    Dec 1 '18 at 14:45













  • @sla_seth If you can get permission for the next 9, you will be more AMAZED. Good luck on getting approval, soon.

    – Wilson Hauck
    Dec 1 '18 at 17:10











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305200%2fmysql-100-cpu-every-12-18-hours%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Suggestion to consider for immediate relief



SET GLOBAL innodb_buffer_pool_size=1*1024*1024*1024


from your MySQL command prompt



will make a world of difference for you and possibly let you survive while other details are sorted out.



Change your my.ini [mysqld] section to 1G for your next stop/start services.






share|improve this answer
























  • @sla_seth SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024; will be fine. Change your my.ini for next stop/start of services, please. MAKE this change now so the rest of your day is reasonable. This is a DYNAMIC Global Variable.

    – Wilson Hauck
    Nov 14 '18 at 17:51








  • 1





    Thank you @wilson-hauck, If we're currently at 75% RAM used out of 8GB, then will this still be reasonable?

    – sla_seth
    Nov 14 '18 at 17:58













  • @sla_seth You should be fine with 2G for innnodb_buffer_pool_size.

    – Wilson Hauck
    Nov 14 '18 at 18:26











  • These are all good suggestions, but they will only help a little. Bang for the buck goes to tuning what's going on. I would check to see if things are stacking up first and then looking at the process_list. "SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM information_schema.innodb_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;

    – T Gray
    Nov 14 '18 at 22:25











  • @TGray I am hoping sla_seth will post his observations on how much the suggestions have helped. He has not been back here since Nov 18, 18. Hoping he returns and shares net result so we know how he is doing at this time.

    – Wilson Hauck
    Nov 28 '18 at 19:42


















0














Suggestion to consider for immediate relief



SET GLOBAL innodb_buffer_pool_size=1*1024*1024*1024


from your MySQL command prompt



will make a world of difference for you and possibly let you survive while other details are sorted out.



Change your my.ini [mysqld] section to 1G for your next stop/start services.






share|improve this answer
























  • @sla_seth SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024; will be fine. Change your my.ini for next stop/start of services, please. MAKE this change now so the rest of your day is reasonable. This is a DYNAMIC Global Variable.

    – Wilson Hauck
    Nov 14 '18 at 17:51








  • 1





    Thank you @wilson-hauck, If we're currently at 75% RAM used out of 8GB, then will this still be reasonable?

    – sla_seth
    Nov 14 '18 at 17:58













  • @sla_seth You should be fine with 2G for innnodb_buffer_pool_size.

    – Wilson Hauck
    Nov 14 '18 at 18:26











  • These are all good suggestions, but they will only help a little. Bang for the buck goes to tuning what's going on. I would check to see if things are stacking up first and then looking at the process_list. "SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM information_schema.innodb_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;

    – T Gray
    Nov 14 '18 at 22:25











  • @TGray I am hoping sla_seth will post his observations on how much the suggestions have helped. He has not been back here since Nov 18, 18. Hoping he returns and shares net result so we know how he is doing at this time.

    – Wilson Hauck
    Nov 28 '18 at 19:42
















0












0








0







Suggestion to consider for immediate relief



SET GLOBAL innodb_buffer_pool_size=1*1024*1024*1024


from your MySQL command prompt



will make a world of difference for you and possibly let you survive while other details are sorted out.



Change your my.ini [mysqld] section to 1G for your next stop/start services.






share|improve this answer













Suggestion to consider for immediate relief



SET GLOBAL innodb_buffer_pool_size=1*1024*1024*1024


from your MySQL command prompt



will make a world of difference for you and possibly let you survive while other details are sorted out.



Change your my.ini [mysqld] section to 1G for your next stop/start services.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 14 '18 at 17:21









Wilson HauckWilson Hauck

7501511




7501511













  • @sla_seth SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024; will be fine. Change your my.ini for next stop/start of services, please. MAKE this change now so the rest of your day is reasonable. This is a DYNAMIC Global Variable.

    – Wilson Hauck
    Nov 14 '18 at 17:51








  • 1





    Thank you @wilson-hauck, If we're currently at 75% RAM used out of 8GB, then will this still be reasonable?

    – sla_seth
    Nov 14 '18 at 17:58













  • @sla_seth You should be fine with 2G for innnodb_buffer_pool_size.

    – Wilson Hauck
    Nov 14 '18 at 18:26











  • These are all good suggestions, but they will only help a little. Bang for the buck goes to tuning what's going on. I would check to see if things are stacking up first and then looking at the process_list. "SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM information_schema.innodb_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;

    – T Gray
    Nov 14 '18 at 22:25











  • @TGray I am hoping sla_seth will post his observations on how much the suggestions have helped. He has not been back here since Nov 18, 18. Hoping he returns and shares net result so we know how he is doing at this time.

    – Wilson Hauck
    Nov 28 '18 at 19:42





















  • @sla_seth SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024; will be fine. Change your my.ini for next stop/start of services, please. MAKE this change now so the rest of your day is reasonable. This is a DYNAMIC Global Variable.

    – Wilson Hauck
    Nov 14 '18 at 17:51








  • 1





    Thank you @wilson-hauck, If we're currently at 75% RAM used out of 8GB, then will this still be reasonable?

    – sla_seth
    Nov 14 '18 at 17:58













  • @sla_seth You should be fine with 2G for innnodb_buffer_pool_size.

    – Wilson Hauck
    Nov 14 '18 at 18:26











  • These are all good suggestions, but they will only help a little. Bang for the buck goes to tuning what's going on. I would check to see if things are stacking up first and then looking at the process_list. "SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM information_schema.innodb_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;

    – T Gray
    Nov 14 '18 at 22:25











  • @TGray I am hoping sla_seth will post his observations on how much the suggestions have helped. He has not been back here since Nov 18, 18. Hoping he returns and shares net result so we know how he is doing at this time.

    – Wilson Hauck
    Nov 28 '18 at 19:42



















@sla_seth SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024; will be fine. Change your my.ini for next stop/start of services, please. MAKE this change now so the rest of your day is reasonable. This is a DYNAMIC Global Variable.

– Wilson Hauck
Nov 14 '18 at 17:51







@sla_seth SET GLOBAL innodb_buffer_pool_size=2*1024*1024*1024; will be fine. Change your my.ini for next stop/start of services, please. MAKE this change now so the rest of your day is reasonable. This is a DYNAMIC Global Variable.

– Wilson Hauck
Nov 14 '18 at 17:51






1




1





Thank you @wilson-hauck, If we're currently at 75% RAM used out of 8GB, then will this still be reasonable?

– sla_seth
Nov 14 '18 at 17:58







Thank you @wilson-hauck, If we're currently at 75% RAM used out of 8GB, then will this still be reasonable?

– sla_seth
Nov 14 '18 at 17:58















@sla_seth You should be fine with 2G for innnodb_buffer_pool_size.

– Wilson Hauck
Nov 14 '18 at 18:26





@sla_seth You should be fine with 2G for innnodb_buffer_pool_size.

– Wilson Hauck
Nov 14 '18 at 18:26













These are all good suggestions, but they will only help a little. Bang for the buck goes to tuning what's going on. I would check to see if things are stacking up first and then looking at the process_list. "SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM information_schema.innodb_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;

– T Gray
Nov 14 '18 at 22:25





These are all good suggestions, but they will only help a little. Bang for the buck goes to tuning what's going on. I would check to see if things are stacking up first and then looking at the process_list. "SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM information_schema.innodb_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id;

– T Gray
Nov 14 '18 at 22:25













@TGray I am hoping sla_seth will post his observations on how much the suggestions have helped. He has not been back here since Nov 18, 18. Hoping he returns and shares net result so we know how he is doing at this time.

– Wilson Hauck
Nov 28 '18 at 19:42







@TGray I am hoping sla_seth will post his observations on how much the suggestions have helped. He has not been back here since Nov 18, 18. Hoping he returns and shares net result so we know how he is doing at this time.

– Wilson Hauck
Nov 28 '18 at 19:42















0














Additional suggestions to consider for your my.ini [mysqld] section
Rate Per Second=RPS



innodb_buffer_pool_size=2G  # from 1G reported in SHOW GLOBAL STATUS of 11/16
innodb_lru_scan_depth=100 # from 1024 to conserve CPU cycles every SECOND
thread_cache_size=100 # from 10 to increase threads_cached for increased performance
innodb_io_capacity=1600 # from 200 to allow higher IOPS
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 63407
innodb_log_buffer_size=16M # from 1M for ~ 30 minutes in RAM before WD
open_files_limit=8192 # from 6209 to reduce opened_files RPHour of 152
table_open_cache=3000 # from 2000 to reduce opened_tables RPHour of 258
query_cache_size=0 # from 1M to conserve RAM since QC is OFF


For additional assistance please view my profile, Network profile for contact info.



If you add a comment, please start with @wilsonhauck for me to be alerted by SO automatically.






share|improve this answer
























  • @sla_seth Please go to my website, select Utility Scripts+ and download findfragtables.sql and find-redundant-indexes.sql and post the results of each query on pastebin.com. Share the pastebin.com link with us, please. These scripts are Free and may be used as often as you wish. Create account will be requested during the process, NO credit card will be requested for your $0.00 Cart amount of your Order/Invoice. Looking forward to see the results posted.

    – Wilson Hauck
    Nov 21 '18 at 17:36











  • @sla_seth Applied the Nov 19 suggestions? Did they make a difference?

    – Wilson Hauck
    Nov 26 '18 at 17:52











  • not yet. The original suggestions have made a huge improvement so far though. I'm still waiting on approval to make the rest of the changes. Thanks again!

    – sla_seth
    Dec 1 '18 at 14:40











  • @sla_seth Would you be kind, review my FAQ for Review suggested format and post a review on the SHOP, FREE My TOP 4 Global Variable Suggestions page for the success you have already experienced? Thanks web site is mysqlservertuning.com

    – Wilson Hauck
    Dec 1 '18 at 14:45













  • @sla_seth If you can get permission for the next 9, you will be more AMAZED. Good luck on getting approval, soon.

    – Wilson Hauck
    Dec 1 '18 at 17:10
















0














Additional suggestions to consider for your my.ini [mysqld] section
Rate Per Second=RPS



innodb_buffer_pool_size=2G  # from 1G reported in SHOW GLOBAL STATUS of 11/16
innodb_lru_scan_depth=100 # from 1024 to conserve CPU cycles every SECOND
thread_cache_size=100 # from 10 to increase threads_cached for increased performance
innodb_io_capacity=1600 # from 200 to allow higher IOPS
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 63407
innodb_log_buffer_size=16M # from 1M for ~ 30 minutes in RAM before WD
open_files_limit=8192 # from 6209 to reduce opened_files RPHour of 152
table_open_cache=3000 # from 2000 to reduce opened_tables RPHour of 258
query_cache_size=0 # from 1M to conserve RAM since QC is OFF


For additional assistance please view my profile, Network profile for contact info.



If you add a comment, please start with @wilsonhauck for me to be alerted by SO automatically.






share|improve this answer
























  • @sla_seth Please go to my website, select Utility Scripts+ and download findfragtables.sql and find-redundant-indexes.sql and post the results of each query on pastebin.com. Share the pastebin.com link with us, please. These scripts are Free and may be used as often as you wish. Create account will be requested during the process, NO credit card will be requested for your $0.00 Cart amount of your Order/Invoice. Looking forward to see the results posted.

    – Wilson Hauck
    Nov 21 '18 at 17:36











  • @sla_seth Applied the Nov 19 suggestions? Did they make a difference?

    – Wilson Hauck
    Nov 26 '18 at 17:52











  • not yet. The original suggestions have made a huge improvement so far though. I'm still waiting on approval to make the rest of the changes. Thanks again!

    – sla_seth
    Dec 1 '18 at 14:40











  • @sla_seth Would you be kind, review my FAQ for Review suggested format and post a review on the SHOP, FREE My TOP 4 Global Variable Suggestions page for the success you have already experienced? Thanks web site is mysqlservertuning.com

    – Wilson Hauck
    Dec 1 '18 at 14:45













  • @sla_seth If you can get permission for the next 9, you will be more AMAZED. Good luck on getting approval, soon.

    – Wilson Hauck
    Dec 1 '18 at 17:10














0












0








0







Additional suggestions to consider for your my.ini [mysqld] section
Rate Per Second=RPS



innodb_buffer_pool_size=2G  # from 1G reported in SHOW GLOBAL STATUS of 11/16
innodb_lru_scan_depth=100 # from 1024 to conserve CPU cycles every SECOND
thread_cache_size=100 # from 10 to increase threads_cached for increased performance
innodb_io_capacity=1600 # from 200 to allow higher IOPS
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 63407
innodb_log_buffer_size=16M # from 1M for ~ 30 minutes in RAM before WD
open_files_limit=8192 # from 6209 to reduce opened_files RPHour of 152
table_open_cache=3000 # from 2000 to reduce opened_tables RPHour of 258
query_cache_size=0 # from 1M to conserve RAM since QC is OFF


For additional assistance please view my profile, Network profile for contact info.



If you add a comment, please start with @wilsonhauck for me to be alerted by SO automatically.






share|improve this answer













Additional suggestions to consider for your my.ini [mysqld] section
Rate Per Second=RPS



innodb_buffer_pool_size=2G  # from 1G reported in SHOW GLOBAL STATUS of 11/16
innodb_lru_scan_depth=100 # from 1024 to conserve CPU cycles every SECOND
thread_cache_size=100 # from 10 to increase threads_cached for increased performance
innodb_io_capacity=1600 # from 200 to allow higher IOPS
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 63407
innodb_log_buffer_size=16M # from 1M for ~ 30 minutes in RAM before WD
open_files_limit=8192 # from 6209 to reduce opened_files RPHour of 152
table_open_cache=3000 # from 2000 to reduce opened_tables RPHour of 258
query_cache_size=0 # from 1M to conserve RAM since QC is OFF


For additional assistance please view my profile, Network profile for contact info.



If you add a comment, please start with @wilsonhauck for me to be alerted by SO automatically.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 19 '18 at 0:41









Wilson HauckWilson Hauck

7501511




7501511













  • @sla_seth Please go to my website, select Utility Scripts+ and download findfragtables.sql and find-redundant-indexes.sql and post the results of each query on pastebin.com. Share the pastebin.com link with us, please. These scripts are Free and may be used as often as you wish. Create account will be requested during the process, NO credit card will be requested for your $0.00 Cart amount of your Order/Invoice. Looking forward to see the results posted.

    – Wilson Hauck
    Nov 21 '18 at 17:36











  • @sla_seth Applied the Nov 19 suggestions? Did they make a difference?

    – Wilson Hauck
    Nov 26 '18 at 17:52











  • not yet. The original suggestions have made a huge improvement so far though. I'm still waiting on approval to make the rest of the changes. Thanks again!

    – sla_seth
    Dec 1 '18 at 14:40











  • @sla_seth Would you be kind, review my FAQ for Review suggested format and post a review on the SHOP, FREE My TOP 4 Global Variable Suggestions page for the success you have already experienced? Thanks web site is mysqlservertuning.com

    – Wilson Hauck
    Dec 1 '18 at 14:45













  • @sla_seth If you can get permission for the next 9, you will be more AMAZED. Good luck on getting approval, soon.

    – Wilson Hauck
    Dec 1 '18 at 17:10



















  • @sla_seth Please go to my website, select Utility Scripts+ and download findfragtables.sql and find-redundant-indexes.sql and post the results of each query on pastebin.com. Share the pastebin.com link with us, please. These scripts are Free and may be used as often as you wish. Create account will be requested during the process, NO credit card will be requested for your $0.00 Cart amount of your Order/Invoice. Looking forward to see the results posted.

    – Wilson Hauck
    Nov 21 '18 at 17:36











  • @sla_seth Applied the Nov 19 suggestions? Did they make a difference?

    – Wilson Hauck
    Nov 26 '18 at 17:52











  • not yet. The original suggestions have made a huge improvement so far though. I'm still waiting on approval to make the rest of the changes. Thanks again!

    – sla_seth
    Dec 1 '18 at 14:40











  • @sla_seth Would you be kind, review my FAQ for Review suggested format and post a review on the SHOP, FREE My TOP 4 Global Variable Suggestions page for the success you have already experienced? Thanks web site is mysqlservertuning.com

    – Wilson Hauck
    Dec 1 '18 at 14:45













  • @sla_seth If you can get permission for the next 9, you will be more AMAZED. Good luck on getting approval, soon.

    – Wilson Hauck
    Dec 1 '18 at 17:10

















@sla_seth Please go to my website, select Utility Scripts+ and download findfragtables.sql and find-redundant-indexes.sql and post the results of each query on pastebin.com. Share the pastebin.com link with us, please. These scripts are Free and may be used as often as you wish. Create account will be requested during the process, NO credit card will be requested for your $0.00 Cart amount of your Order/Invoice. Looking forward to see the results posted.

– Wilson Hauck
Nov 21 '18 at 17:36





@sla_seth Please go to my website, select Utility Scripts+ and download findfragtables.sql and find-redundant-indexes.sql and post the results of each query on pastebin.com. Share the pastebin.com link with us, please. These scripts are Free and may be used as often as you wish. Create account will be requested during the process, NO credit card will be requested for your $0.00 Cart amount of your Order/Invoice. Looking forward to see the results posted.

– Wilson Hauck
Nov 21 '18 at 17:36













@sla_seth Applied the Nov 19 suggestions? Did they make a difference?

– Wilson Hauck
Nov 26 '18 at 17:52





@sla_seth Applied the Nov 19 suggestions? Did they make a difference?

– Wilson Hauck
Nov 26 '18 at 17:52













not yet. The original suggestions have made a huge improvement so far though. I'm still waiting on approval to make the rest of the changes. Thanks again!

– sla_seth
Dec 1 '18 at 14:40





not yet. The original suggestions have made a huge improvement so far though. I'm still waiting on approval to make the rest of the changes. Thanks again!

– sla_seth
Dec 1 '18 at 14:40













@sla_seth Would you be kind, review my FAQ for Review suggested format and post a review on the SHOP, FREE My TOP 4 Global Variable Suggestions page for the success you have already experienced? Thanks web site is mysqlservertuning.com

– Wilson Hauck
Dec 1 '18 at 14:45







@sla_seth Would you be kind, review my FAQ for Review suggested format and post a review on the SHOP, FREE My TOP 4 Global Variable Suggestions page for the success you have already experienced? Thanks web site is mysqlservertuning.com

– Wilson Hauck
Dec 1 '18 at 14:45















@sla_seth If you can get permission for the next 9, you will be more AMAZED. Good luck on getting approval, soon.

– Wilson Hauck
Dec 1 '18 at 17:10





@sla_seth If you can get permission for the next 9, you will be more AMAZED. Good luck on getting approval, soon.

– Wilson Hauck
Dec 1 '18 at 17:10


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305200%2fmysql-100-cpu-every-12-18-hours%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine