ubuntu,debian,redhat,fedora,centos

Improving Page Load Times(提升页面加载时间)

分类:PHP分类:MySQL分类:ApacheThere are a number of ways to improve the amount of time it takes visitors to load your Drupal powered web site.

Measurements

There are many tools that can be used to measure page load performance on your website. Here are some that we recommend.

  1. YSlow FireFox add-on
    The YSlow FireFox add-on is maintained by Yahoo. It analyses your web page and offers a simple to understand report explaining why your website is slow to load. The tool requires that the Firebug FireFox add-on also be installed. Visit http://developer.yahoo.com/yslow/ for complete details on using the FireFox add-on. 继续阅读 »

MySQL InnoDB Performance Tuning(InnoDB性能调优)

分类:MySQLInnoDB is a transaction-safe, ACID compliant MySQL storage engine. It has commit, rollback, and crash recovery capabilities, and offers row level locking. The engine’s overview page explains, “InnoDB has been designed for maximum performance when processing large data volumes. Its CPU efficiency is probably not matched by any other disk-based relational database engine.” 继续阅读 »

用mysqldumpslow分析MySQL的slow query log

分类:MySQLmysql有一个功能就是可以log下来运行的比较慢的sql语句,默认是没有这个log的,为了开启这个功能,要修改my.cnf或者在mysql启动的时候加入一些参数。如果在my.cnf里面修改,需增加如下几行

long_query_time = 1
log-slow-queries = /var/youpath/slow.log
log-queries-not-using-indexes

long_query_time 是指执行超过多久的sql会被log下来,这里是1秒。
log-slow-queries 设置把日志写在那里,可以为空,系统会给一个缺省的文件host_name-slow.log,我生成的log就在mysql的data目录
log-queries-not-using-indexes 就是字面意思,log下来没有使用索引的query。
继续阅读 »

PhpMyadmin把Mysql5降级导入到Mysql4

分类:PHP分类:MySQL1:用Dreamweaver或者别的代码编辑器打开从Mysql5导出的.sql数据库文件
2:去掉数据库里类似DEFAULT CHARSET=utf8这样的字眼
3:把Mysql数据库里的ENGINE=MyISAM替换成TYPE=MyISAM
4:再用PhpMyadmin导入Mysql4就可以了

mysql show processlist 命令详解

分类:MySQL先简单说一下各列的含义和用途,第一列,id,不用说了吧,一个标识,你要kill一个语句的时候很有用。user列,显示单前用户,如果不是root,这个命令就只显示你权限范围内的sql语句。host列,显示这个语句是从哪个ip的哪个端口上发出的。呵呵,可以用来追踪出问题语句的用户。db列,显示这个进程目前连接的是哪个数据库。command列,显示当前连接的执行的命令,一般就是休眠(sleep),查询(query),连接(connect)。time列,此这个状态持续的时间,单位是秒。state列,显示使用当前连接的sql语句的状态,很重要的列,后续会有所有的状态的描述,请注意,state只是语句执行中的某一个状态,一个sql语句,已查询为例,可能需要经过copying to tmp table,Sorting result,Sending data等状态才可以完成,info列,显示这个sql语句,因为长度有限,所以长的sql语句就显示不全,但是一个判断问题语句的重要依据。 继续阅读 »

返回顶部