[Zope] Re: Ape
Chris Kratz
chris.kratz at vistashare.com
Thu Mar 16 12:59:04 EST 2006
On Thursday 16 March 2006 12:18 pm, Paul Winkler wrote:
> On Thu, Mar 16, 2006 at 11:00:11AM -0500, Chris Kratz wrote:
> > > Now, if using svn for source control is the only reason he was using
> > > APE, surely you'd agree that DirecotyViews are a more appropriate
> > > method?
> > >
> > > cheers,
> > >
> > > Chris
> >
> > Yes, you are more or less correct. The primary reason we went to APE
> > was after having tried the nightmares of the various zope cvs products
> > which just seemed to be able to tie themselves into knots after awhile.
> > APElib allowed us to persist all objects as plain text files on the file
> > system so that normal file system tools can be used for development.
> > After we went to APE we moved from CVS to subversion. Now most of us
> > develop using a text editor directly modifying our zope objects. We have
> > the refresh interval dialed down to 1s on our dev boxes and 5-10 minutes
> > on the live servers. This allows us to easily shoehorn minor patches
> > (fix - commit - update server) without any service interruption on the
> > live server. So, our reasons for using Apelib were...
> >
> > 1. Allow use of source control (branching, diffs, revision history, etc)
> > on all content types as plain text files, not python pickles.
> > 2. Allow editing of zope objects (DTML, ZPT, ZSQL, py script) externally
> > in appropriate editor.
> > 3. Allow us to quickly push out minor patches to running servers.
> > 4. A distant final item was using TTW editing to do minor tweaks.
>
> DirectoryViews would mean you'd lose #4.
> Otherwise, I think they'd work for you and it's a much simpler solution
> than ape.
>
> Also, if you have any persistent objects for which there isn't an existing
> FSObject-derived version, you'd have to write one.
>
> Another issue is that AFAIK there's no way to control the refresh
> interval of FSObject subclasses. I guess you could monkeypatch
> FSObject._updateFromFS. You might want to do that anyway so you
> don't have to run your production servers in debug mode.
Hello Paul,
How does the refresh interval work for DirectoryView? Obviously it is not
adjustable, so does it only read when it needs to the first time in and after
that it hits the cache (until evicted)?
I did extensive profiling of Apelib at one point and all the time was getting
soaked up with ape checking mod times on thousands of files on the check
interval. You don't notice this with a small site, but as the site grows it
becomes noticeable. At one point I seriously thought about writing an
external process/thread that would periodically sweep the files and check for
modified items and then attempt to evict those items from the cache within
each zope thread. Or even better, load the object into the cache out of band
so it's there the next time the thread runs. I think that would have made
apelib much faster and still responsive to changes on the file system. We
never got it production ready though.
-Chris
--
Chris Kratz
More information about the Zope
mailing list