Entries Tagged as 'performance'

cacti监测mysql性能

mysql_stats

需要在被检测的mysql库里添加检测机器的权限(仅需要process权限):

grant process on *.* to username@192.168.1.1 identified by ‘password’;
flush privileges;

How do you pre-compress content(in apache)?

公司手头有几台apache(httpd2.x)的机器
主要是往外吐一堆的xml
其中最主要是一个300多k的大xml
原来为了节省流量
在服务器上打开了mod_deflate
但后来发现机器负载巨重(load>100甚至于更多)
于是就把mod_deflate关掉(mod_deflate的缺点导致的)
但是显然一把mod_deflate关掉,流量又得猛涨
难道就没有一种折衷的方案吗?
记得在n年前,sina的同学们说发布的内容页都是提供2个版本对外服务(一个压缩过的,一个未压缩的)
于是我就想能不能把这些巨大的xml文件预先压缩一下
来请求了局让apache直接取这个压过的版本呢?
于是就开始想办法
最后发现有n种方式可以实现

  1. Enable pre-compression with mod_gzip;http://schroepl.net/projekte/mod_gzip/config.htm#precompressed
  2. Use Apache rewrite rules to redirect requests (index.html) to the pre-compressed version (index.html.gz):http://www.webmasterworld.com/apache/3387947.htm
  3. Use PHP to redirect to the pre-compressed version;http://www.phpbuilder.com/tips/item.php?id=1128
  4. Use Apache feature MultiViews and apache module mod_negotiation