Mysqld consumes 232% CPUMysql 5.1 on Mac: query cache not workingHibernate sending superfluous queries to the databaseHow do I allow mysqld to use more than 24.9% of my cpu?Magento site crashes when going to the sales -> orders pageFail to start MySQL server after changing the value of innodb_log_file_size(2006) MySQL server has gone awayInnoDB Error on MySQL Startupmysql - usage of memory still grow upmysql reports lost connection to mysql server during query for optimize table commandMaria MySQL upgraded from 10.1.x to 10.2.x but now has long semaphore waits
Why do candidates not quit if they no longer have a realistic chance to win in the 2020 US presidents election
Animal Shelter Management C++
How to unload a Mathematica package?
Is there an English equivalent for "Les carottes sont cuites", while keeping the vegetable reference?
What is this called? A tube flange bearing threaded for threaded pushrod
When to ask for constructive criticism?
Are L-functions uniquely determined by their values at negative integers?
Do aircraft cabins have suspension?
What is this old "lemon-squeezer" shaped pan
Doing research in academia and not liking competition
Why run a service as a system user?
I won USD 50K! Now what should I do with it?
Why do legislative committees exist?
Construct a pentagon avoiding compass use
Teferi's Time Twist on creature with +1/+1 counter
Can both line and load go to same screw on a GFCI outlet?
Re-negotiate salary once I earn my diploma
Video editor for YouTube
Why do the faithful have to say "And with your spirit " in Catholic Mass?
I gave my characters names that are exactly like another book. Is it a problem?
What to look for in climbing shoes?
What are some symbols representing peasants/oppressed persons fighting back?
What alternatives exist to at-will employment?
When do sending stones recharge if they are in different time zones (or different planes)?
Mysqld consumes 232% CPU
Mysql 5.1 on Mac: query cache not workingHibernate sending superfluous queries to the databaseHow do I allow mysqld to use more than 24.9% of my cpu?Magento site crashes when going to the sales -> orders pageFail to start MySQL server after changing the value of innodb_log_file_size(2006) MySQL server has gone awayInnoDB Error on MySQL Startupmysql - usage of memory still grow upmysql reports lost connection to mysql server during query for optimize table commandMaria MySQL upgraded from 10.1.x to 10.2.x but now has long semaphore waits
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
My mysqld process consumes 232% CPU and and there 14000+ connections
(I'm a little new to this thing but following Stack Overflow for assistance).
top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3112 mysql 20 0 7061444 1.397g 15848 S 232.6 8.9 1138:06 mysqld
System:
Ubuntu 18.04,
16GB RAM,
8 Core CPU,
120GB Disk
and MySQL version 5.7.25
mysql> show status like 'Conn%';
+-----------------------------------+-------+
| Variable_name | Value |
+-----------------------------------+-------+
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 0 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 14007 |
+-----------------------------------+-------+
7 rows in set (0.01 sec)
And show variables like "%timeout%"
mysql> show variables like "%timeout%";
+-----------------------------+----------+
| Variable_name | Value |
+-----------------------------+----------+
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| have_statement_timeout | YES |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 50 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| lock_wait_timeout | 31536000 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| rpl_stop_slave_timeout | 31536000 |
| slave_net_timeout | 60 |
| wait_timeout | 28800 |
+-----------------------------+----------+
13 rows in set (0.01 sec)
And mysqld.cnf settings
[mysqld]
# Skip reverse DNS lookup of clients
skip-name-resolve
default-storage-engine=InnoDB
max_allowed_packet=500M
max_connections = 256
interactive_timeout=7200
wait_timeout=7200
innodb_file_per_table=1
innodb_buffer_pool_size = 8G
innodb_buffer_pool_instances = 4
innodb_log_file_size = 1G
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
innodb_open_files=5000
innodb_io_capacity=2000
innodb_io_capacity_max=4000
innodb_old_blocks_time=2000
open_files_limit=50000
query_cache_type = 1
query_cache_min_res_unit = 1M
query_cache_limit = 1M
query_cache_size = 50M
tmp_table_size= 256M
max_heap_table_size= 256M
#key_buffer_size = 128M
thread_stack = 128K
thread_cache_size = 32
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
long_query_time = 1
Note: Corrected above mysqld.cnf values to match with below reports attached
Additional Info:
- htop:- https://pastebin.com/43f4b3fK
- top:- https://pastebin.com/rTh1XvUt
- GLOBAL VARIABLES: https://pastebin.com/K2fgKwEv (Complete)
- INNODB STATUS:- https://pastebin.com/nGrZjHAg
- Mysqltuner:- https://pastebin.com/ZNYieJj8
- [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] :- https://pastebin.com/mrnyQrXf
Server freezes when multiple db transaction is being carried out. Is there a lock like thing or any configuration flaws?
(Background: This is a WordPress blog and nobody else is accessing it right now. I somehow imported a 115K posts from an old blog but struck here with this CPU ghost)
mysql connection innodb
|
show 12 more comments
My mysqld process consumes 232% CPU and and there 14000+ connections
(I'm a little new to this thing but following Stack Overflow for assistance).
top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3112 mysql 20 0 7061444 1.397g 15848 S 232.6 8.9 1138:06 mysqld
System:
Ubuntu 18.04,
16GB RAM,
8 Core CPU,
120GB Disk
and MySQL version 5.7.25
mysql> show status like 'Conn%';
+-----------------------------------+-------+
| Variable_name | Value |
+-----------------------------------+-------+
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 0 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 14007 |
+-----------------------------------+-------+
7 rows in set (0.01 sec)
And show variables like "%timeout%"
mysql> show variables like "%timeout%";
+-----------------------------+----------+
| Variable_name | Value |
+-----------------------------+----------+
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| have_statement_timeout | YES |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 50 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| lock_wait_timeout | 31536000 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| rpl_stop_slave_timeout | 31536000 |
| slave_net_timeout | 60 |
| wait_timeout | 28800 |
+-----------------------------+----------+
13 rows in set (0.01 sec)
And mysqld.cnf settings
[mysqld]
# Skip reverse DNS lookup of clients
skip-name-resolve
default-storage-engine=InnoDB
max_allowed_packet=500M
max_connections = 256
interactive_timeout=7200
wait_timeout=7200
innodb_file_per_table=1
innodb_buffer_pool_size = 8G
innodb_buffer_pool_instances = 4
innodb_log_file_size = 1G
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
innodb_open_files=5000
innodb_io_capacity=2000
innodb_io_capacity_max=4000
innodb_old_blocks_time=2000
open_files_limit=50000
query_cache_type = 1
query_cache_min_res_unit = 1M
query_cache_limit = 1M
query_cache_size = 50M
tmp_table_size= 256M
max_heap_table_size= 256M
#key_buffer_size = 128M
thread_stack = 128K
thread_cache_size = 32
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
long_query_time = 1
Note: Corrected above mysqld.cnf values to match with below reports attached
Additional Info:
- htop:- https://pastebin.com/43f4b3fK
- top:- https://pastebin.com/rTh1XvUt
- GLOBAL VARIABLES: https://pastebin.com/K2fgKwEv (Complete)
- INNODB STATUS:- https://pastebin.com/nGrZjHAg
- Mysqltuner:- https://pastebin.com/ZNYieJj8
- [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] :- https://pastebin.com/mrnyQrXf
Server freezes when multiple db transaction is being carried out. Is there a lock like thing or any configuration flaws?
(Background: This is a WordPress blog and nobody else is accessing it right now. I somehow imported a 115K posts from an old blog but struck here with this CPU ghost)
mysql connection innodb
1
Connections
is a counter of how many connections have been attempted in the past. The number of current active connections isThreads_connected
, which in your case is 6.
– Bill Karwin
Mar 26 at 15:05
1
Thanks for clarification @BillKarwin. But the process mysqld still consume 232% CPU. Is there any flaws in my sql configuration. What might be the reason. Please help
– TELA
Mar 26 at 18:32
1
Hi @WilsonHauck, Thank for the followup. I've edited above with the information u requested.
– TELA
Mar 29 at 23:10
1
Thanks @WilsonHauck. Additional info attached: [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] pastebin.com/mrnyQrXf
– TELA
Mar 30 at 13:38
1
Yes 8 CPU, SSD @linode.com. At the beginning CPU was 6 and later upgraded to 8 due to high consumption. But no luck.
– TELA
Mar 30 at 14:39
|
show 12 more comments
My mysqld process consumes 232% CPU and and there 14000+ connections
(I'm a little new to this thing but following Stack Overflow for assistance).
top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3112 mysql 20 0 7061444 1.397g 15848 S 232.6 8.9 1138:06 mysqld
System:
Ubuntu 18.04,
16GB RAM,
8 Core CPU,
120GB Disk
and MySQL version 5.7.25
mysql> show status like 'Conn%';
+-----------------------------------+-------+
| Variable_name | Value |
+-----------------------------------+-------+
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 0 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 14007 |
+-----------------------------------+-------+
7 rows in set (0.01 sec)
And show variables like "%timeout%"
mysql> show variables like "%timeout%";
+-----------------------------+----------+
| Variable_name | Value |
+-----------------------------+----------+
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| have_statement_timeout | YES |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 50 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| lock_wait_timeout | 31536000 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| rpl_stop_slave_timeout | 31536000 |
| slave_net_timeout | 60 |
| wait_timeout | 28800 |
+-----------------------------+----------+
13 rows in set (0.01 sec)
And mysqld.cnf settings
[mysqld]
# Skip reverse DNS lookup of clients
skip-name-resolve
default-storage-engine=InnoDB
max_allowed_packet=500M
max_connections = 256
interactive_timeout=7200
wait_timeout=7200
innodb_file_per_table=1
innodb_buffer_pool_size = 8G
innodb_buffer_pool_instances = 4
innodb_log_file_size = 1G
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
innodb_open_files=5000
innodb_io_capacity=2000
innodb_io_capacity_max=4000
innodb_old_blocks_time=2000
open_files_limit=50000
query_cache_type = 1
query_cache_min_res_unit = 1M
query_cache_limit = 1M
query_cache_size = 50M
tmp_table_size= 256M
max_heap_table_size= 256M
#key_buffer_size = 128M
thread_stack = 128K
thread_cache_size = 32
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
long_query_time = 1
Note: Corrected above mysqld.cnf values to match with below reports attached
Additional Info:
- htop:- https://pastebin.com/43f4b3fK
- top:- https://pastebin.com/rTh1XvUt
- GLOBAL VARIABLES: https://pastebin.com/K2fgKwEv (Complete)
- INNODB STATUS:- https://pastebin.com/nGrZjHAg
- Mysqltuner:- https://pastebin.com/ZNYieJj8
- [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] :- https://pastebin.com/mrnyQrXf
Server freezes when multiple db transaction is being carried out. Is there a lock like thing or any configuration flaws?
(Background: This is a WordPress blog and nobody else is accessing it right now. I somehow imported a 115K posts from an old blog but struck here with this CPU ghost)
mysql connection innodb
My mysqld process consumes 232% CPU and and there 14000+ connections
(I'm a little new to this thing but following Stack Overflow for assistance).
top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3112 mysql 20 0 7061444 1.397g 15848 S 232.6 8.9 1138:06 mysqld
System:
Ubuntu 18.04,
16GB RAM,
8 Core CPU,
120GB Disk
and MySQL version 5.7.25
mysql> show status like 'Conn%';
+-----------------------------------+-------+
| Variable_name | Value |
+-----------------------------------+-------+
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 0 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 14007 |
+-----------------------------------+-------+
7 rows in set (0.01 sec)
And show variables like "%timeout%"
mysql> show variables like "%timeout%";
+-----------------------------+----------+
| Variable_name | Value |
+-----------------------------+----------+
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| have_statement_timeout | YES |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 50 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| lock_wait_timeout | 31536000 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| rpl_stop_slave_timeout | 31536000 |
| slave_net_timeout | 60 |
| wait_timeout | 28800 |
+-----------------------------+----------+
13 rows in set (0.01 sec)
And mysqld.cnf settings
[mysqld]
# Skip reverse DNS lookup of clients
skip-name-resolve
default-storage-engine=InnoDB
max_allowed_packet=500M
max_connections = 256
interactive_timeout=7200
wait_timeout=7200
innodb_file_per_table=1
innodb_buffer_pool_size = 8G
innodb_buffer_pool_instances = 4
innodb_log_file_size = 1G
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
innodb_open_files=5000
innodb_io_capacity=2000
innodb_io_capacity_max=4000
innodb_old_blocks_time=2000
open_files_limit=50000
query_cache_type = 1
query_cache_min_res_unit = 1M
query_cache_limit = 1M
query_cache_size = 50M
tmp_table_size= 256M
max_heap_table_size= 256M
#key_buffer_size = 128M
thread_stack = 128K
thread_cache_size = 32
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
long_query_time = 1
Note: Corrected above mysqld.cnf values to match with below reports attached
Additional Info:
- htop:- https://pastebin.com/43f4b3fK
- top:- https://pastebin.com/rTh1XvUt
- GLOBAL VARIABLES: https://pastebin.com/K2fgKwEv (Complete)
- INNODB STATUS:- https://pastebin.com/nGrZjHAg
- Mysqltuner:- https://pastebin.com/ZNYieJj8
- [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] :- https://pastebin.com/mrnyQrXf
Server freezes when multiple db transaction is being carried out. Is there a lock like thing or any configuration flaws?
(Background: This is a WordPress blog and nobody else is accessing it right now. I somehow imported a 115K posts from an old blog but struck here with this CPU ghost)
mysql connection innodb
mysql connection innodb
edited Mar 30 at 19:04
TELA
asked Mar 26 at 7:24
TELATELA
167 bronze badges
167 bronze badges
1
Connections
is a counter of how many connections have been attempted in the past. The number of current active connections isThreads_connected
, which in your case is 6.
– Bill Karwin
Mar 26 at 15:05
1
Thanks for clarification @BillKarwin. But the process mysqld still consume 232% CPU. Is there any flaws in my sql configuration. What might be the reason. Please help
– TELA
Mar 26 at 18:32
1
Hi @WilsonHauck, Thank for the followup. I've edited above with the information u requested.
– TELA
Mar 29 at 23:10
1
Thanks @WilsonHauck. Additional info attached: [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] pastebin.com/mrnyQrXf
– TELA
Mar 30 at 13:38
1
Yes 8 CPU, SSD @linode.com. At the beginning CPU was 6 and later upgraded to 8 due to high consumption. But no luck.
– TELA
Mar 30 at 14:39
|
show 12 more comments
1
Connections
is a counter of how many connections have been attempted in the past. The number of current active connections isThreads_connected
, which in your case is 6.
– Bill Karwin
Mar 26 at 15:05
1
Thanks for clarification @BillKarwin. But the process mysqld still consume 232% CPU. Is there any flaws in my sql configuration. What might be the reason. Please help
– TELA
Mar 26 at 18:32
1
Hi @WilsonHauck, Thank for the followup. I've edited above with the information u requested.
– TELA
Mar 29 at 23:10
1
Thanks @WilsonHauck. Additional info attached: [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] pastebin.com/mrnyQrXf
– TELA
Mar 30 at 13:38
1
Yes 8 CPU, SSD @linode.com. At the beginning CPU was 6 and later upgraded to 8 due to high consumption. But no luck.
– TELA
Mar 30 at 14:39
1
1
Connections
is a counter of how many connections have been attempted in the past. The number of current active connections is Threads_connected
, which in your case is 6.– Bill Karwin
Mar 26 at 15:05
Connections
is a counter of how many connections have been attempted in the past. The number of current active connections is Threads_connected
, which in your case is 6.– Bill Karwin
Mar 26 at 15:05
1
1
Thanks for clarification @BillKarwin. But the process mysqld still consume 232% CPU. Is there any flaws in my sql configuration. What might be the reason. Please help
– TELA
Mar 26 at 18:32
Thanks for clarification @BillKarwin. But the process mysqld still consume 232% CPU. Is there any flaws in my sql configuration. What might be the reason. Please help
– TELA
Mar 26 at 18:32
1
1
Hi @WilsonHauck, Thank for the followup. I've edited above with the information u requested.
– TELA
Mar 29 at 23:10
Hi @WilsonHauck, Thank for the followup. I've edited above with the information u requested.
– TELA
Mar 29 at 23:10
1
1
Thanks @WilsonHauck. Additional info attached: [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] pastebin.com/mrnyQrXf
– TELA
Mar 30 at 13:38
Thanks @WilsonHauck. Additional info attached: [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] pastebin.com/mrnyQrXf
– TELA
Mar 30 at 13:38
1
1
Yes 8 CPU, SSD @linode.com. At the beginning CPU was 6 and later upgraded to 8 due to high consumption. But no luck.
– TELA
Mar 30 at 14:39
Yes 8 CPU, SSD @linode.com. At the beginning CPU was 6 and later upgraded to 8 due to high consumption. But no luck.
– TELA
Mar 30 at 14:39
|
show 12 more comments
2 Answers
2
active
oldest
votes
Rate Per Second = RPS - Suggestions to consider for your my.cnf [mysqld] section,
innodb_lru_scan_depth=100 # from 1024 to reduce 90% of cpu cycles used for function every SECOND
innodb_io_capacity=3500 # from 2000 to enable higher IOPS on your SSD devices
innodb_flushing_avg_loops=5 # from 30 to reduce innodb_buffer_pool_pages_dirty overhead - count was 3183 in SGStatus
read_buffer_size=256K # from 128K to reduce handler_read_next RPS of 277,134
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 778
There are many more opportunities to improve performance through Global Variables.
Disclaimer: I am the author of web site mentioned in my profile, Network profile that includes contact information.
1
Thank you @Wilson Hauck for your suggestion and time to go through those long reports. I will first apply ur suggestion and report back the performance changes. I will utilize your contact information to consult more. Thank you.
– TELA
Mar 30 at 15:45
@TELA The best to you as you improve your instance. Looking forward to your contact.
– Wilson Hauck
Mar 30 at 17:21
1
Unfortunately, mysql.service fail to start after saving these new variables. When I removed them, it starts. And I could not find any google result for "innodb_read_rnd_buffer_size" . Is that misspelled or just 'read_rnd_buffer_size' without 'innodb_'?. Thank you
– TELA
Mar 30 at 17:41
@TELA Dang, my humble apologies, the last two leading 'innodb_' should not have been there. Answer has been updated.
– Wilson Hauck
Mar 30 at 21:06
1
Hi @Wilson Hauck, I couldn't see any visible performance changes. Or perhaps I'm unable to measure the difference. I applied some wp hacks like turning off taxonomy term counts etc to reduce slow queries when bulk importing. Now I'm trying to simulate actual(almost) INSERT, SELECT.. queries before moving this to production. Hope, I can come up with a realistic log after that. Thank you
– TELA
Apr 7 at 13:46
|
show 8 more comments
A likely cause of high CPU and poor performance is the poor schema for wp_postmeta
. I discuss the remedy here.
Meanwhile, "you can't tune your way out of a performance problem". I did glance at the settings -- all are "reasonable".
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351748%2fmysqld-consumes-232-cpu%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
Rate Per Second = RPS - Suggestions to consider for your my.cnf [mysqld] section,
innodb_lru_scan_depth=100 # from 1024 to reduce 90% of cpu cycles used for function every SECOND
innodb_io_capacity=3500 # from 2000 to enable higher IOPS on your SSD devices
innodb_flushing_avg_loops=5 # from 30 to reduce innodb_buffer_pool_pages_dirty overhead - count was 3183 in SGStatus
read_buffer_size=256K # from 128K to reduce handler_read_next RPS of 277,134
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 778
There are many more opportunities to improve performance through Global Variables.
Disclaimer: I am the author of web site mentioned in my profile, Network profile that includes contact information.
1
Thank you @Wilson Hauck for your suggestion and time to go through those long reports. I will first apply ur suggestion and report back the performance changes. I will utilize your contact information to consult more. Thank you.
– TELA
Mar 30 at 15:45
@TELA The best to you as you improve your instance. Looking forward to your contact.
– Wilson Hauck
Mar 30 at 17:21
1
Unfortunately, mysql.service fail to start after saving these new variables. When I removed them, it starts. And I could not find any google result for "innodb_read_rnd_buffer_size" . Is that misspelled or just 'read_rnd_buffer_size' without 'innodb_'?. Thank you
– TELA
Mar 30 at 17:41
@TELA Dang, my humble apologies, the last two leading 'innodb_' should not have been there. Answer has been updated.
– Wilson Hauck
Mar 30 at 21:06
1
Hi @Wilson Hauck, I couldn't see any visible performance changes. Or perhaps I'm unable to measure the difference. I applied some wp hacks like turning off taxonomy term counts etc to reduce slow queries when bulk importing. Now I'm trying to simulate actual(almost) INSERT, SELECT.. queries before moving this to production. Hope, I can come up with a realistic log after that. Thank you
– TELA
Apr 7 at 13:46
|
show 8 more comments
Rate Per Second = RPS - Suggestions to consider for your my.cnf [mysqld] section,
innodb_lru_scan_depth=100 # from 1024 to reduce 90% of cpu cycles used for function every SECOND
innodb_io_capacity=3500 # from 2000 to enable higher IOPS on your SSD devices
innodb_flushing_avg_loops=5 # from 30 to reduce innodb_buffer_pool_pages_dirty overhead - count was 3183 in SGStatus
read_buffer_size=256K # from 128K to reduce handler_read_next RPS of 277,134
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 778
There are many more opportunities to improve performance through Global Variables.
Disclaimer: I am the author of web site mentioned in my profile, Network profile that includes contact information.
1
Thank you @Wilson Hauck for your suggestion and time to go through those long reports. I will first apply ur suggestion and report back the performance changes. I will utilize your contact information to consult more. Thank you.
– TELA
Mar 30 at 15:45
@TELA The best to you as you improve your instance. Looking forward to your contact.
– Wilson Hauck
Mar 30 at 17:21
1
Unfortunately, mysql.service fail to start after saving these new variables. When I removed them, it starts. And I could not find any google result for "innodb_read_rnd_buffer_size" . Is that misspelled or just 'read_rnd_buffer_size' without 'innodb_'?. Thank you
– TELA
Mar 30 at 17:41
@TELA Dang, my humble apologies, the last two leading 'innodb_' should not have been there. Answer has been updated.
– Wilson Hauck
Mar 30 at 21:06
1
Hi @Wilson Hauck, I couldn't see any visible performance changes. Or perhaps I'm unable to measure the difference. I applied some wp hacks like turning off taxonomy term counts etc to reduce slow queries when bulk importing. Now I'm trying to simulate actual(almost) INSERT, SELECT.. queries before moving this to production. Hope, I can come up with a realistic log after that. Thank you
– TELA
Apr 7 at 13:46
|
show 8 more comments
Rate Per Second = RPS - Suggestions to consider for your my.cnf [mysqld] section,
innodb_lru_scan_depth=100 # from 1024 to reduce 90% of cpu cycles used for function every SECOND
innodb_io_capacity=3500 # from 2000 to enable higher IOPS on your SSD devices
innodb_flushing_avg_loops=5 # from 30 to reduce innodb_buffer_pool_pages_dirty overhead - count was 3183 in SGStatus
read_buffer_size=256K # from 128K to reduce handler_read_next RPS of 277,134
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 778
There are many more opportunities to improve performance through Global Variables.
Disclaimer: I am the author of web site mentioned in my profile, Network profile that includes contact information.
Rate Per Second = RPS - Suggestions to consider for your my.cnf [mysqld] section,
innodb_lru_scan_depth=100 # from 1024 to reduce 90% of cpu cycles used for function every SECOND
innodb_io_capacity=3500 # from 2000 to enable higher IOPS on your SSD devices
innodb_flushing_avg_loops=5 # from 30 to reduce innodb_buffer_pool_pages_dirty overhead - count was 3183 in SGStatus
read_buffer_size=256K # from 128K to reduce handler_read_next RPS of 277,134
read_rnd_buffer_size=192K # from 256K to reduce handler_read_rnd_next RPS of 778
There are many more opportunities to improve performance through Global Variables.
Disclaimer: I am the author of web site mentioned in my profile, Network profile that includes contact information.
edited Mar 30 at 21:04
answered Mar 30 at 14:58
Wilson HauckWilson Hauck
8511 gold badge6 silver badges12 bronze badges
8511 gold badge6 silver badges12 bronze badges
1
Thank you @Wilson Hauck for your suggestion and time to go through those long reports. I will first apply ur suggestion and report back the performance changes. I will utilize your contact information to consult more. Thank you.
– TELA
Mar 30 at 15:45
@TELA The best to you as you improve your instance. Looking forward to your contact.
– Wilson Hauck
Mar 30 at 17:21
1
Unfortunately, mysql.service fail to start after saving these new variables. When I removed them, it starts. And I could not find any google result for "innodb_read_rnd_buffer_size" . Is that misspelled or just 'read_rnd_buffer_size' without 'innodb_'?. Thank you
– TELA
Mar 30 at 17:41
@TELA Dang, my humble apologies, the last two leading 'innodb_' should not have been there. Answer has been updated.
– Wilson Hauck
Mar 30 at 21:06
1
Hi @Wilson Hauck, I couldn't see any visible performance changes. Or perhaps I'm unable to measure the difference. I applied some wp hacks like turning off taxonomy term counts etc to reduce slow queries when bulk importing. Now I'm trying to simulate actual(almost) INSERT, SELECT.. queries before moving this to production. Hope, I can come up with a realistic log after that. Thank you
– TELA
Apr 7 at 13:46
|
show 8 more comments
1
Thank you @Wilson Hauck for your suggestion and time to go through those long reports. I will first apply ur suggestion and report back the performance changes. I will utilize your contact information to consult more. Thank you.
– TELA
Mar 30 at 15:45
@TELA The best to you as you improve your instance. Looking forward to your contact.
– Wilson Hauck
Mar 30 at 17:21
1
Unfortunately, mysql.service fail to start after saving these new variables. When I removed them, it starts. And I could not find any google result for "innodb_read_rnd_buffer_size" . Is that misspelled or just 'read_rnd_buffer_size' without 'innodb_'?. Thank you
– TELA
Mar 30 at 17:41
@TELA Dang, my humble apologies, the last two leading 'innodb_' should not have been there. Answer has been updated.
– Wilson Hauck
Mar 30 at 21:06
1
Hi @Wilson Hauck, I couldn't see any visible performance changes. Or perhaps I'm unable to measure the difference. I applied some wp hacks like turning off taxonomy term counts etc to reduce slow queries when bulk importing. Now I'm trying to simulate actual(almost) INSERT, SELECT.. queries before moving this to production. Hope, I can come up with a realistic log after that. Thank you
– TELA
Apr 7 at 13:46
1
1
Thank you @Wilson Hauck for your suggestion and time to go through those long reports. I will first apply ur suggestion and report back the performance changes. I will utilize your contact information to consult more. Thank you.
– TELA
Mar 30 at 15:45
Thank you @Wilson Hauck for your suggestion and time to go through those long reports. I will first apply ur suggestion and report back the performance changes. I will utilize your contact information to consult more. Thank you.
– TELA
Mar 30 at 15:45
@TELA The best to you as you improve your instance. Looking forward to your contact.
– Wilson Hauck
Mar 30 at 17:21
@TELA The best to you as you improve your instance. Looking forward to your contact.
– Wilson Hauck
Mar 30 at 17:21
1
1
Unfortunately, mysql.service fail to start after saving these new variables. When I removed them, it starts. And I could not find any google result for "innodb_read_rnd_buffer_size" . Is that misspelled or just 'read_rnd_buffer_size' without 'innodb_'?. Thank you
– TELA
Mar 30 at 17:41
Unfortunately, mysql.service fail to start after saving these new variables. When I removed them, it starts. And I could not find any google result for "innodb_read_rnd_buffer_size" . Is that misspelled or just 'read_rnd_buffer_size' without 'innodb_'?. Thank you
– TELA
Mar 30 at 17:41
@TELA Dang, my humble apologies, the last two leading 'innodb_' should not have been there. Answer has been updated.
– Wilson Hauck
Mar 30 at 21:06
@TELA Dang, my humble apologies, the last two leading 'innodb_' should not have been there. Answer has been updated.
– Wilson Hauck
Mar 30 at 21:06
1
1
Hi @Wilson Hauck, I couldn't see any visible performance changes. Or perhaps I'm unable to measure the difference. I applied some wp hacks like turning off taxonomy term counts etc to reduce slow queries when bulk importing. Now I'm trying to simulate actual(almost) INSERT, SELECT.. queries before moving this to production. Hope, I can come up with a realistic log after that. Thank you
– TELA
Apr 7 at 13:46
Hi @Wilson Hauck, I couldn't see any visible performance changes. Or perhaps I'm unable to measure the difference. I applied some wp hacks like turning off taxonomy term counts etc to reduce slow queries when bulk importing. Now I'm trying to simulate actual(almost) INSERT, SELECT.. queries before moving this to production. Hope, I can come up with a realistic log after that. Thank you
– TELA
Apr 7 at 13:46
|
show 8 more comments
A likely cause of high CPU and poor performance is the poor schema for wp_postmeta
. I discuss the remedy here.
Meanwhile, "you can't tune your way out of a performance problem". I did glance at the settings -- all are "reasonable".
add a comment |
A likely cause of high CPU and poor performance is the poor schema for wp_postmeta
. I discuss the remedy here.
Meanwhile, "you can't tune your way out of a performance problem". I did glance at the settings -- all are "reasonable".
add a comment |
A likely cause of high CPU and poor performance is the poor schema for wp_postmeta
. I discuss the remedy here.
Meanwhile, "you can't tune your way out of a performance problem". I did glance at the settings -- all are "reasonable".
A likely cause of high CPU and poor performance is the poor schema for wp_postmeta
. I discuss the remedy here.
Meanwhile, "you can't tune your way out of a performance problem". I did glance at the settings -- all are "reasonable".
answered May 7 at 21:13
Rick JamesRick James
76.5k5 gold badges70 silver badges112 bronze badges
76.5k5 gold badges70 silver badges112 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351748%2fmysqld-consumes-232-cpu%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Connections
is a counter of how many connections have been attempted in the past. The number of current active connections isThreads_connected
, which in your case is 6.– Bill Karwin
Mar 26 at 15:05
1
Thanks for clarification @BillKarwin. But the process mysqld still consume 232% CPU. Is there any flaws in my sql configuration. What might be the reason. Please help
– TELA
Mar 26 at 18:32
1
Hi @WilsonHauck, Thank for the followup. I've edited above with the information u requested.
– TELA
Mar 29 at 23:10
1
Thanks @WilsonHauck. Additional info attached: [SHOW FULL PROCESSLIST], [ulimit -a], [iostat -xm], [lscpu] pastebin.com/mrnyQrXf
– TELA
Mar 30 at 13:38
1
Yes 8 CPU, SSD @linode.com. At the beginning CPU was 6 and later upgraded to 8 due to high consumption. But no luck.
– TELA
Mar 30 at 14:39