waterye

http://friendfeed.com/waterye

2008年6月27日 #

vi

:%s/oldstr/newstr/g    替换所有
:$    跳到文件最后一行

posted @ 2008-06-27 23:04 waterye 阅读(110) | 评论 (0)编辑 收藏

2008年6月22日 #

使用temporary memory table优化union

sharding听上去很过瘾,但实现成本也挺高的.对于通过按data进行split的表,某些select要用到union,这样可能导致lock的时间变得很长.使用temporary memory table作为中转,可以大大减少lock table的时间,使查询更快.
drop temporary table IF EXISTS table_name_tmp;
create temporary table IF NOT EXISTS table_name_tmp (a int not null,b int not null,primary key (a, b)) ENGINE = MEMORY;

insert ignore into table_name_tmp select * from table_name_1 where ;
insert ignore into table_name_tmp select * from table_name_2 where ;
insert ignore into table_name_tmp select * from table_name_3 where ;
insert ignore into table_name_tmp select * from table_name_4 where ;


select * from table_name_tmp where ;

posted @ 2008-06-22 22:27 waterye 阅读(127) | 评论 (0)编辑 收藏

2008年5月27日 #

mysqld out of memory

key_buffer_size + tmp_table_size + (read_buffer_size + sort_buffer_size + read_rnd_buffer_size +join_buffer_size )*max_connections = 21215973024

大于物理内存16G,所以导致out of memory

posted @ 2008-05-27 00:00 waterye 阅读(105) | 评论 (0)编辑 收藏

2008年5月20日 #

mysql bugs: #29838

最近mysql(5.0.45)偶尔出现"Got error 127 when reading table"的错误.原来是bug,在5.0.51已fix. 

Release Notes for MySQL Community Server 5.0.51

If one thread was performing concurrent inserts, other threads reading from the same table using equality key searches could see the index values for new rows before the data values had been written, leading to reports of table corruption. (Bug#29838)

posted @ 2008-05-20 20:27 waterye 阅读(89) | 评论 (0)编辑 收藏

2008年5月5日 #

tail+grep+awk,好慢

tail -f sql.log | grep 'table_name', 非常快
tail -f sql.log | grep 'table_name' | awk '{print substr($0,0,150)}',非常慢

posted @ 2008-05-05 20:03 waterye 阅读(117) | 评论 (0)编辑 收藏

2008年4月26日 #

mysql table information

select table_name, engine, row_format, table_rows, data_length, index_length, max_data_length, data_free 
  
from information_schema.tables 
 
order by table_rows desc, data_length desc limit 100

mysql 5.x 增加information_schema

posted @ 2008-04-26 15:51 waterye 阅读(137) | 评论 (0)编辑 收藏

2008年4月18日 #

VisualVM

VisualVM is a visual tool that integrates several existing JDK software tools and lightweight memory and CPU profiling capabilities. This tool is designed for both production and development time use and further enhances the capability of monitoring and performance analysis for the Java SE platform.

目前还是用jconsole远程观察jvm. visualvm不知是否像听上去那么好.此项目还在beta2状态.好像dev.java.net的项目都不怎么样.

posted @ 2008-04-18 20:10 waterye 阅读(122) | 评论 (0)编辑 收藏

2008年4月4日 #

Adobe AIR

Adobe AIR is a cross-operating system runtime that enables you to use your existing HTML/Ajax, Flex, or Flash web development skills and tools to build and deploy rich Internet applications to the desktop.

air就像客户端的jvm,现在大家都喜欢提供api给developer,希望air能更加open一些,或许能获得像jvm一样的成功.

posted @ 2008-04-04 17:33 waterye 阅读(116) | 评论 (0)编辑 收藏

2008年3月22日 #

fisheye

fisheye: 代码仓库查看工具. changelog非常方便查看团队成员提交的代码. 当然还有rss功能. search也非常强大. 不过statistic功能就比较简单些.

posted @ 2008-03-22 10:47 waterye 阅读(162) | 评论 (2)编辑 收藏

2008年1月31日 #

Mysql Optimization

show variables like 'table_cache'
show variables like 'key_buffer_size'
show variables like 'thread_cache_size'
show variables like 'tmp_table_size'

SHOW STATUS LIKE 'open%tables%';
SHOW STATUS LIKE '%key_read%';
SHOW STATUS LIKE '%qc%';
SHOW STATUS LIKE '%Threads_created%';
SHOW STATUS LIKE '%Created_tmp_disk_tables%';

set GLOBAL max_connections = 2048
set GLOBAL table_cache=2048
set GLOBAL key_buffer_size=4294967296;
set GLOBAL query_cache_size=536870912;
set GLOBAL thread_cache_size=400;

http://trac.symfony-project.com/wiki/MysqlOptimization

posted @ 2008-01-31 23:22 waterye 阅读(184) | 评论 (0)编辑 收藏

仅列出标题  下一页