-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priority balancing doesn't work as expected #2209
Comments
I don't think that this implementation of RAND would actually achieve a specific amount of traffic going to a specific IP address, definitely not over a small sample size of 150 messages. Stack Overflow seems to suggest that guaranteeing percentages of messages going to certain IP addresses would require something a little more complicated https://stackoverflow.com/questions/61285226/selecting-rows-by-percentage-of-chance I'm definitely not a statistician so I don't know what I'm talking about at all but if you're not sending many thousands of messages then I'd say your priority numbers should be closer together (i.e. don't use 1, 50, 100, use 50, 100, 100) so that your newer IP address actually stands a chance of being used. |
There is a specific ratio we need to achieve on specific pool of IPs. Let's say we would like to allocate 10% on IP A, 25% on IP B, 40% on IP C and 25 % IP D. There is no such a way besides jumping into statistic and getting right ratios which is not In my opinion implementation of load balancing is not correct. |
As I said, I don't think you can achieve specific ratios but as those numbers are relatively close together, it might get pretty close in the current implementation. There would need to be a bit of a code change to achieve specific ratios and then there would probably have to be some kind of limit on the ratio values entered, don't want someone entering 10000 and crashing Postal whilst it tries to figure out all the possible permutations 😅 |
This documentation is wrong. Your description is correct. |
set of 1, 50, 100 is balancing tiny, 25% and 50% accordingly
In comment of priority it says
"This priority will determine the likelihood of this IP address being selected for use when sending a message. The higher the number the more likely the IP is to be chosen. By defalt, the priority is set to the maximum value of 100.
This can be used to warm up new IP addresses by adding them with a low priority.
To give an indication of how this works, if you have three IPs with 1, 50 and 100 as their priorities, and you send 100,000 emails, the priority 1 address will receive
a tiny percentage, the priority 50 will receive roughly 25% and the priority 100 will receive roughly 75%.
To Reproduce
Expected behaviour
1/151 goes to 1
50/151 goes to 50
100/151 goes to 100
It's expected more like 33/66% for 50/100 weights
How feature can be used as expected? Is that a bug or performance efficient feature?
How to calculate proper rate of distribution?
Thank you!
Link to code:
postal/app/models/ip_address.rb
Line 39 in 21a8d89
The text was updated successfully, but these errors were encountered: