Re: [squid-users] Advantages of squid?

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 15 Feb 2009 12:20:13 +1300

Eric B. wrote:
> Hi,
>
> I'm brand new to squid and have been doing research into it and how i might
> leverage its power for my application, but am having a lot of difficulty in
> seeing how it might advantage my setup. I design java applications that run
> on tomcat servers. Currently our java apps are running on tomcat using
> apache httpd as a front end. Both tomcat and httpd are on the same server.
> All requests go to apache and then are redirected to tomcat. At the moment,
> tomcat is serving all content; both static and dynamic content.
>
> At this point, I'm trying to see if there are any advantages of squid in my
> setup. If I put squid in front of the apache servers, then I guess squid
> will end up caching and serve any static content of the application. I
> guess the big question is if there is really any advantage to this?

Squid effectively replaces apache at that point. If the apache is trying
to server other sites tis can have a net benefit in that apache is
free'd up to handle just those site and Squid does the redirection to
either apache or tomcat directly.
I've found a noticable speed increase (50%) in all sites when I placed a
squid box in front of the web servers. But your experience may vary.

> If I
> were to install squid on the same server as tomcat/httpd, how would that
> accelerate any content delivery? Is it that much faster than tomcat to
> find/send the data?

Yes Squid+tomcat has about x10 higher request threshold (rough estimate
from rough req/sec calculations) than a bare tomcat. And a faster
response time for may things.

> The same total bandwidth is used sending content to the
> end user, so there is no savings there, and whether it is squid or tomcat
> that is sending the data, I can't forsee any significant savings there.

It's a CPU time reduction for tomcat, which results in faster serving of
cached content. And an incremental increase in generated content.
The maximum benefit is seen when Squid is on a different machine though,
as the resource savings on the tomcat box are maximized.

>
> I guess I can see squid would end up offloading some of the processing from
> tomcat, but if I were to put them on the same server, then it ends up being
> the same CPU/disk that get used, so I don't see any advantages there
> either - the processing power just gets shifted from one app to another.
>
> Am I missing something? Is there something wrong in my assumptions how to
> use squid?

Tomcat will attempting to re-generate content it does not have to,
simply because it has a dynamic type or because its not storing the
response headers. Squid will fix this minor CPU waste.
As I said though if they are on different boxes, that is when savings
are maximized.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
   Current Beta Squid 3.1.0.5
Received on Sat Feb 14 2009 - 23:20:05 MST

This archive was generated by hypermail 2.2.0 : Sun Feb 15 2009 - 12:00:01 MST