Coder Social home page Coder Social logo

Comments (10)

Darksonn avatar Darksonn commented on August 16, 2024

Probably because the hash map is protected by a single mutex instead of doing something more clever.

from mini-redis.

hiqsociety avatar hiqsociety commented on August 16, 2024

that's all? it's really very very slow.

from mini-redis.

Darksonn avatar Darksonn commented on August 16, 2024

Another difference is that mini-redis does not support pipelining.

from mini-redis.

carllerche avatar carllerche commented on August 16, 2024

It is doubtfully the mutex and probably pipelining. When running benchmarks, be sure to not pipeline.

from mini-redis.

MeirShpilraien avatar MeirShpilraien commented on August 16, 2024

What is the reason pipeline is so slow? I see that when I use pipeline on redis-benchamrk the CPU drop to almost zero usage.

from mini-redis.

carllerche avatar carllerche commented on August 16, 2024

Because pipelining in mini-redis is not implemented.

from mini-redis.

MeirShpilraien avatar MeirShpilraien commented on August 16, 2024

Thanks @carllerche but what is require to implement it? Why the fact that the client sends another command before getting the pre command reply causes such a CPU drop (and with it a performance drop)?

from mini-redis.

Darksonn avatar Darksonn commented on August 16, 2024

Pipelining requires that you can start processing the next message before responding to the first. Mini-redis will not implement it.

from mini-redis.

MeirShpilraien avatar MeirShpilraien commented on August 16, 2024

I agree it will be far from Redis performance but I do not understand why it is so bad. With pipeline of 2 I got like 40 ops/sec and CPU usage drop to around 1%. Why the processes stays idle for so long?

from mini-redis.

MeirShpilraien avatar MeirShpilraien commented on August 16, 2024

OK, I think I found the answer, if I set TCP_NODELAY flag the performance are not dropped so drastically and we can even gain better performance from pipeline.

Without TCP_NODELAY:

> redis-benchmark -c 1 -n 1000000 -P 2 get x
WARNING: Could not fetch server CONFIG
get x: rps=47.8 (overall: 45.8) avg_msec=0.449 (overall: 0.430)

With TCP_NODELAY:

> redis-benchmark -c 1 -n 1000000 -P 2 get x
WARNING: Could not fetch server CONFIG
get x: rps=60672.0 (overall: 59762.0) avg_msec=0.020 (overall: 0.021)

from mini-redis.

Related Issues (20)

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.