Mostly spiking backend connections has little to do with your varnish configuration but alot to do with the cachability of your site.
- Are there cookies that prevents you from caching efficiently? You can chose to strip them or remove all but chosen ones, there are examples for both on the varnish site.
- Do a varnishstat and check your hit rates during peaks. Is it a good cache hitratio? Is it the same as during low load? If it's the same or higher in low load it's easy to work on improving it at any time.
- Do a
varnishtop -i txurl
to see what requests are the most frequently sent to backend servers. Maybe it's some URLs that are just not cached due to faulty headers? Maybe some pages can be cached longer? Maybe some parts of the pages can be cached with ESI? - Make sure your varnish is not crashing during peaks (leaving it with empty cache). You can see crash info by a
cat syslog | grep "varnish"