zoukankan      html  css  js  c++  java
  • 压力测试-查看索引

    导入100w的测试表

    链接:https://pan.baidu.com/s/1wgLz3qxncMx8N4eMX4k83Q 提取码:o3zw 

    source t100w.sql

    压测命令: 未建立索引

    mysqlslap --defaults-file=/etc/my.cnf  
    --concurrency=100 --iterations=1 --create-schema='test'  
    --query="select * from test.t100w where k2='780p'" engine=innodb  
    --number-of-queries=200 -uroot -p123 -verbose

    =====================
    mysqlslap: [Warning] Using a password on the command line interface can be insecure.
    Benchmark
    Running for engine rbose
    Average number of seconds to run all queries: 77.739 seconds
    Minimum number of seconds to run all queries: 77.739 seconds
    Maximum number of seconds to run all queries: 77.739 seconds
    Number of clients running queries: 100
    Average number of queries per client: 2
    ======================

    建立合适索引

    mysql> use test
    mysql> alter table t100w add index idx_k2(k2);

    再次 压测

    mysqlslap --defaults-file=/etc/my.cnf  
    --concurrency=100 --iterations=1 --create-schema='test'  
    --query="select * from test.t100w where k2='780p'" engine=innodb  
    --number-of-queries=200 -uroot -p123 -verbose

    mysqlslap: [Warning] Using a password on the command line interface can be insecure.
    Benchmark
    Running for engine rbose
    Average number of seconds to run all queries: 0.263 seconds
    Minimum number of seconds to run all queries: 0.263 seconds
    Maximum number of seconds to run all queries: 0.263 seconds
    Number of clients running queries: 100
    Average number of queries per client: 2

  • 相关阅读:
    Celery(异步任务,定时任务,周期任务)
    SQLAlchemy的应用创建
    SQLAlchemy多对多
    SQLAlchemy
    app开发-2
    app开发-3
    app开发-1
    MongoDB-pymongo
    MongoDB-增删改查
    MongoDB-数据类型
  • 原文地址:https://www.cnblogs.com/Mercury-linux/p/12391057.html
Copyright © 2011-2022 走看看