PDA

View Full Version : Checking MySQL connection statistics


Shockt
6-26-05, 11:44 PM
On my website, I recently reached the 72,000 queries per hour limit and am wondering what is going on. There is no way my users could reach a limit like that so I figured someone must be spamming it or something. How do I check what the statistics are?

RTH10260
6-27-05, 01:20 AM
On my website, I recently reached the 72,000 queries per hour limit and am wondering what is going on. There is no way my users could reach a limit like that so I figured someone must be spamming it or something. How do I check what the statistics are?There are no MySql statistics available to the best of my knowledge. Check the webstats of your site for usage patterns in the hour you hit the limits.

You may want to use the following tool to observe the current log:
extras EasyLogTool: http://forum.powweb.com/showthread.php?t=47076

coldhead
6-27-05, 05:14 AM
echo this `/usr/bin/mysqladmin -hmysql??.powweb.com -uusername -ppassword status`

path might be out.
won't tell u users stats but gives something like
Uptime: 19251 Threads: 4 Questions: 985 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 28 Queries per second avg: 0.051



echo this `/usr/bin/mysqladmin -hmysql??.powweb.com -uusername -ppassword extended-status`

gives something like this
edited...
Aborted_clients | 6 |
| Aborted_connects | 4 |
| Bytes_received | 52632 |
| Bytes_sent | 7701545 |
| Com_change_db | 54 |
| Com_change_master | 0 |
| Com_check | 2 |
| Com_drop_table | 0
| Com_select | 680 |
| Com_set_option | 99 |
| Com_show_create_table | 25 |
| Com_show_fields | 27 |
| Com_show_grants | 0 |
| Com_show_processlist | 20 |
| Com_show_status | 3 |
| Connections | 46 |
| Created_tmp_disk_tables | 368 |
| Created_tmp_files | 3 |
| Created_tmp_tables | 849 |
| Questions | 986 |
| Select_full_join | 18 |
| Select_scan | 566 |
| Sort_rows | 59 |
| Sort_scan | 20 |
| Table_locks_immediate | 649 |
| Table_locks_waited | 0 |
| Threads_cached | 0 |
| Threads_connected | 4 |
| Threads_created | 45 |
| Threads_running | 1 |
| Uptime | 19269 |

not sure if this is just for your database

RTH10260
6-27-05, 08:30 AM
echo this `/usr/bin/mysqladmin -hmysql??.powweb.com -uusername -ppassword status`
echo this `/usr/bin/mysqladmin -hmysql??.powweb.com -uusername -ppassword extended-status`Hint: use the SHOW STATUS command directly in phpmyadmin in the SQL Window.
Ref for SHOW STATUS: http://dev.mysql.com/doc/mysql/en/show-status.html: