Comments (5)
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.
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.
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.
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.
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)
- Is it worth to mention about "Polonious"? HOT 1
- Remove static mut example HOT 8
- subjective issue, idk what title to give HOT 3
- Confuse: lifetime with struct and self. HOT 2
- A potential tweak to common-rust-lifetime-misconceptions HOT 1
- Sized is not an auto trait HOT 1
- PartialEq example isn't right HOT 2
- Paragraph about `T: 'static` is not right HOT 8
- Mention that Read & Write aren't in the prelude when talking about Generic blanket impls HOT 4
- (nit) Update description of example provided to explain the Clone trait. HOT 1
- Not PostgreSQL but PostgresQL on purpose? HOT 1
- Request for additional example in closure/function lifetime elision distinction HOT 2
- `asymmetry` requirements in `PartialOrd`
- Customer review for Rust on the eve of 2022
- Misconception discussion: T is a superset of both &T and &mut T
- Struct methods can also NOT have elided lifetimes right?
- Request to add extra info: cannot implement both From and TryFrom
- More iteration trait wisdom
- tnanks the series high quality Rust article
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-blog.