[Zope] Network Appliances NetCache vs. Squid
Tue, 6 May 2003 23:45:24 -0700
Well Marc, Paul browning brought up a good point about the Solaris and
threading issues. That could explain a lot. I ran Zope 2.3 on a Celeron
400 Linux box with very high traffic and it held up well. 15 to 20 to 1
minute is nothing I have ever seen a Zope-driven site do. That's not
As far as the images, you would use Zope RAM Cache Manager to store the
accessed images in RAM. If most of your images are around 10k, you might
multiple that by how many images you use on the site to figure out how
much ram it will take up. You should also cache pages that are
pretty-much static. If you use a header and footer or zpt's metal: for
templating where the content gets put inside the design template, you
can cache the template or header and footer too.
Another thing on using squid to cache the images and pages, you can
specify what objects are cacheable and Zope will use ICP to tell Squid
the page or image has changed and Squid will re-cache the object. I am
not sure about the relative directory issue with the images. It might
not matter when using Squid. It would also seem to me that having an
absolute reference to the image would speed things up a bit because Zope
won't have to use acquisition to find the image. Just a thought, I may
I would seriously see if the threading issue and Solaris is the culprit
for your slow responses. Is there any reason why you run Solaris?
Another way I have found to speed-up Zope (this sounds strange but it
works) is to run Zope behind Apache and Apache behind Tux. I have done
that before and it is a very speedy solution.
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Marc
Sent: Wednesday, April 30, 2003 4:36 AM
Subject: Re: [Zope] Network Appliances NetCache vs. Squid
Hi Scott, thanks for the reply!
This is going to be a bit lengthy, as I tried to fully describe the
Interestingly enough, I started out asking this list how I can determine
best usage of the cache mechanisms built into Zope. There are two
bottlenecks in the site.
We are only responsible for programming and hosting of the site. The
customer has chosen to give the HTML coding part of the work to a design
All pages, images and data are stored in the ZODB!
We have trained the HTML coders (2 years ago) and written some tip
explicitly telling them to use absolute referencing for images from the
However in a recent re-design of the site, they have ignored this advice
all images are now referenced relatively. In any bog standard web server
environment, those paths wouldn't work. (As they are simply wrong.) But
thanks to Zope inheritance, it just climbs up the directory tree and
ultimately finds the images. So the coders never spotted their mistake.
The images are all stored in a root-level image directory or
The site contains 45 "microsites" which have identical page-structure,
have all the same pages, but different data. So each microsite has a
page. On such a news page all three images above are required. The HTML
for these images reads:
<img src=images/navigation/home.gif ...> or
<img src=images/mainlogo.gif ... > or
The microsites are all root level directories. The news pages are in
subdirectories of each microsite. The templates use "includes" for most
the page components and these includes are in the root. For example:
A browser or proxy trying to cache things will resolve any of the images
be "local" to the news directory and not identify them all being the
image. So caching will only work for pages within the same subdirectory,
not across all pages on the site, even they all use the same logo.
Obviously, I could go and edit the 100+ include files and fix the false
referencing. However, that would only fix about half of the
problem, as some images are stored in image folders within each
Obviously, this task is labour intensive and I look for a quicker fix.
the person responsible for the site within the customer has changed and
new guy wants to change the site's look and feel in around 6 months
has new budget) to be less image rich. At the moment each page contains
least 30 images, most being albeit small. But as they are mainly text
rendered to images using a not-so-common font (Stone) we (me and the
customer) agree that making the real text links in the next revamp will
improve usability and speed up page load time.
Is Zope's RAM cache manger going to help delivering the images here?
them are under 10Kb in size. Obviously the times saved would be fetching
them from the ZODB on disk.
2.) Zope responding to request
Zope is responding slowly to any initial request. You can see in the
browser's status bar the "connecting to site" message for about 15-20
seconds before anything happens, at peak usage time this can go up to
a minute. The site is "busy" from around 6am to 1am, with a peak usage
between 4pm and 7pm.
I believe that the issue here is how many requests can be served in
parallel. The box itself could serve more, neither CPU, RAM nor network
maxed out. CPU load is usually around 30% even at peak usage. So I was
wondering if running ZEO and 2 instances of Zope pointing at the same
on the same machine would improve things.
Content changes frequently overall, but many pages don't change for
Most pages are truly dynamic (i.e. content managed). Packing the
every night has not improved performance. And because of the true
nature of the site I wonder how well a cache like squid would improve
site. (I have never done any caching, although recently read a lot about
We're using Zope 2.3 on a Solaris 8 server (Compaq, 2 P2 450MHz CPUs,
Disk array, 1 Gig of RAM). The box and OS has been chosen by the
and there's no room for play currently. (OS is company policy and no
for another box.)
We have developed a few "light-weight - very easy to use" content
products for Zope and have run into a few problems when testing them
Zope 2.5/2.6, hence we still stick with 2.3 for production sites until
bugs are fixed.
> Date: Mon, 28 Apr 2003 10:41:36 -0700
> From: Scott Burton <email@example.com>
> Subject: Re: [Zope] Network Appliances NetCache vs. Squid
> To: firstname.lastname@example.org
> Why do you really need to accelerate the site?
> If you have a highly dynamic site, no acceleration appliances will
> There may be a few things you can do on your end first to see if there
> something easy to do to your instance of Zope.
> Have you run profiling to see what is the bottleneck? Are there some
> expensive scripts that may need some reworking for better performance?
> Profiling can help with that. Do you efficiently use Zope's caching
> mechanisms like caching templates and images in ram, or increasing the
> of the ZODB cache? What OS is running Zope? Could you proxy Apache in
> of Zope on the same machine using mod_cache to speed up images etc.?
> you build a simple 1u Linux box with ZEO and Squid on it as the
> for less than a netappliance?
> I would look into those things(if you haven't already) before worrying
> a caching/accelerator.
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -