Hacker News new | past | comments | ask | show | jobs | submit login

To fix overload swap queues for stacks, set a timeout, and clear the stack when you estimate based on throughput the the time will expire.

eg. On a webserver where people get refresh happy, I'd set the timeout at about 5 seconds. If requests are taking on average 2 seconds and the request is already 3 seconds old, return a 500, drop the connection, etc. Then clear the rest of the stack.

Answer requests in a LIFO manner as at least that way in an overload condition some requests are answered and the 'queue' is cleared quickly.

It's like when you have 3 papers due and only time to do 2, you elect to not do one so you can do the other two. You should ideally kill the one that is due first.

Sacrifice a few for the good of the many.




timeouts work well, if you can afford to drop the data on the floor. for scenarios where you can't, life sucks: make your pipes faster.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: