Thanks, that may help.  Part of my problem may be that my data model
is highly interconnected, and a lot of my templates require pulling
large amounts of data from the database, and then using that
information to pull more information out.  I'm going to try caching
some of my classes and rewriting the templates in cheetah - I'll post
an update when I've tried that.

-Ryan

On May 17, 3:32 pm, Matthew Bevan <[EMAIL PROTECTED]> wrote:
> > That's more like what i would expect - what type of hardware are you
> > running that on?
>
> I'm hosted on WebFaction's web4 server which seems to have a load
> average ranging from 8 to 13 (the 1-minute average as I type this is
> 13, the highest I've ever seen it).  This server appears to be
> running 53 Zope instances and 12 TurboGears instances.  Other
> instances, PHP, etc. I can not meter with my level of access.  The
> machine appears to have 4 GiB of RAM installed, and is either a dual-
> core w/ hyperthreading, or quad-core Intel Xeon running at 2.4 GHz.
> I'm not sure I should do more snooping than that.  ;^)
>
> > What SQL server?
>
> I've stuck to SQLite.  Read performance (which 99.9% of my traffic
> is) seriously trounces the performance of a stock MySQL setup.  If I
> expand the system much further - more users, more content types, etc.
> - I may switch to a stock MySQL setup just for the better write
> performance.
>
> > Have you spent much time tweaking the SQL settings, or is it fairly
> > out-of-the-box?
>
> Entirely out-of-the-box.
>
> > Are you using SQLObject or SQLAlchemy?  If SQLObject, are you doing
> > anything to optimize the database read/writes?
>
> I'm using SQLObject because of its great inheritance support.  This
> doubles and sometimes triples the number of SELECT queries, though.
> My content management system makes extensive use of inheritance at
> the database layer.  The top-level columns are cached (from the Atom
> class; includes name, path, title, and several visibility properties)
> while fields in sub-classes are not cached.  This allows me to do
> tests vs. visibility and display the title/url in lists without
> having to touch the database.  When displaying the contents of an
> object (folder or page, for example) SQLObject performs only the
> requested lookups.  I.e.:
>
>     # No database lookups for this.
>     for i in self._children:
>        if i.visible:
>           print i.id, i.name, i.url
>
> This is done using the following:
>
> class Atom(InheritableSQLObject):
>     class sqlmeta:
>        table = "atoms"
>        defaultOrder = ['lft']
>        cacheValues = True
>
>     lft = IntCol(default=0)
>     rgt = IntCol(default=0)
>     name = UnicodeCol(length=255)
>     # ...
>
> class Page(Atom):
>     _inheritable = False
>     class sqlmeta:
>        table = "pages"
>        defaultOrder = None
>        cacheValues = False
>
>     content = UnicodeCol(default=None)
>     mime = UnicodeCol(length=200, default="application/xhtml+xml")
>
> Caveat: You -must- re-set the defaultOrder in child classes (if
> defaultOrder is set in a parent class) or SQLObject will attempt to
> sort, in this example, Page.select() results by the 'lft' column,
> which doesn't exist in the 'pages' table.
>
> With this setup, every time a Page is displayed only one query is
> run: "SELECT `content` FROM `pages` WHERE `id`=X".  Folders incur
> three SELECT statements plus two SELECTs per child node.  The blog
> entries hare handled outside the content management system (i.e. blog
> entries do not descend from Atom).
>
> This setup also incurs the overhead of every element on the site
> having its Atom record permanently in memory.  (The site tree is run
> when the server is first initialized - in the __init__ method of the
> RootController - and instances of the controller classes are created
> as appropriate.  The __init__ for the controller classes Atom.get()s
> a copy of the record and stores it in a private property.  The Atom
> class includes 17 fields, one of which is a UnicodeCol with no length.
>
> Hope that helps give more insight!  (Seriously - what's your code -
> doing-?  ;^)
>
> Matthew Bevan, Systems Administrator
> Top Floor Computer Systems Ltd.
>
>  smime.p7s
> 3KDownload


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to