我在PHP中调用了函数mysql_stat()
,它给了我以下结果:
我在6天前创建了数据库,但是uptime
建议,这是近90天前(或者这是服务器的最后一次重启?)
查询beeing slow query
的阈值是什么?
我可以以某种方式检查,哪些查询哪个慢?
如果我的数据库中只有3个表,那么open Tables
如何才能为6?
条目Threads
,Opens
和Flush tables
的含义是什么?
是否可以重置统计信息?
答案 0 :(得分:6)
由于PHP DOCS使用mysql
延期,因此不建议使用mysqli
。请改用 o Uptime
The number of seconds the MySQL server has been running.
o Threads
The number of active threads (clients).
o Questions
The number of questions (queries) from clients since the server was
started.
o Slow queries
The number of queries that have taken more than long_query_time
seconds. (MySQL DOSC "The Slow Query Log" section).
o Opens
The number of tables the server has opened.
o Flush tables
The number of flush-*, refresh, and reload commands the server has
executed.
o Open tables
The number of tables that currently are open.
o Memory in use
The amount of memory allocated directly by mysqld. This value is
displayed only when MySQL has been compiled with safemalloc, which
is available only before MySQL 5.5.6.
o Maximum memory used
The maximum amount of memory allocated directly by mysqld. This
value is displayed only when MySQL has been compiled with
safemalloc, which is available only before MySQL 5.5.6.
。
字段的含义:
#> mysqladmin flush-host
要重置此值,请在mysql服务器终端中使用{{1}}。
答案 1 :(得分:2)
如果您的网站托管在共享托管中,那么该信息可能来自多个数据库,而不仅仅是您的! :)