[GeneralDiscussion] performance fixes
[email protected] (Simon Michael)
| Newsgroups | gmane.comp.web.zope.zwiki |
|---|---|
| Message-ID | <317C4D95-F4DB-4652-BDF2-DEC46B27446E__44666.1907750697$1205276123$gmane$org@joyful.com> |
I looked at some more server slowness today, with the help of emacs,
dtach, top, vmstat, tail, highlight-lines-matching-regexp, and Tres
Seaver's excellent thrashcatcher product which shows zodb load and
store counts for each transaction in the trace log. I applied two
fixes which large zwiki sites might want to know about:
- bots were finding their way directly to page revision diffs (how ? I
don't know), trying every link and causing a lot of unnecessary zodb
loads. I stopped it by adding this apache rewrite rule::
# temporary to keep bots out of revisions
# redirects direct requests for revisions to the latest page
RewriteRule (.*)/revisions/(.*)\.[0-9]+/ $1/$2 [R,L]
- visits to old revisions of zwiki.org FrontPage were generating
thousands of page loads every time. The "new pages" dtml snippet on
FrontPage calls pages() to show the last 5 pages, but in the revisions
folder this was falling back to a non-catalog search (since there is
no catalog there), loading all 2000+ old page revisions into cache.
For this reason pages now returns nothing without a properly
configured catalog.
--
forwarded from http://zwiki.org/GeneralDiscussion#[email protected]