I leave 20% if the service was acceptable.
I leave less depending on just how unacceptable the service actually was.

If the food is bad, or screwed up, ask the server (or his/her manager) to comp the food. That way, you can still tip the server for his/her service, but the restaurant still eats it for giving you crappy service overall.