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.

9 years ago*

Comment has been collapsed.

Deleted

This comment was deleted 5 years ago.

9 years ago
Permalink

Comment has been collapsed.

Awesome! The button is working as expected now. Thanks cg!

9 years ago
Permalink

Comment has been collapsed.

Thank you for your hard work, cg! Keep it up, we're counting on you <3

9 years ago
Permalink

Comment has been collapsed.

Thanks for all the good work, cg! :)

9 years ago
Permalink

Comment has been collapsed.

And I just wrote my own script, like two weeks ago, that reverts the "please wait" message to the "Enter" button, after receiving an empty response. ^^
Thank you, this bugged me since SGv2 started.

9 years ago
Permalink

Comment has been collapsed.

Cool news! You're the best, guys! :D

9 years ago
Permalink

Comment has been collapsed.

Sounds like a smart solution. Well done :)

9 years ago
Permalink

Comment has been collapsed.

Looks like we will be screwed in situations where one point is missing and giveaway is ending in about minute or two.

9 years ago
Permalink

Comment has been collapsed.

True, this may be the downside. But us people no longer frantically refreshing pages for some last minute points might take some additional load off the servers ;)

9 years ago
Permalink

Comment has been collapsed.

Oh yes, thanks!

9 years ago
Permalink

Comment has been collapsed.

Thx for all your hard work cg and of all of support, for that matter :)

9 years ago
Permalink

Comment has been collapsed.

Clever solution. Congratulations an thanks for the awesome work!

9 years ago
Permalink

Comment has been collapsed.

Thanks!
Does this also fix the lag and occasionally losing points when you remove entries?
And no more "waiting for that 1 more point to enter". :p

9 years ago*
Permalink

Comment has been collapsed.

Thanks for the changes :3

9 years ago
Permalink

Comment has been collapsed.

Amazing job! :D

9 years ago
Permalink

Comment has been collapsed.

nice thanks

9 years ago
Permalink

Comment has been collapsed.

So no more regular refreshing to see how many more points came :D. I'd suggest people create giveaways to end at 5 or 10 minutes past the hour instead of on the hour, then, though...

9 years ago
Permalink

Comment has been collapsed.

we are fast now o.O

9 years ago
Permalink

Comment has been collapsed.

All hail CG
on a serious note. nice catch of the problem ;)

9 years ago
Permalink

Comment has been collapsed.

Wow you're just pumping out all these awesome solutions. Thanks for the great site CG!
i'm feeling the difference after these improvements

9 years ago
Permalink

Comment has been collapsed.

kaizen

9 years ago
Permalink

Comment has been collapsed.

Thanks a lot for the changes. Now it's 1000 easier to enter a giveaway =D

9 years ago
Permalink

Comment has been collapsed.

\o/

9 years ago
Permalink

Comment has been collapsed.

thanks cg entering giveaways is now like a charm

9 years ago
Permalink

Comment has been collapsed.

Yep, much better today.

9 years ago
Permalink

Comment has been collapsed.

Now that you are updating data-base in bulk not in real-time, there sure is less load on whole system. If you really use 15 min interval that you decreased pressure for around 900 times, also 900 times less likely of dead-lock.
Please take this in consideration, I don't know what system and strategy you are using in background, but 15 min is kinda overkill. Personally it doesn't effect me that much, due the fact I'm 99% time locked at 300p, but I would suggest using dynamic system to trigger update. I.E. set minimal and maximal time interval without update, and number of created giveaways threshold; if threshold is reached before minimal interval keep accumulating; if its with-in allowed interval trigger, and if timer reaches maximum without threshold trigger. This should allow users to get more often points when there is flood of usual bundle games, but also keep bulk update of points system.

9 years ago
Permalink

Comment has been collapsed.

Sign in through Steam to add a comment.