`
LeslieWei
  • 浏览: 14108 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Memcached和Mysql数据存储测试对比

阅读更多
昨晚写了个关于Memcached和Mysql的数据存储与读取的数据对比,然后让服务器跑了一晚上,一直担心把电脑跑崩溃,还好没有,测试结果和预测的差不多。

      测试的平台是Memcached-1.4.13和MySql-14.14;

      访问数据库工具是iBatIS+JDBC;

      操作系统CentOS6;

      CPU:Pentium(R) Dual-Core  CPU      E5300  @ 2.60GHz双核;

      网络环境:本地自环回路;

      测试线程100条,每条线程分别进行100次读写,统计平均时间和总时间。

      最后的结论是Memcached的单独删除操作平均耗时是5~6ms,单独写操作平均耗时是2~3.5ms,单独读操作平均耗时是1.5~3ms,可见读操作和写操作的耗时基本上是一样的,这跟Memcached内部采用Hash查找算法有关吧,而删除操作是写和读的两倍的原因是删除操作要先查找再写,所以时间消耗是其两倍。

      而对Mysql的测试没有做关于delete操作和update操作的统计,只对insert和select操作进行了统计,而且数据表中的操作只有两个键,项越多,数据库越复杂,耗时应该更大。统计结果表明,向空数据表中写100条数据的平均耗时是39ms(一条一条的写,非批量写),向含有10240(10KB)条记录的数据库中读数据的情况为:单独读100条数据的平均耗时为:15ms~25ms,而批量读数据(一次读100条记录)的耗时是50~150ms,平均到每条记录的读取时间是0.5~1.5ms。

       心得体会:在进行数据库读数据的时候如果数据比较集中,建议先批量读出来存放到缓冲区,现在很多数据库访问工具都集成了对缓冲区的管理。在进行数据的分散读写操作的时候建议先采用缓冲操作,再进行对数据库的相应操作,使用本地内存缓冲的速度应该比Memcached更快。

下面附录上具体的测试结果,免得以后想用的时候又找不到了,我一向的收拾不好,而且忘性还很大,呵呵。

thread 40: runs: 100 stores of obj 10KB -- avg time per req 3.64 ms (total: 364 ms)
thread 40: runs: 100 gets of obj 10KB -- avg time per req 1.8 ms (total: 180 ms)

thread 41: runs: 100 deletes of obj 10KB -- avg time per req 5.1 ms (total: 510 ms)
thread 41: runs: 100 stores of obj 10KB -- avg time per req 3.33 ms (total: 333 ms)
thread 41: runs: 100 gets of obj 10KB -- avg time per req 2.29 ms (total: 229 ms)

thread 42: runs: 100 deletes of obj 10KB -- avg time per req 5.28 ms (total: 528 ms)
thread 42: runs: 100 stores of obj 10KB -- avg time per req 3.64 ms (total: 364 ms)
thread 42: runs: 100 gets of obj 10KB -- avg time per req 1.83 ms (total: 183 ms)

thread 43: runs: 100 deletes of obj 10KB -- avg time per req 5.65 ms (total: 565 ms)
thread 43: runs: 100 stores of obj 10KB -- avg time per req 3.29 ms (total: 329 ms)
thread 43: runs: 100 gets of obj 10KB -- avg time per req 1.65 ms (total: 165 ms)

thread 44: runs: 100 deletes of obj 10KB -- avg time per req 5.94 ms (total: 594 ms)
thread 44: runs: 100 stores of obj 10KB -- avg time per req 2.98 ms (total: 298 ms)
thread 44: runs: 100 gets of obj 10KB -- avg time per req 1.65 ms (total: 165 ms)

thread 45: runs: 100 deletes of obj 10KB -- avg time per req 5.42 ms (total: 542 ms)
thread 45: runs: 100 stores of obj 10KB -- avg time per req 2.93 ms (total: 293 ms)
thread 45: runs: 100 gets of obj 10KB -- avg time per req 1.8 ms (total: 180 ms)

thread 46: runs: 100 deletes of obj 10KB -- avg time per req 6.05 ms (total: 605 ms)
thread 46: runs: 100 stores of obj 10KB -- avg time per req 3.43 ms (total: 343 ms)
thread 46: runs: 100 gets of obj 10KB -- avg time per req 1.38 ms (total: 138 ms)

thread 47: runs: 100 deletes of obj 10KB -- avg time per req 5.36 ms (total: 536 ms)
thread 47: runs: 100 stores of obj 10KB -- avg time per req 3.06 ms (total: 306 ms)
thread 47: runs: 100 gets of obj 10KB -- avg time per req 2.22 ms (total: 222 ms)

thread 48: runs: 100 deletes of obj 10KB -- avg time per req 6.29 ms (total: 629 ms)
thread 48: runs: 100 stores of obj 10KB -- avg time per req 2.62 ms (total: 262 ms)
thread 48: runs: 100 gets of obj 10KB -- avg time per req 1.62 ms (total: 162 ms)

thread 49: runs: 100 deletes of obj 10KB -- avg time per req 4.09 ms (total: 409 ms)
thread 49: runs: 100 stores of obj 10KB -- avg time per req 3.34 ms (total: 334 ms)
thread 49: runs: 100 gets of obj 10KB -- avg time per req 2.62 ms (total: 262 ms)

thread 50: runs: 100 deletes of obj 10KB -- avg time per req 5.56 ms (total: 556 ms)
thread 50: runs: 100 stores of obj 10KB -- avg time per req 3.2 ms (total: 320 ms)
thread 50: runs: 100 gets of obj 10KB -- avg time per req 2.02 ms (total: 202 ms)

thread 51: runs: 100 deletes of obj 10KB -- avg time per req 6.26 ms (total: 626 ms)
thread 51: runs: 100 stores of obj 10KB -- avg time per req 2.66 ms (total: 266 ms)
thread 51: runs: 100 gets of obj 10KB -- avg time per req 1.9 ms (total: 190 ms)

thread 52: runs: 100 deletes of obj 10KB -- avg time per req 4.5 ms (total: 450 ms)
thread 52: runs: 100 stores of obj 10KB -- avg time per req 3.81 ms (total: 381 ms)
thread 52: runs: 100 gets of obj 10KB -- avg time per req 1.82 ms (total: 182 ms)

thread 53: runs: 100 deletes of obj 10KB -- avg time per req 6.0 ms (total: 600 ms)
thread 53: runs: 100 stores of obj 10KB -- avg time per req 3.57 ms (total: 357 ms)
thread 53: runs: 100 gets of obj 10KB -- avg time per req 1.25 ms (total: 125 ms)

thread 54: runs: 100 deletes of obj 10KB -- avg time per req 5.48 ms (total: 548 ms)
thread 54: runs: 100 stores of obj 10KB -- avg time per req 3.06 ms (total: 306 ms)
thread 54: runs: 100 gets of obj 10KB -- avg time per req 2.24 ms (total: 224 ms)

thread 55: runs: 100 deletes of obj 10KB -- avg time per req 3.97 ms (total: 397 ms)
thread 55: runs: 100 stores of obj 10KB -- avg time per req 3.39 ms (total: 339 ms)
thread 55: runs: 100 gets of obj 10KB -- avg time per req 2.45 ms (total: 245 ms)

thread 56: runs: 100 deletes of obj 10KB -- avg time per req 6.06 ms (total: 606 ms)
thread 56: runs: 100 stores of obj 10KB -- avg time per req 3.68 ms (total: 368 ms)
thread 56: runs: 100 gets of obj 10KB -- avg time per req 1.15 ms (total: 115 ms)

thread 57: runs: 100 deletes of obj 10KB -- avg time per req 5.1 ms (total: 510 ms)
thread 57: runs: 100 stores of obj 10KB -- avg time per req 2.88 ms (total: 288 ms)
thread 57: runs: 100 gets of obj 10KB -- avg time per req 2.19 ms (total: 219 ms)

thread 58: runs: 100 deletes of obj 10KB -- avg time per req 6.19 ms (total: 619 ms)
thread 58: runs: 100 stores of obj 10KB -- avg time per req 2.7 ms (total: 270 ms)
thread 58: runs: 100 gets of obj 10KB -- avg time per req 1.79 ms (total: 179 ms)

thread 59: runs: 100 deletes of obj 10KB -- avg time per req 6.18 ms (total: 618 ms)
thread 59: runs: 100 stores of obj 10KB -- avg time per req 3.51 ms (total: 351 ms)
thread 59: runs: 100 gets of obj 10KB -- avg time per req 1.08 ms (total: 108 ms)

thread 60: runs: 100 deletes of obj 10KB -- avg time per req 5.0 ms (total: 500 ms)
thread 60: runs: 100 stores of obj 10KB -- avg time per req 2.91 ms (total: 291 ms)
thread 60: runs: 100 gets of obj 10KB -- avg time per req 2.35 ms (total: 235 ms)

thread 61: runs: 100 deletes of obj 10KB -- avg time per req 6.26 ms (total: 626 ms)
thread 61: runs: 100 stores of obj 10KB -- avg time per req 3.05 ms (total: 305 ms)
thread 61: runs: 100 gets of obj 10KB -- avg time per req 1.49 ms (total: 149 ms)

thread 62: runs: 100 deletes of obj 10KB -- avg time per req 5.93 ms (total: 593 ms)
thread 62: runs: 100 stores of obj 10KB -- avg time per req 3.52 ms (total: 352 ms)
thread 62: runs: 100 gets of obj 10KB -- avg time per req 1.38 ms (total: 138 ms)

thread 63: runs: 100 deletes of obj 10KB -- avg time per req 6.24 ms (total: 624 ms)
thread 63: runs: 100 stores of obj 10KB -- avg time per req 2.62 ms (total: 262 ms)
thread 63: runs: 100 gets of obj 10KB -- avg time per req 1.64 ms (total: 164 ms)

thread 64: runs: 100 deletes of obj 10KB -- avg time per req 4.26 ms (total: 426 ms)
thread 64: runs: 100 stores of obj 10KB -- avg time per req 2.68 ms (total: 268 ms)
thread 64: runs: 100 gets of obj 10KB -- avg time per req 2.63 ms (total: 263 ms)

thread 65: runs: 100 deletes of obj 10KB -- avg time per req 5.6 ms (total: 560 ms)
thread 65: runs: 100 stores of obj 10KB -- avg time per req 3.27 ms (total: 327 ms)
thread 65: runs: 100 gets of obj 10KB -- avg time per req 1.82 ms (total: 182 ms)

thread 66: runs: 100 deletes of obj 10KB -- avg time per req 5.97 ms (total: 597 ms)
thread 66: runs: 100 stores of obj 10KB -- avg time per req 3.36 ms (total: 336 ms)
thread 66: runs: 100 gets of obj 10KB -- avg time per req 1.43 ms (total: 143 ms)

thread 67: runs: 100 deletes of obj 10KB -- avg time per req 6.07 ms (total: 607 ms)
thread 67: runs: 100 stores of obj 10KB -- avg time per req 3.43 ms (total: 343 ms)
thread 67: runs: 100 gets of obj 10KB -- avg time per req 1.27 ms (total: 127 ms)

thread 68: runs: 100 deletes of obj 10KB -- avg time per req 5.67 ms (total: 567 ms)
thread 68: runs: 100 stores of obj 10KB -- avg time per req 2.66 ms (total: 266 ms)
thread 68: runs: 100 gets of obj 10KB -- avg time per req 2.25 ms (total: 225 ms)

thread 69: runs: 100 deletes of obj 10KB -- avg time per req 5.6 ms (total: 560 ms)
thread 69: runs: 100 stores of obj 10KB -- avg time per req 3.13 ms (total: 313 ms)
thread 69: runs: 100 gets of obj 10KB -- avg time per req 1.94 ms (total: 194 ms)

thread 70: runs: 100 deletes of obj 10KB -- avg time per req 5.71 ms (total: 571 ms)
thread 70: runs: 100 stores of obj 10KB -- avg time per req 3.6 ms (total: 360 ms)
thread 70: runs: 100 gets of obj 10KB -- avg time per req 1.48 ms (total: 148 ms)

thread 71: runs: 100 deletes of obj 10KB -- avg time per req 6.01 ms (total: 601 ms)
thread 71: runs: 100 stores of obj 10KB -- avg time per req 2.61 ms (total: 261 ms)
thread 71: runs: 100 gets of obj 10KB -- avg time per req 1.66 ms (total: 166 ms)

thread 72: runs: 100 deletes of obj 10KB -- avg time per req 5.53 ms (total: 553 ms)
thread 72: runs: 100 stores of obj 10KB -- avg time per req 2.96 ms (total: 296 ms)
thread 72: runs: 100 gets of obj 10KB -- avg time per req 1.99 ms (total: 199 ms)

thread 73: runs: 100 deletes of obj 10KB -- avg time per req 5.69 ms (total: 569 ms)
thread 73: runs: 100 stores of obj 10KB -- avg time per req 2.57 ms (total: 257 ms)
thread 73: runs: 100 gets of obj 10KB -- avg time per req 2.27 ms (total: 227 ms)

thread 74: runs: 100 deletes of obj 10KB -- avg time per req 4.92 ms (total: 492 ms)
thread 74: runs: 100 stores of obj 10KB -- avg time per req 3.18 ms (total: 318 ms)
thread 74: runs: 100 gets of obj 10KB -- avg time per req 1.85 ms (total: 185 ms)

thread 75: runs: 100 deletes of obj 10KB -- avg time per req 5.57 ms (total: 557 ms)
thread 75: runs: 100 stores of obj 10KB -- avg time per req 2.68 ms (total: 268 ms)
thread 75: runs: 100 gets of obj 10KB -- avg time per req 2.14 ms (total: 214 ms)

thread 76: runs: 100 deletes of obj 10KB -- avg time per req 5.3 ms (total: 530 ms)
thread 76: runs: 100 stores of obj 10KB -- avg time per req 2.94 ms (total: 294 ms)
thread 76: runs: 100 gets of obj 10KB -- avg time per req 2.02 ms (total: 202 ms)

thread 77: runs: 100 deletes of obj 10KB -- avg time per req 4.81 ms (total: 481 ms)
thread 77: runs: 100 stores of obj 10KB -- avg time per req 2.74 ms (total: 274 ms)
thread 77: runs: 100 gets of obj 10KB -- avg time per req 2.7 ms (total: 270 ms)

thread 78: runs: 100 deletes of obj 10KB -- avg time per req 4.38 ms (total: 438 ms)
thread 78: runs: 100 stores of obj 10KB -- avg time per req 3.52 ms (total: 352 ms)
thread 78: runs: 100 gets of obj 10KB -- avg time per req 2.43 ms (total: 243 ms)

thread 79: runs: 100 deletes of obj 10KB -- avg time per req 5.69 ms (total: 569 ms)
thread 79: runs: 100 stores of obj 10KB -- avg time per req 2.54 ms (total: 254 ms)
thread 79: runs: 100 gets of obj 10KB -- avg time per req 2.34 ms (total: 234 ms)

thread 80: runs: 100 deletes of obj 10KB -- avg time per req 4.19 ms (total: 419 ms)
thread 80: runs: 100 stores of obj 10KB -- avg time per req 3.02 ms (total: 302 ms)
thread 80: runs: 100 gets of obj 10KB -- avg time per req 2.91 ms (total: 291 ms)

thread 81: runs: 100 deletes of obj 10KB -- avg time per req 6.16 ms (total: 616 ms)
thread 81: runs: 100 stores of obj 10KB -- avg time per req 3.41 ms (total: 341 ms)
thread 81: runs: 100 gets of obj 10KB -- avg time per req 1.16 ms (total: 116 ms)

thread 82: runs: 100 deletes of obj 10KB -- avg time per req 5.55 ms (total: 555 ms)
thread 82: runs: 100 stores of obj 10KB -- avg time per req 3.45 ms (total: 345 ms)
thread 82: runs: 100 gets of obj 10KB -- avg time per req 1.53 ms (total: 153 ms)

thread 83: runs: 100 deletes of obj 10KB -- avg time per req 5.92 ms (total: 592 ms)
thread 83: runs: 100 stores of obj 10KB -- avg time per req 2.73 ms (total: 273 ms)
thread 83: runs: 100 gets of obj 10KB -- avg time per req 1.85 ms (total: 185 ms)

thread 84: runs: 100 deletes of obj 10KB -- avg time per req 5.69 ms (total: 569 ms)
thread 84: runs: 100 stores of obj 10KB -- avg time per req 3.51 ms (total: 351 ms)
thread 84: runs: 100 gets of obj 10KB -- avg time per req 1.49 ms (total: 149 ms)

thread 85: runs: 100 deletes of obj 10KB -- avg time per req 4.75 ms (total: 475 ms)
thread 85: runs: 100 stores of obj 10KB -- avg time per req 2.87 ms (total: 287 ms)
thread 85: runs: 100 gets of obj 10KB -- avg time per req 2.8 ms (total: 280 ms)

thread 86: runs: 100 deletes of obj 10KB -- avg time per req 5.74 ms (total: 574 ms)
thread 86: runs: 100 stores of obj 10KB -- avg time per req 2.92 ms (total: 292 ms)
thread 86: runs: 100 gets of obj 10KB -- avg time per req 1.88 ms (total: 188 ms)

thread 87: runs: 100 deletes of obj 10KB -- avg time per req 5.61 ms (total: 561 ms)
thread 87: runs: 100 stores of obj 10KB -- avg time per req 3.11 ms (total: 311 ms)
thread 87: runs: 100 gets of obj 10KB -- avg time per req 1.84 ms (total: 184 ms)

thread 88: runs: 100 deletes of obj 10KB -- avg time per req 5.52 ms (total: 552 ms)
thread 88: runs: 100 stores of obj 10KB -- avg time per req 3.6 ms (total: 360 ms)
thread 88: runs: 100 gets of obj 10KB -- avg time per req 1.46 ms (total: 146 ms)

thread 89: runs: 100 deletes of obj 10KB -- avg time per req 6.68 ms (total: 668 ms)
thread 89: runs: 100 stores of obj 10KB -- avg time per req 3.01 ms (total: 301 ms)
thread 89: runs: 100 gets of obj 10KB -- avg time per req 0.95 ms (total: 95 ms)

thread 90: runs: 100 deletes of obj 10KB -- avg time per req 6.35 ms (total: 635 ms)
thread 90: runs: 100 stores of obj 10KB -- avg time per req 2.69 ms (total: 269 ms)
thread 90: runs: 100 gets of obj 10KB -- avg time per req 1.48 ms (total: 148 ms)

thread 91: runs: 100 deletes of obj 10KB -- avg time per req 5.97 ms (total: 597 ms)
thread 91: runs: 100 stores of obj 10KB -- avg time per req 2.69 ms (total: 269 ms)
thread 91: runs: 100 gets of obj 10KB -- avg time per req 1.69 ms (total: 169 ms)

thread 92: runs: 100 deletes of obj 10KB -- avg time per req 5.7 ms (total: 570 ms)
thread 92: runs: 100 stores of obj 10KB -- avg time per req 3.31 ms (total: 331 ms)
thread 92: runs: 100 gets of obj 10KB -- avg time per req 1.58 ms (total: 158 ms)

thread 93: runs: 100 deletes of obj 10KB -- avg time per req 4.51 ms (total: 451 ms)
thread 93: runs: 100 stores of obj 10KB -- avg time per req 3.5 ms (total: 350 ms)
thread 93: runs: 100 gets of obj 10KB -- avg time per req 2.21 ms (total: 221 ms)

thread 94: runs: 100 deletes of obj 10KB -- avg time per req 3.65 ms (total: 365 ms)
thread 94: runs: 100 stores of obj 10KB -- avg time per req 3.15 ms (total: 315 ms)
thread 94: runs: 100 gets of obj 10KB -- avg time per req 2.58 ms (total: 258 ms)

thread 95: runs: 100 deletes of obj 10KB -- avg time per req 5.19 ms (total: 519 ms)
thread 95: runs: 100 stores of obj 10KB -- avg time per req 3.28 ms (total: 328 ms)
thread 95: runs: 100 gets of obj 10KB -- avg time per req 2.14 ms (total: 214 ms)

thread 96: runs: 100 deletes of obj 10KB -- avg time per req 5.55 ms (total: 555 ms)
thread 96: runs: 100 stores of obj 10KB -- avg time per req 3.03 ms (total: 303 ms)
thread 96: runs: 100 gets of obj 10KB -- avg time per req 1.84 ms (total: 184 ms)

thread 97: runs: 100 deletes of obj 10KB -- avg time per req 5.36 ms (total: 536 ms)
thread 97: runs: 100 stores of obj 10KB -- avg time per req 3.35 ms (total: 335 ms)
thread 97: runs: 100 gets of obj 10KB -- avg time per req 1.16 ms (total: 116 ms)

thread 98: runs: 100 deletes of obj 10KB -- avg time per req 4.52 ms (total: 452 ms)
thread 98: runs: 100 stores of obj 10KB -- avg time per req 3.01 ms (total: 301 ms)
thread 98: runs: 100 gets of obj 10KB -- avg time per req 2.1 ms (total: 210 ms)

thread 99: runs: 100 deletes of obj 10KB -- avg time per req 4.71 ms (total: 471 ms)
thread 99: runs: 100 stores of obj 10KB -- avg time per req 2.65 ms (total: 265 ms)
thread 99: runs: 100 gets of obj 10KB -- avg time per req 2.04 ms (total: 204 ms)

thread 0:runs: 100write in database, --avg time per req 38.96 ms (total: 3896ms)
thread 0:runs:100read one by one in database, --avg time per req 23.34ms(total:2334ms)
thread 0:runs:100read list in database, --avg time per req 0.04ms(total:4ms)

thread 1:runs:100read one by one in database, --avg time per req 18.89ms(total:1889ms)
thread 1:runs:100read list in database, --avg time per req 0.85ms(total:85ms)

thread 2:runs:100read one by one in database, --avg time per req 16.68ms(total:1668ms)
thread 2:runs:100read list in database, --avg time per req 0.07ms(total:7ms)

thread 3:runs:100read one by one in database, --avg time per req 23.41ms(total:2341ms)
thread 3:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 4:runs:100read one by one in database, --avg time per req 17.46ms(total:1746ms)
thread 4:runs:100read list in database, --avg time per req 0.13ms(total:13ms)

thread 5:runs:100read one by one in database, --avg time per req 24.04ms(total:2404ms)
thread 5:runs:100read list in database, --avg time per req 0.01ms(total:1ms)

thread 6:runs:100read one by one in database, --avg time per req 23.41ms(total:2341ms)
thread 6:runs:100read list in database, --avg time per req 0.09ms(total:9ms)

thread 7:runs:100read one by one in database, --avg time per req 21.28ms(total:2128ms)
thread 7:runs:100read list in database, --avg time per req 0.11ms(total:11ms)

thread 8:runs:100read one by one in database, --avg time per req 21.55ms(total:2155ms)
thread 8:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 9:runs:100read one by one in database, --avg time per req 21.64ms(total:2164ms)
thread 9:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 10:runs:100read one by one in database, --avg time per req 15.62ms(total:1562ms)
thread 10:runs:100read list in database, --avg time per req 1.75ms(total:175ms)

thread 11:runs:100read one by one in database, --avg time per req 20.36ms(total:2036ms)
thread 11:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 12:runs:100read one by one in database, --avg time per req 19.84ms(total:1984ms)
thread 12:runs:100read list in database, --avg time per req 0.08ms(total:8ms)

thread 13:runs:100read one by one in database, --avg time per req 20.67ms(total:2067ms)
thread 13:runs:100read list in database, --avg time per req 0.07ms(total:7ms)

thread 14:runs:100read one by one in database, --avg time per req 21.98ms(total:2198ms)
thread 14:runs:100read list in database, --avg time per req 0.31ms(total:31ms)

thread 15:runs:100read one by one in database, --avg time per req 24.13ms(total:2413ms)
thread 15:runs:100read list in database, --avg time per req 0.0ms(total:0ms)

thread 16:runs:100read one by one in database, --avg time per req 19.68ms(total:1968ms)
thread 16:runs:100read list in database, --avg time per req 0.74ms(total:74ms)

thread 17:runs:100read one by one in database, --avg time per req 19.67ms(total:1967ms)
thread 17:runs:100read list in database, --avg time per req 0.46ms(total:46ms)

thread 18:runs:100read one by one in database, --avg time per req 17.15ms(total:1715ms)
thread 18:runs:100read list in database, --avg time per req 1.11ms(total:111ms)

thread 19:runs:100read one by one in database, --avg time per req 21.25ms(total:2125ms)
thread 19:runs:100read list in database, --avg time per req 0.33ms(total:33ms)

thread 20:runs:100read one by one in database, --avg time per req 22.58ms(total:2258ms)
thread 20:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 21:runs:100read one by one in database, --avg time per req 24.1ms(total:2410ms)
thread 21:runs:100read list in database, --avg time per req 0.01ms(total:1ms)

thread 22:runs:100read one by one in database, --avg time per req 21.6ms(total:2160ms)
thread 22:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 23:runs:100read one by one in database, --avg time per req 17.55ms(total:1755ms)
thread 23:runs:100read list in database, --avg time per req 0.07ms(total:7ms)

thread 24:runs:100read one by one in database, --avg time per req 20.24ms(total:2024ms)
thread 24:runs:100read list in database, --avg time per req 0.07ms(total:7ms)

thread 25:runs:100read one by one in database, --avg time per req 20.53ms(total:2053ms)
thread 25:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 26:runs:100read one by one in database, --avg time per req 23.93ms(total:2393ms)
thread 26:runs:100read list in database, --avg time per req 0.14ms(total:14ms)

thread 27:runs:100read one by one in database, --avg time per req 24.1ms(total:2410ms)
thread 27:runs:100read list in database, --avg time per req 0.01ms(total:1ms)

thread 28:runs:100read one by one in database, --avg time per req 12.79ms(total:1279ms)
thread 28:runs:100read list in database, --avg time per req 6.64ms(total:664ms)

thread 29:runs:100read one by one in database, --avg time per req 23.62ms(total:2362ms)
thread 29:runs:100read list in database, --avg time per req 0.04ms(total:4ms)

thread 30:runs:100read one by one in database, --avg time per req 19.88ms(total:1988ms)
thread 30:runs:100read list in database, --avg time per req 1.56ms(total:156ms)

thread 31:runs:100read one by one in database, --avg time per req 20.48ms(total:2048ms)
thread 31:runs:100read list in database, --avg time per req 0.28ms(total:28ms)

thread 32:runs:100read one by one in database, --avg time per req 21.78ms(total:2178ms)
thread 32:runs:100read list in database, --avg time per req 0.07ms(total:7ms)

thread 33:runs:100read one by one in database, --avg time per req 17.85ms(total:1785ms)
thread 33:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 34:runs:100read one by one in database, --avg time per req 23.43ms(total:2343ms)
thread 34:runs:100read list in database, --avg time per req 0.04ms(total:4ms)

thread 35:runs:100read one by one in database, --avg time per req 22.4ms(total:2240ms)
thread 35:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 36:runs:100read one by one in database, --avg time per req 23.19ms(total:2319ms)
thread 36:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 37:runs:100read one by one in database, --avg time per req 23.69ms(total:2369ms)
thread 37:runs:100read list in database, --avg time per req 0.03ms(total:3ms)

thread 38:runs:100read one by one in database, --avg time per req 22.21ms(total:2221ms)
thread 38:runs:100read list in database, --avg time per req 0.31ms(total:31ms)

thread 39:runs:100read one by one in database, --avg time per req 16.55ms(total:1655ms)
thread 39:runs:100read list in database, --avg time per req 0.1ms(total:10ms)

thread 40:runs:100read one by one in database, --avg time per req 21.33ms(total:2133ms)
thread 40:runs:100read list in database, --avg time per req 0.36ms(total:36ms)

thread 41:runs:100read one by one in database, --avg time per req 19.48ms(total:1948ms)
thread 41:runs:100read list in database, --avg time per req 0.04ms(total:4ms)

thread 42:runs:100read one by one in database, --avg time per req 16.63ms(total:1663ms)
thread 42:runs:100read list in database, --avg time per req 0.09ms(total:9ms)

thread 43:runs:100read one by one in database, --avg time per req 22.06ms(total:2206ms)
thread 43:runs:100read list in database, --avg time per req 0.17ms(total:17ms)

thread 44:runs:100read one by one in database, --avg time per req 19.94ms(total:1994ms)
thread 44:runs:100read list in database, --avg time per req 1.61ms(total:161ms)

thread 45:runs:100read one by one in database, --avg time per req 23.9ms(total:2390ms)
thread 45:runs:100read list in database, --avg time per req 0.12ms(total:12ms)

thread 46:runs:100read one by one in database, --avg time per req 23.96ms(total:2396ms)
thread 46:runs:100read list in database, --avg time per req 0.01ms(total:1ms)

thread 47:runs:100read one by one in database, --avg time per req 23.6ms(total:2360ms)
thread 47:runs:100read list in database, --avg time per req 0.03ms(total:3ms)

thread 48:runs:100read one by one in database, --avg time per req 23.48ms(total:2348ms)
thread 48:runs:100read list in database, --avg time per req 0.07ms(total:7ms)

thread 49:runs:100read one by one in database, --avg time per req 23.03ms(total:2303ms)
thread 49:runs:100read list in database, --avg time per req 0.26ms(total:26ms)

thread 50:runs:100read one by one in database, --avg time per req 20.86ms(total:2086ms)
thread 50:runs:100read list in database, --avg time per req 0.14ms(total:14ms)

thread 51:runs:100read one by one in database, --avg time per req 19.76ms(total:1976ms)
thread 51:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 52:runs:100read one by one in database, --avg time per req 22.56ms(total:2256ms)
thread 52:runs:100read list in database, --avg time per req 0.09ms(total:9ms)

thread 53:runs:100read one by one in database, --avg time per req 15.47ms(total:1547ms)
thread 53:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 54:runs:100read one by one in database, --avg time per req 23.0ms(total:2300ms)
thread 54:runs:100read list in database, --avg time per req 0.13ms(total:13ms)

thread 55:runs:100read one by one in database, --avg time per req 23.35ms(total:2335ms)
thread 55:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 56:runs:100read one by one in database, --avg time per req 23.29ms(total:2329ms)
thread 56:runs:100read list in database, --avg time per req 0.13ms(total:13ms)

thread 57:runs:100read one by one in database, --avg time per req 19.88ms(total:1988ms)
thread 57:runs:100read list in database, --avg time per req 0.48ms(total:48ms)

thread 58:runs:100read one by one in database, --avg time per req 18.75ms(total:1875ms)
thread 58:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 59:runs:100read one by one in database, --avg time per req 23.91ms(total:2391ms)
thread 59:runs:100read list in database, --avg time per req 0.01ms(total:1ms)

thread 60:runs:100read one by one in database, --avg time per req 15.15ms(total:1515ms)
thread 60:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 61:runs:100read one by one in database, --avg time per req 23.39ms(total:2339ms)
thread 61:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 62:runs:100read one by one in database, --avg time per req 19.3ms(total:1930ms)
thread 62:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 63:runs:100read one by one in database, --avg time per req 23.7ms(total:2370ms)
thread 63:runs:100read list in database, --avg time per req 0.09ms(total:9ms)

thread 64:runs:100read one by one in database, --avg time per req 18.97ms(total:1897ms)
thread 64:runs:100read list in database, --avg time per req 0.93ms(total:93ms)

thread 65:runs:100read one by one in database, --avg time per req 23.57ms(total:2357ms)
thread 65:runs:100read list in database, --avg time per req 0.1ms(total:10ms)

thread 66:runs:100read one by one in database, --avg time per req 23.57ms(total:2357ms)
thread 66:runs:100read list in database, --avg time per req 0.03ms(total:3ms)

thread 67:runs:100read one by one in database, --avg time per req 18.78ms(total:1878ms)
thread 67:runs:100read list in database, --avg time per req 0.07ms(total:7ms)

thread 68:runs:100read one by one in database, --avg time per req 20.84ms(total:2084ms)
thread 68:runs:100read list in database, --avg time per req 1.35ms(total:135ms)

thread 69:runs:100read one by one in database, --avg time per req 23.21ms(total:2321ms)
thread 69:runs:100read list in database, --avg time per req 0.16ms(total:16ms)

thread 70:runs:100read one by one in database, --avg time per req 20.27ms(total:2027ms)
thread 70:runs:100read list in database, --avg time per req 0.25ms(total:25ms)

thread 71:runs:100read one by one in database, --avg time per req 24.17ms(total:2417ms)
thread 71:runs:100read list in database, --avg time per req 0.01ms(total:1ms)

thread 72:runs:100read one by one in database, --avg time per req 15.39ms(total:1539ms)
thread 72:runs:100read list in database, --avg time per req 0.21ms(total:21ms)

thread 73:runs:100read one by one in database, --avg time per req 13.67ms(total:1367ms)
thread 73:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 74:runs:100read one by one in database, --avg time per req 22.08ms(total:2208ms)
thread 74:runs:100read list in database, --avg time per req 0.09ms(total:9ms)

thread 75:runs:100read one by one in database, --avg time per req 17.4ms(total:1740ms)
thread 75:runs:100read list in database, --avg time per req 0.91ms(total:91ms)

thread 76:runs:100read one by one in database, --avg time per req 15.5ms(total:1550ms)
thread 76:runs:100read list in database, --avg time per req 0.87ms(total:87ms)

thread 77:runs:100read one by one in database, --avg time per req 16.79ms(total:1679ms)
thread 77:runs:100read list in database, --avg time per req 1.81ms(total:181ms)

thread 78:runs:100read one by one in database, --avg time per req 24.07ms(total:2407ms)
thread 78:runs:100read list in database, --avg time per req 0.02ms(total:2ms)

thread 79:runs:100read one by one in database, --avg time per req 22.74ms(total:2274ms)
thread 79:runs:100read list in database, --avg time per req 0.15ms(total:15ms)

thread 80:runs:100read one by one in database, --avg time per req 22.04ms(total:2204ms)
thread 80:runs:100read list in database, --avg time per req 0.16ms(total:16ms)

thread 81:runs:100read one by one in database, --avg time per req 21.29ms(total:2129ms)
thread 81:runs:100read list in database, --avg time per req 0.29ms(total:29ms)

thread 82:runs:100read one by one in database, --avg time per req 18.44ms(total:1844ms)
thread 82:runs:100read list in database, --avg time per req 1.37ms(total:137ms)

thread 83:runs:100read one by one in database, --avg time per req 21.19ms(total:2119ms)
thread 83:runs:100read list in database, --avg time per req 1.19ms(total:119ms)

thread 84:runs:100read one by one in database, --avg time per req 19.84ms(total:1984ms)
thread 84:runs:100read list in database, --avg time per req 2.25ms(total:225ms)

thread 85:runs:100read one by one in database, --avg time per req 21.33ms(total:2133ms)
thread 85:runs:100read list in database, --avg time per req 0.17ms(total:17ms)

thread 86:runs:100read one by one in database, --avg time per req 23.41ms(total:2341ms)
thread 86:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 87:runs:100read one by one in database, --avg time per req 15.06ms(total:1506ms)
thread 87:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 88:runs:100read one by one in database, --avg time per req 21.8ms(total:2180ms)
thread 88:runs:100read list in database, --avg time per req 0.08ms(total:8ms)

thread 89:runs:100read one by one in database, --avg time per req 15.83ms(total:1583ms)
thread 89:runs:100read list in database, --avg time per req 3.44ms(total:344ms)

thread 90:runs:100read one by one in database, --avg time per req 23.61ms(total:2361ms)
thread 90:runs:100read list in database, --avg time per req 0.03ms(total:3ms)

thread 91:runs:100read one by one in database, --avg time per req 24.04ms(total:2404ms)
thread 91:runs:100read list in database, --avg time per req 0.01ms(total:1ms)

thread 92:runs:100read one by one in database, --avg time per req 20.73ms(total:2073ms)
thread 92:runs:100read list in database, --avg time per req 0.07ms(total:7ms)

thread 93:runs:100read one by one in database, --avg time per req 10.77ms(total:1077ms)
thread 93:runs:100read list in database, --avg time per req 0.2ms(total:20ms)

thread 94:runs:100read one by one in database, --avg time per req 18.71ms(total:1871ms)
thread 94:runs:100read list in database, --avg time per req 0.06ms(total:6ms)

thread 95:runs:100read one by one in database, --avg time per req 21.46ms(total:2146ms)
thread 95:runs:100read list in database, --avg time per req 0.74ms(total:74ms)

thread 96:runs:100read one by one in database, --avg time per req 23.85ms(total:2385ms)
thread 96:runs:100read list in database, --avg time per req 0.01ms(total:1ms)

thread 97:runs:100read one by one in database, --avg time per req 22.73ms(total:2273ms)
thread 97:runs:100read list in database, --avg time per req 0.25ms(total:25ms)

thread 98:runs:100read one by one in database, --avg time per req 21.11ms(total:2111ms)
thread 98:runs:100read list in database, --avg time per req 0.05ms(total:5ms)

thread 99:runs:100read one by one in database, --avg time per req 23.2ms(total:2320ms)
thread 99:runs:100read list in database, --avg time per req 0.05ms(total:5ms)
分享到:
评论

相关推荐

    PHP+MySQL来实现在线测试quiz功能.zip_mysql在线测试_online-quiz_php_rgy_在线测试

    2. **MySQL数据库**:MySQL是一个开源的关系型数据库管理系统,用于存储和管理在线测试系统的数据,如试题、选项、用户信息和测试结果。通过SQL(Structured Query Language)语句,我们可以创建、查询、更新和删除...

    High Performance MySQL_ Optimization.pdf

    书中可能讲解如何配置和优化内存使用,以及如何利用缓存机制(如memcached、Redis)来提高数据访问速度。 6. **复制与备份**:书中的"Replication, and More"部分,会涉及MySQL的主从复制技术,这是高可用性和灾难...

    nosql 入门教程

    3.1.8 Apache Cassandra数据存储与访问 54 3.1.9 Apache Cassandra数据查询 55 3.2 NoSQL数据存储的语言绑定 56 3.2.1 Thrift 56 3.2.2 Java 56 3.2.3 Python 58 3.2.4 Ruby 59 3.2.5 PHP 59 3.3 小结 60 ...

    集群好书《高性能Linux服务器构建实战》 试读章节下载

    3.4.3 对memcached_functions_mysql的简单功能进行测试 3.4.4 使用memcached_functions_mysql的经验与技巧 3.5 本章小结 第2篇 数据备份恢复篇 第4章 开源网络备份软件bacula 4.1 bacula总体概述 4.1.1...

    如何选择NoSQL数据库.rar

    在IT行业中,数据库是数据管理和存储的核心组成部分。随着大数据、云计算和...在具体选择过程中,可以先根据项目需求列出优先级,然后对比不同类型的NoSQL数据库,进行测试和评估,以确定最适合的数据库解决方案。

    基于Java的在线测试系统的设计与实现.zip

    3. 数据库:使用MySQL或PostgreSQL存储用户信息、试题、考试记录等数据。 4. 服务器:可能部署在Tomcat或Jetty等应用服务器上,支持高并发请求。 三、核心功能模块 1. 用户管理:包括用户注册、登录、权限管理等...

    Redis面试知识点.pdf

    - **定期分析**:通过对MySQL数据的查询统计分析,识别出热点数据。 - **动态调整**:根据查询频率动态调整Redis中数据的更新。 - **智能缓存策略**:使用机器学习算法预测热点数据。 #### 36、Redis最适合的场景?...

    MongoDB开发应用实践

    随着业务的发展和技术的需求变化,原有的MySQL架构面临着一系列挑战,这促使视觉中国探索更加灵活且高效的数据存储方案。 ##### 原有的MySQL架构: - **架构模式**:采用Master-Master-Slaves模式。 - **高可用性*...

    互联网数据库优化之路.pptx

    通过与MySQL Group Replication的对比测试,X-Cluster在Insert场景下表现出色,QPS(每秒查询率)是MySQL GR的2.4倍,且响应时间更短,证明了其在性能上的优势。 其次,针对性能问题,阿里云开发了AliSQL - X-KV。X...

    面向Java程序设计的在线考试与练习系统.zip

    这些题目需要存储在数据库中,可以使用Java集合框架(如List、Set等)和自定义数据结构进行管理。 - 随机组卷:系统应能随机从题库中抽取题目生成试卷,涉及算法设计,如洗牌算法。 - 时间限制:Java的定时器...

    Redis面试专题30道.zip

    12、MySQL 里有 2000w 数据,redis 中只存 20w 的数据,如何保证 redis 13、Redis 有哪些适合的场景? 14、Redis 支持的 Java 客户端都有哪些?官方推荐用哪个? 15、Redis 和 Redisson 有什么关系? 16、Jedis 与 ...

    基金会系统网站.zip

    1. MySQL或PostgreSQL:常用的数据库系统,用于存储基金会的信息、捐赠记录、用户数据等。 2. ORM(对象关系映射):如Hibernate(Java)或SQLAlchemy(Python),简化数据库操作,减少代码耦合。 四、安全性 1. ...

    JAVA-项目面试题 (2).docx

    Redis因其数据存储在内存中,读写速度远超基于磁盘存储的Oracle和MySQL。适合存储热点数据,提供高速访问。但请注意,内存资源有限,需合理规划数据存储。 6. **读写分离实现** 读写分离通过将更新操作指向主...

    毕业设计:基于SpringBoot+微信小程序+人脸识别实现的无证件化考试系统.zip

    9. **测试与部署**:系统开发完成后,需要进行单元测试、集成测试和压力测试,确保功能完整且性能良好。部署时,可以选择Docker容器化技术,配合Kubernetes或Docker Compose进行服务的管理和扩展。 10. **持续集成/...

    node即学即用 (英文版) Node: Up and Running, Scalable Server-Side Code with JavaScript

    此外,还会讲解如何使用文件系统、Redis、Memcached等数据存储工具。读者将学会如何选择合适的数据库和存储方案,以及如何实现高效的数据读写和管理。 ### 结语 整体来看,《node即学即用》不仅为读者提供了一个...

    lnmp胜与LAMP十倍的web服务器架构

    在LNMP架构中,MySQL主要负责数据的存储和管理。 - **安装与优化**: - 直接通过yum命令安装MySQL Server即可。 - 配置优化:根据服务器硬件条件适当调整MySQL配置参数,如innodb_buffer_pool_size等,以达到最佳...

Global site tag (gtag.js) - Google Analytics