首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > mysql cluster 运用disk data storage 的测试
【标  题】:mysql cluster 运用disk data storage 的测试
【关键字】:mysql,cluster,disk,data,storage
【来  源】:http://www.cublog.cn/u/4312/showart.php?id=280677

mysql cluster 运用disk data storage 的测试

今天做了一个mysql cluster中用disk data storage的测试,通过对比,确实能够大幅减少内存的使用.
百万条小记录.测试过程如下.
1.未使用disk data storage前.测试脚本
文件nodiskdata.test
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12));
create table t3(id3 int not null, t char(12), index(id3));
disable_query_log;
let $1 = 100;
while ($1)
 {
  let $2 =100 ;
  eval insert into t1(t) values ('$1');
  while ($2)
   {
     eval insert into t2(id2,t) values ($1,'$2');
     let $3 = 100;
     while ($3)
     {
       eval insert into t3(id3,t) values ($1,'$2');
       dec $3;
     }
     dec $2;
   }
  dec $1;
 }
enable_query_log;
 
运行
#mysqltest < nodiskdata.test
#ndb_mgm -e "all dump 1000"
#tail /var/lib/mysql-cluster/ndb_1_cluster.log
看到
Data usage increased to 83%(2133 32K pages of total 2560)
Index usage is 61%(1894 8K pages of total 3104)
 
2.用了disk data storage后.测试脚本
文件diskdata.test
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
create logfile group lg_1
        add undofile 'undo_1.dat'
        initial_size 32M
        undo_buffer_size 8M;
create tablespace ts_1
        add datafile 'data_1.dat'
        use logfile group lg_1
        initial_size 64M;
create table t1(id1 int not null auto_increment primary key, t char(12)) tablespace ts_1 storage disk;
create table t2(id2 int not null, t char(12)) tablespace ts_1 storage disk;
create table t3(id3 int not null, t char(12), index(id3)) tablespace ts_1 storage disk;
disable_query_log;
let $1 = 100;
while ($1)
 {
  let $2 =100 ;
  eval insert into t1(t) values ('$1');
  while ($2)
   {
     eval insert into t2(id2,t) values ($1,'$2');
     let $3 = 100;
     while ($3)
     {
       eval insert into t3(id3,t) values ($1,'$2');
       dec $3;
     }
     dec $2;
   }
  dec $1;
 }
enable_query_log;
 
运行
#mysqltest < diskdata.test
#ndb_mgm -e "all dump 1000"
#tail /var/lib/mysql-cluster/ndb_1_cluster.log
看到
Data usage is 74%(1896 32K pages of total 2560)
Index usage is 61%(1894 8K pages of total 3104)
 
3.从我所建的表中,索引列占用的内存很多,所以data usage下降不明显,但是仔细计算,可以发现非索引列确实达到了移出内存,使用磁盘的目的.
 
4.最后,logfile,tablespace的大小要合理计算,根据具体应用设置大小.
 
 
瑞士军刀NC教程:【上一篇】
JS php 如何判断上传的文件类型:【下一篇】
【相关文章】
  • Red Hat Cluster Suite
  • 安装linux+apache+mysql+php
  • Surprise Data Query(SDQ)简介
  • mysql中操作IP地址的函数
  • Mysql分区?
  • [Python]在cygwin下编译MySQLdb for python
  • DataGridView学习笔记(一):DataGridView简介
  • Mysql的JDBC 的常见连接属性
  • 网站开发经验总结1--Tomcat与Mysql连接
  • 为你的MySQL数据库加铸23道安全门
  • 【随机文章】
  • 如何使用户点击后退按钮时,原来表单上填写的内容不丢失
  • hacker成长的代码之路:扫描(1)
  • ※※※※※【〓〓〓一个贱人的自我修养〓〓〓】※※※※※
  • 蜂窝网全解
  • 用SQL Server为Web浏览器提供图像2
  • Dell投资近1亿美金给Red Hat
  • Solr 企业级搜索引擎简介[z]
  • Linux 知识宝库
  • News! What's in WalkPace Update 2 (Part III)
  • 日本出版行业公布UHF频带IC标签实验结果
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.