There isn't a single solution for that. What you should do is to start experimenting and see how your application behaves under normal usage. Define a size for the queue, start working on it, measuring latency, contention and errors. Eventually you will find a good number to your app.
One thing I've heard once from a Netflix guy is that queues will always be clogged and they won't move anywhere. So you must also decide when it's time to give up trying and and just fail.