最近麻烦事情真多,心情不太好!
正好今天遇到了一个关于Warning: Trying to destroy uninitialized session的问题,顺便把php.ini里面关于这报错设置的这一段给弄清楚了!
display_errors = Off
默认应该是不显示errors的.
log_errors = On
把出错信息记录到web server的错误日志中.
error_reporting = E_ALL
自己定义错误日志中应该显示什么.
error_reporting 是可以在php文件中自己设置,或者.htaccess中设置的
如:
error_reporting(0);
error_reporting(E_ERROR | E_WARNING | E_PARSE); 等同error_reporting(7)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); 等同error_reporting(15)
error_reporting(E_ALL ^ E_NOTICE); 等同error_reporting(6135)
error_reporting(E_ALL); 等同error_reporting(6143)
那么error_reporting到底有多少种形式了
value constant
1 E_ERROR
2 E_WARNING
4 E_PARSE
8 E_NOTICE
16 E_CORE_ERROR
32 E_CORE_WARNING
64 E_COMPILE_ERROR
128 E_COMPILE_WARNING
256 E_USER_ERROR
512 E_USER_WARNING
1024 E_USER_NOTICE
6143 E_ALL
2048 E_STRICT
4096 E_RECOVERABLE_ERROR
详细的计算需要查手册,不过这些数字和*nix系统中的权限位是如出一辙的
其实没什么东西,只是记录下!
最后Warning: Trying to destroy uninitialized session 也只是
把session_destroy(); 修改为了 @session_destroy();忽略掉出错信息.
2007年10月29日星期一
2007年10月14日星期日
10个需要注意的mysql变量
mysql的性能需要我们监控,今天着重介绍十个比较重要的mysql变量.
原文来自http://blogs.techrepublic.com.com/opensource/?p=56,我并不觉得这10个变量都重要的值得去监控,但是也是必须去了解的!等以后我觉得有更重要的变量需要了解的时候,会再写下来的!今天找了好久才找到这篇文章的,本来那天看见就准备抄过来的,呵呵:)
1 Threads_connected
首先需要注意的,想得到这个变量的值不能show variables like 'Threads_connected';而是
show status like 'Threads_connected'(下面的变值也是这样的);
意思:变量的值是表示当前有多少个客户连接该mysql服务器
引申:连接数是否过多,网络时候存在问题!特别是在pconnect的情况下:)
2 Created_tmp_disk_tables
意思:在硬盘上建立的临时表数目
引申:如果这个值比较大的话,那么查询时需要建立临时表(CREATE TEMPORARY TABLE)的操作 就要消耗更多的时间
3 Handler_read_first
意思:读表索引的第一行
引申:如果这个值变化比较大的话,可以认为表索引建立的有问题,全索引的扫描操作比较多
4 Innodb_buffer_pool_wait_free
意思:This variable indicates the number of times MySQL has to wait for memory pages to be flus
引申:If this variable is high, it suggests that MySQL's memory buffer is incorrectly configured for the amount of writes the server is currently performing.
不了解这个:)
5 Key_reads
意思:读文件系统上面的索引的次数
引申:如果这个值太大的话,就需要考虑key cache设置是否正常了
6 Max_used_connections
意思:重起后到现在最大连接数
引申:服务器负载和可能需要调节的连接数
7 Open_tables
意思:当前打开的表的数目
引申:如果这个值很低,table cache很大,则减小table cache的设置是没有问题的,如果这个值很大,并接近了table cache的值,我们就需要加大talbe cache的设置
8 Select_full_join
意思:全连接的查询数目
引申:数值过大,需要建立更多的索引来避免
9 Slow_queries
意思:慢查询的数目
引申:过大的话就要察看慢查询的日志,并且检查sql语句书写是否恰当
10 Uptime
意思:运行时间,单位秒
引申:This value is useful to analyze server uptime, as well as to generate reports on overall system performance. A consistent low value indicates that the server is being frequently restarted, thereby causing frequent interruptions to client service.
总算翻译的大差不差了:)
原文来自http://blogs.techrepublic.com.com/opensource/?p=56,我并不觉得这10个变量都重要的值得去监控,但是也是必须去了解的!等以后我觉得有更重要的变量需要了解的时候,会再写下来的!今天找了好久才找到这篇文章的,本来那天看见就准备抄过来的,呵呵:)
1 Threads_connected
首先需要注意的,想得到这个变量的值不能show variables like 'Threads_connected';而是
show status like 'Threads_connected'(下面的变值也是这样的);
意思:变量的值是表示当前有多少个客户连接该mysql服务器
引申:连接数是否过多,网络时候存在问题!特别是在pconnect的情况下:)
2 Created_tmp_disk_tables
意思:在硬盘上建立的临时表数目
引申:如果这个值比较大的话,那么查询时需要建立临时表(CREATE TEMPORARY TABLE)的操作 就要消耗更多的时间
3 Handler_read_first
意思:读表索引的第一行
引申:如果这个值变化比较大的话,可以认为表索引建立的有问题,全索引的扫描操作比较多
4 Innodb_buffer_pool_wait_free
意思:This variable indicates the number of times MySQL has to wait for memory pages to be flus
引申:If this variable is high, it suggests that MySQL's memory buffer is incorrectly configured for the amount of writes the server is currently performing.
不了解这个:)
5 Key_reads
意思:读文件系统上面的索引的次数
引申:如果这个值太大的话,就需要考虑key cache设置是否正常了
6 Max_used_connections
意思:重起后到现在最大连接数
引申:服务器负载和可能需要调节的连接数
7 Open_tables
意思:当前打开的表的数目
引申:如果这个值很低,table cache很大,则减小table cache的设置是没有问题的,如果这个值很大,并接近了table cache的值,我们就需要加大talbe cache的设置
8 Select_full_join
意思:全连接的查询数目
引申:数值过大,需要建立更多的索引来避免
9 Slow_queries
意思:慢查询的数目
引申:过大的话就要察看慢查询的日志,并且检查sql语句书写是否恰当
10 Uptime
意思:运行时间,单位秒
引申:This value is useful to analyze server uptime, as well as to generate reports on overall system performance. A consistent low value indicates that the server is being frequently restarted, thereby causing frequent interruptions to client service.
总算翻译的大差不差了:)
订阅:
博文 (Atom)
