If there's a an accelerator that's capable of blocking a DDoS attack that would be Varnish. We covered how a constellation of Nginx proxies can help diffuse a DDoS attack. Varnish's design in terms of threading and efficient use of memory makes it an ideal tool to put up the best fight against a DDoS attack. We'll post here tips & tricks you can use with your cPanel Varnish Plugin. These are changes you'll want to make prior to an attack taking place. Remember, threads are cheap so start up as many as needed early on in anticipation of the attack. Don't forget to deploy the varnish.ddos template located under the templates/ directory in the release zip file.
1) Increase thread_pool_min. This value is the minimum number of threads to be laying around waiting to be made active by Varnish. So inside /etc/sysconfig/varnish increasethread_pool_min reasonably.For example,thread_pool_min=400
2) Increase memory available to Varnish via WHM -> cPanel Varnish -> Advanced Configuration ->Memory Cache. Be sure to have enough RAM available
3) If you expect an attack, increase the dynamic cache TTL also viaAdvanced Configuration -> Cache Time To Live. 40 (seconds) would be a reasonable value.
4) Increase max_connections value for backends via /etc/varnish/backends.vcl