dstat

介绍

安装

#ubuntu
apt-get install dstat

#centos
yum install dstat

 

使用

其他stat工具(sysstat mpstat cifsiostat sar vmstat iostat netstat nfsstat ifstat)

 

nmon

介绍

nmon 工具可以帮助在一个屏幕上显示所有重要的性能优化信息,并动态地对其进行更新。这个高效的工具可以工作于任何哑屏幕、telnet 会话、甚至拨号线路。另外,它并不会消耗大量的 CPU 周期,通常低于百分之二。在更新的计算机上,其 CPU 使用率将低于百分之一。

 

安装

#Centos6_x86 (包含了多个系统的二进制包,选择匹配自己系统的)

wget http://sourceforge.net/projects/nmon/files/nmon_linux_14i.tar.gz

 mkdir nmon

tar -zxvf nmon_linux_14i.tar.gz -C nmon

cd nmon
./nmon_x86_centos6

 

 

使用

 

tsar

介绍

Tsar是淘宝的采集工具,主要用来收集服务器的系统信息(如cpu,io,mem,tcp等)以及应用数据(如squid haproxy nginx等),tsar支持实时查看和历史查看,方便了解应用和服务器的信息!

https://github.com/alibaba/tsar

安装

wget -O tsar.zip https://github.com/alibaba/tsar/archive/master.zip --no-check-certificate
unzip tsar.zip
cd tsar-master
make
make install

 

 

任意环境下调试php,debug php

在不管php.ini配置的情况下开启php调试,php debug.

在你需要调试的php文件首行中加入.

ini_set('display_errors',1); //错误信息
ini_set('display_startup_errors',1); //php启动错误信息
error_reporting(-1); //打印出所有的 错误信息
ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); //将出错信息输出到一个文本文件

开发环境调试php,debug php php.ini 配置

;显示错误信息
display_errors = On
;显示php开始错误信息
display_startup_errors = On
;日志记录错误信息
log_errors = On
log_errors = On
error_log = "/usr/local/php/var/log/php-fpm.log"
error_reporting=E_ALL&~E_NOTICE

php-fom conf配置

[global]
error_log = /usr/local/php/var/log/php-fpm.log
log_level = notice

[www]
catch_workers_output = yes

参考文档:

errorfunc.configuration.php