Lots of neat updates lately. Thanks for your work, cg!
Comment has been collapsed.
But now you can't spam refresh hoping for that last point you need to enter a giveaway ending in 3 minutes.
Comment has been collapsed.
2 Comments - Last post 9 minutes ago by coleypollockfilet
290 Comments - Last post 43 minutes ago by Formidolosus
13 Comments - Last post 2 hours ago by Stakaniy
492 Comments - Last post 2 hours ago by LinustheBold
2,649 Comments - Last post 4 hours ago by MeguminShiro
133 Comments - Last post 5 hours ago by Ewoda
1,166 Comments - Last post 5 hours ago by Carenard
15 Comments - Last post 5 minutes ago by Mayanaise
10,358 Comments - Last post 20 minutes ago by Mileworg
18 Comments - Last post 37 minutes ago by adam1224
3,948 Comments - Last post 48 minutes ago by ShroudOfLethe
657 Comments - Last post 58 minutes ago by cHendler
111 Comments - Last post 1 hour ago by SirMustachio
1,044 Comments - Last post 1 hour ago by Shanti
The Issue
When you create a giveaway there's a delay for 5-10 seconds. Also, when entering giveaways, the site occasionally hangs on the please wait state, or takes a few seconds to go through.
Why Is This Happening?
After a giveaway is created, the site needs to distribute 5% of the value in points to all users. This takes a few seconds, since we have nearly a million users. Since it happens during the giveaway creation process, users wait this few seconds when creating their giveaway.
As for the enter giveaway button, it sometimes freezes due to deadlocks in the database, when it's trying to perform the needed queries to enter the giveaway. Also, if a user creates a giveaway, and you try to enter a giveaway at the same time, there's a delay. The site is trying to distribute points for all users, and you need points removed from your account for entering the giveaway. This creates a delay for a few seconds until points are distributed and your giveaway entry can go through. During peak hours, we might have 5-10 giveaways created every minute. There's a decent chance you click the button to enter a giveaway within a few seconds of someone creating a giveaway, and end up waiting.
Solution
Points are now distributed in 15 minute intervals. Every 15 minutes, the site will look at the recently created giveaways, and distribute 5% of their total value to everyone. This means creating giveaways is faster and you no longer have that delay. Also, you're almost 100x less likely to run into a few second delay when entering a giveaway. Lastly, the code was improved for transactions surrounding giveaway entries, so there should no longer be deadlocks and endless please wait messages. These changes rolled out a couple of hours ago, and since then you should have seen the button for entering giveaways performing better.
Comment has been collapsed.