Mailing List Archive

About choosing the right instance type for Varnish in AmazonEC2
Hi guys,
any suggestion choosing an Amazon EC2 instance type for Varnish ?

I stumbled upon this doubt/question because we are currently using
"m3.medium" which only has 1 CPU and as stated in the docs Varnish assumes
at least 2 CPU

https://varnish-cache.org/docs/4.1/reference/varnishd.html#thread-pools

The performance feeling that we have is exactly the one cited in the docs
"...more than one pool for each CPU is most likely detrimental to
performance"

Should I decrease this value to 1 or better use another instance type.
In the latter we could upgrade to m3.large(same kind of instance type but
with 2 CPU) or switch to other types : more CPU optimized and less RAM
optimized (c3.large or c4.large)

Any experience/suggestion will be highly appreciated

Thanks

Jordi
Re: About choosing the right instance type for Varnish in AmazonEC2 [ In reply to ]
Hi Jordi,

It's hard to make this determination without any data on the traffic your
site is receiving and what peak traffic you're expecting.Varnish will
surely perform better on an instance with multiple CPUs and that's why we
generally standardize on c3.large instances as the initial size for our
Varnish instances. You will have to determine if that's an economical
choice for you.

Paul K

On Fri, Mar 10, 2017 at 10:58 AM, Jordi Llach <jllach@agilecontents.com>
wrote:

> Hi guys,
> any suggestion choosing an Amazon EC2 instance type for Varnish ?
>
> I stumbled upon this doubt/question because we are currently using
> "m3.medium" which only has 1 CPU and as stated in the docs Varnish assumes
> at least 2 CPU
>
> https://varnish-cache.org/docs/4.1/reference/varnishd.html#thread-pools
>
> The performance feeling that we have is exactly the one cited in the docs
> "...more than one pool for each CPU is most likely detrimental to
> performance"
>
> Should I decrease this value to 1 or better use another instance type.
> In the latter we could upgrade to m3.large(same kind of instance type but
> with 2 CPU) or switch to other types : more CPU optimized and less RAM
> optimized (c3.large or c4.large)
>
> Any experience/suggestion will be highly appreciated
>
> Thanks
>
> Jordi
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
Re: About choosing the right instance type for Varnish in AmazonEC2 [ In reply to ]
Hi Jordi,
I'm running it on t2.medium for several websites totaling 200k+ pageviews
per day and it's running great.

Albert

On Fri, Mar 10, 2017 at 10:58 AM, Jordi Llach <jllach@agilecontents.com>
wrote:

> Hi guys,
> any suggestion choosing an Amazon EC2 instance type for Varnish ?
>
> I stumbled upon this doubt/question because we are currently using
> "m3.medium" which only has 1 CPU and as stated in the docs Varnish assumes
> at least 2 CPU
>
> https://varnish-cache.org/docs/4.1/reference/varnishd.html#thread-pools
>
> The performance feeling that we have is exactly the one cited in the docs
> "...more than one pool for each CPU is most likely detrimental to
> performance"
>
> Should I decrease this value to 1 or better use another instance type.
> In the latter we could upgrade to m3.large(same kind of instance type but
> with 2 CPU) or switch to other types : more CPU optimized and less RAM
> optimized (c3.large or c4.large)
>
> Any experience/suggestion will be highly appreciated
>
> Thanks
>
> Jordi
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>



--
Web: http://www.tollkuci.com
Follow me on: LinkedIn <http://www.linkedin.com/in/alberttollkuci> Google+
<https://plus.google.com/+AlbertTollku%C3%A7i/posts> Facebook
<https://www.facebook.com/albert.tollkuci> Twitter
<https://twitter.com/AlbertTollkuci> Career 2.0
<http://careers.stackoverflow.com/atollkuci>
------------------------------
Re: About choosing the right instance type for Varnish in AmazonEC2 [ In reply to ]
We found that we run into the network IO limits before we had CPU
issues. You have to use trial and error to figure out how much IO you
can get from each instance type as we couldn't find good documentation
defining that. However it seemed that the network limit goes up as you
step up machine sizes in each family.

You could also put your varnish into an ASG and add instances on CPU or
Network IO. The cache wouldn't be shared between them, but depending on
your traffic that may not matter.

At our busiest time we were running 6 c4.4xlarge instances 3 east 3
west. Now, we run 4 r4.xlarge instances. The nice thing about them
being virtual is you can load test them and then load test another
instance type fairly easily.

Cheers,

Craig


On 2017-03-10 03:58, Jordi Llach wrote:
> Hi guys,
> any suggestion choosing an Amazon EC2 instance type for Varnish ?


_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: About choosing the right instance type for Varnish in AmazonEC2 [ In reply to ]
Just to chime in:

- 1 CPU is a good starting point, as others have said, Varnish does not
need much CPU. If you max out the CPU, then move to 2 CPUs, repeat...
- Do not change any of the thread settings, the defaults will work nice
on a single CPU or more.


--
Reza Naghibi
Varnish Software

On Fri, Mar 10, 2017 at 3:16 PM, Craig Servin <cservin-varnish@cromagnon.com
> wrote:

> We found that we run into the network IO limits before we had CPU issues.
> You have to use trial and error to figure out how much IO you can get from
> each instance type as we couldn't find good documentation defining that.
> However it seemed that the network limit goes up as you step up machine
> sizes in each family.
>
> You could also put your varnish into an ASG and add instances on CPU or
> Network IO. The cache wouldn't be shared between them, but depending on
> your traffic that may not matter.
>
> At our busiest time we were running 6 c4.4xlarge instances 3 east 3 west.
> Now, we run 4 r4.xlarge instances. The nice thing about them being virtual
> is you can load test them and then load test another instance type fairly
> easily.
>
> Cheers,
>
> Craig
>
>
> On 2017-03-10 03:58, Jordi Llach wrote:
>
>> Hi guys,
>> any suggestion choosing an Amazon EC2 instance type for Varnish ?
>>
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
Re: About choosing the right instance type for Varnish in AmazonEC2 [ In reply to ]
On Fri, Mar 10, 2017 at 9:16 PM, Craig Servin
<cservin-varnish@cromagnon.com> wrote:
> We found that we run into the network IO limits before we had CPU issues.
> You have to use trial and error to figure out how much IO you can get from
> each instance type as we couldn't find good documentation defining that.
> However it seemed that the network limit goes up as you step up machine
> sizes in each family.

CPU usage tends to grow with features like compression or ESI, VMODs
may also burn cycles depending on their purpose.

Dridi

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: About choosing the right instance type for Varnish in AmazonEC2 [ In reply to ]
In my experience, the R3/R4 family works best for Varnish. Varnish isn't
great at spreading the load across multiple cores, but it will fully
utilize all the ram you give it.

I like to run an ASG of size 2 as the front door to the side. This
maximizes availability, and keeps cache fragmentation to a minimum, and
protects you from most AZ issues and single instance hardware issues.

-Jason

On Fri, Mar 10, 2017 at 5:05 PM, Dridi Boukelmoune <dridi@varni.sh> wrote:

> On Fri, Mar 10, 2017 at 9:16 PM, Craig Servin
> <cservin-varnish@cromagnon.com> wrote:
> > We found that we run into the network IO limits before we had CPU issues.
> > You have to use trial and error to figure out how much IO you can get
> from
> > each instance type as we couldn't find good documentation defining that.
> > However it seemed that the network limit goes up as you step up machine
> > sizes in each family.
>
> CPU usage tends to grow with features like compression or ESI, VMODs
> may also burn cycles depending on their purpose.
>
> Dridi
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>