优化杀分逻辑
This commit is contained in:
@@ -115,7 +115,7 @@ Goal: hot paths should hit Redis most of the time, and DB should primarily be fo
|
||||
- In `playStart`, ensure player is loaded once and reused (do not call `DicePlayer::find` multiple times per request).
|
||||
|
||||
3. EV update strategy:
|
||||
- Repeated `UPDATE dice_lottery_config SET ev = ev - ?` on a hot row causes lock contention.
|
||||
- Repeated `UPDATE dice_lottery_pool_config SET ev = ev - ?` on a hot row causes lock contention.
|
||||
- Better:
|
||||
- Accumulate EV deltas in Redis (per pool or per shard).
|
||||
- Periodic cron job to aggregate Redis deltas back into MySQL in batches.
|
||||
|
||||
Reference in New Issue
Block a user