There are plenty of websites out there that will give you enough pre written gags to easily fill out a five minute speech. A lot of the material on these sites is pretty good and if delivered well it will definitely get you a slap on the back and a pint bought for you at the bar. Personally I would always prefer to see a best man speak from the heart and tell stories about his friend rather than worry about hitting a particular gag count. I have seen one or two speeches that have been so gag heavy that they have veered away from anything to do with the happy couple and have turned into an open mic comedy set. The only problem with this is when the jokes start to fall flat and the mood changes, turning the best man into Robert De Niros character from the film 'King Of Comedy', a deranged stand up comedian who holds a tv executive at gun point to get his big break in TV.
When used sparingly, a good best man gag is an excellent way to get the crowd onside early, win them back if one of your anecdotes hasn't quite worked it's magic, and lift people back up again if you have been talking about anything overly sad or emotional. Typical jokes that are often weaved into a best man speech include, "it's been an emotional day, even the cake is in tiers" and a lot of variations on the groom having to realise that his wife is always right. I have seen these delivered to great effect and though I wouldn't use them myself I can see why they are very popular. When it comes to writing gags for my clients I like to try and bring in techniques that I used whilst writing and performing stand up and sketch comedy. The rule of three is a particularly effective writing principle that is based on the fact that people often find a list of three things funnier than two. In a wedding speech it might be used like this:
"There are many reasons that Sarah is the perfect match for Chris, they share the same taste in clothes, they are both obsessed with Game of Thrones and she's the only woman who hasn't run from his bedroom in tears after finding out how hairy his back is!"
A call back is another technique that is used effectively in a best man speech. This involves bringing back a thread of a joke that appeared earlier in the speech at a later point. This works well as it normally generates a laugh and also shows how in control of the speech you are as well as giving the impression that you are improvising.
To all those about to gag I salute you, just make sure you do a bit of research on your audience yeah? Oh, and never, ever hold an audience at gun point!