Coder Social home page Coder Social logo

My benchmark results about rust-blog HOT 5 CLOSED

pretzelhammer avatar pretzelhammer commented on May 22, 2024
My benchmark results

from rust-blog.

Comments (5)

pretzelhammer avatar pretzelhammer commented on May 22, 2024 2

I've updated the article to use a DigitalOcean linux VPS as my benchmark test environment since that's much more realistic environment than a macbook pro. The benchmarks should be more accurate to real-world use-cases, and switching to a linux environment did significantly improve the performance of the DR server. Thanks for your help guys! I'm gonna close this issue.

from rust-blog.

pretzelhammer avatar pretzelhammer commented on May 22, 2024

Wow, those throughputs are amazing! Your test machines seem to have specs similar to mine, I'm also confused why the numbers you are getting are so much better. Did you make any code changes to the SA or DR code in any way?

1 - Why is it completely different from what we have here in the blog post?

The only noticeable difference between your setup and mine seems to be that you are running the benchmarks on a Linux machine (with PostgresQL in a docker container running Linux) and I'm running them on macOS (with PostgresQL in docker container running Linux). Docker has to do more work to simulate a Linux environment on a macOS machine than a Linux machine, of course... so it's possible I'm losing out on some performance that's getting lost in the virtualization layer... but even then, the difference in performance is so massive it's hard to believe...

That's my best guess, but even I'm not even happy with that guess. Hopefully someone else can chime in? It would be interesting to see more people run the benchmarks on their machines and share what results they get, maybe we can find some pattern in all this chaos.

2 - Why DR is so much different on these two machines?! (I ran them several times, it's almost the same)

No clue.

from rust-blog.

omid avatar omid commented on May 22, 2024

This difference is the root of my confusion too! I did some changes and saw the difference and thought it's because of my changes, but nope! It's exactly what you have in the main branch.

The only noticeable difference between your setup and mine seems to be that you are running the benchmarks on a Linux machine...

Yep, but it should be the same, for all envs. So the same performance boost :/

from rust-blog.

weiznich avatar weiznich commented on May 22, 2024

I believe I can explain at least some of that differences.

1- Why is it completely different from what we have here in the blog post?

This is likely caused by macOS having being slow at using many threads compared to linux. See here for details.

2 - Why DR is so much different on these two machines?! (I ran them several times, it's almost the same)

Did you use the default configuration provided by rocket, or the configuration provided by @pretzelhammer example? The likely cause here is that rocket is quite sensitive to the number of workers. Increasing this number should increase performance (at least till some point). Now it seems that your second test machine has more logical cores available + the optimal number of worker threads is depended on the core count. This suggests that you need to increase that number of worker threads even further to get comparable performance. I would try something like doubling the number to 512.

from rust-blog.

omid avatar omid commented on May 22, 2024

Thanks @weiznich the first answer looks logical 🙏🏼

About the second one, I tried with 512, saw a worse result, like 180K.
Set it to 32 (logical CPU * 2, based on their documentations) saw a similar result as 218K.

from rust-blog.

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.