Hacker News new | past | comments | ask | show | jobs | submit login
Prime Numbers for the Win (2009) (dustinkirkland.com)
29 points by todsacerdoti on Aug 11, 2020 | hide | past | favorite | 4 comments



Solving a bug using a cicada heuristic. Clever!

For anyone unfamiliar, cicadas spawn in years of 17 or 19 to avoid overlap with predator cycles which tend to occur in years of 2 or 3.


Another way of spreading the load is to sleep(random(sensible_delay)) before executing a scheduled task.


With random numbers there's still a non-zero chance of everything happening at the same time. Prime numbers make things more predictable and consistent.


This problem would be better and more consistently solved by just offsetting some of the scripts in time. Who says the 10 second script needs to run on even seconds or even multiples of 5?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: