#
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
最近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)
tail -f sql.log | grep 'table_name', 非常快
tail -f sql.log | grep 'table_name' | awk '{print substr($0,0,150)}',非常慢
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
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的項目都不怎么樣.
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一樣的成功.
fisheye: 代碼倉庫查看工具. changelog非常方便查看團隊成員提交的代碼. 當然還有rss功能. search也非常強大. 不過statistic功能就比較簡單些.
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
使用fileupload上傳文件,有些瀏覽器會出現亂碼. 使用setHeaderEncoding就可以解決.
ServletFileUpload upload = new ServletFileUpload(factory);
String charset = request.getCharacterEncoding();
if (charset != null) {
upload.setHeaderEncoding(charset);
}
String charset = request.getCharacterEncoding();
if (charset!=null) value = item.getString(charset);
else value = item.getString();