Coder Social home page Coder Social logo

db_benchmark's Introduction

db_benchmark

测试redis和mongo等的速度

go get github.com/dalent/db_benchmark

用法 -d数据库 ,-u 数据库 url -t 线程数量

 go run benchmark.go -d mongo -u  mgo1:8888 -t 2

表示用两个线程,每个线程插入和读取1万次,的时间结果为

mode w
threads: 2
per thread: 10000
total time:3.879012986s

mode r
threads: 2
per thread: 10000
total time:3.338706411s

同样可以测试redis,因为redis的url不包括passwd信息所以职能控制台提供例如

go run benchmark.go --d redis -u  mgo2:6379 -t 2 -p passwd 

结果和上边的类似。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.