I just got throttling implemented at the db level - that was the hard part. I'll do the file part soon. Then I'll merge and check in.
The database throttle will basically reduce the overhead to one SELECT statement (and no DML statements), but we still have to create the database connection, which I think is heavier than the sum of all the statements -- btw, should we use a connection pool when the thing is daemonized?
I have the send throttle set to 50/hour and the receive throttle set to 100/hour.
Does that sound reasonable? I'd like to set the thresholds so high that we don't need to mention it to Joe Average User (simply put it in the FAQ), but not so high that they don't provide much benefit.
If there's a steady stream of messages pointed at the server, say 3 per second for a particular user, I guess this would work: at the top of the hour, we'd see about 33.3 seconds of hard work, followed by almost an hour of quiet, then another 33.3 seconds of hard work, etc.
Any comments on this? Using the receive throttle may mean that you could trash an account by overusing it -- that is, you've done nothing out of the ordinary, but the account is getting hit so hard (with messages that would be eaten) that you can't get a good message through. 100/hour is a lot, though... (now, about 45 minutes into the game, several accounts are in the 50-60 range)