I've installed Varnish on a standalone instance (EC2) and set it to fetch data from a different instance (EC2 as well on the same subnet), all trafiic is pointing to the Varnish instance, site loads and everything seems to be OK, the problem is that the varnish instance has a CPU usage of %0.6
while the main instance (web server) has around %50 CPU
usage, i do see varnish in the response headers but could it be that Varnish is simply not configured correctly?
Asked
Active
Viewed 51 times
0

Broshi
- 3,334
- 5
- 37
- 52
1 Answers
1
It is perfectly normal that Varnish has little impact on CPU. The correct configuration is not defined by CPU load but rather by the achieved hit rate.
Have a look at varnishstat
output to see the cache hit rate numbers. They are at the top right of the program's output.

Danila Vershinin
- 8,725
- 2
- 29
- 35
-
Cool now I see my hit rate, but it never passes 0.4... something is not working right. – Broshi Apr 09 '17 at 19:34
-
Make sure to check https://varnish-cache.org/docs/4.0/users-guide/increasing-your-hitrate.html It has some insight on ways to identify which requests are not cached (go to the backend server the most). That will be the starting to point to make changes to your Varnish VCL or the application's output. – Danila Vershinin Apr 09 '17 at 19:55