[Zope-Coders] Zope tests: 8 OK
Summary of messages to the zope-tests list. Period Mon Sep 19 11:01:02 2005 UTC to Tue Sep 20 11:01:02 2005 UTC. There were 8 messages: 8 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2_6-branch Python-2.1.3 : Linux From: Zope Unit Tests Date: Mon Sep 19 22:21:43 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003127.html Subject: OK : Zope-2_6-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Mon Sep 19 22:23:13 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003128.html Subject: OK : Zope-2_7-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Mon Sep 19 22:24:43 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003129.html Subject: OK : Zope-2_7-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Mon Sep 19 22:26:13 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003130.html Subject: OK : Zope-2_8-branch Python-2.3.5 : Linux From: Zope Unit Tests Date: Mon Sep 19 22:27:43 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003131.html Subject: OK : Zope-2_8-branch Python-2.4.1 : Linux From: Zope Unit Tests Date: Mon Sep 19 22:29:13 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003132.html Subject: OK : Zope-trunk Python-2.3.5 : Linux From: Zope Unit Tests Date: Mon Sep 19 22:30:43 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003133.html Subject: OK : Zope-trunk Python-2.4.1 : Linux From: Zope Unit Tests Date: Mon Sep 19 22:32:13 EDT 2005 URL: http://mail.zope.org/pipermail/zope-tests/2005-September/003134.html ___ Zope-Coders mailing list Zope-Coders@zope.org http://mail.zope.org/mailman/listinfo/zope-coders
[Zope-dev] Re: Weird IndexableObjectWrapper + TopicIndex + aq_acquired interactions.
OK, so, for some reason some CMF objects fail when being indexed because they are wrapped in an aq wrapper that wrapped an IndexableObjectWrapper that wraps another aq_wrapper. And sometimes, the same object do not fail in otehrwise very similar situation. *sigh*. So for example, this works fine: container._setObject(id, ob) ob = container._getOb(id) returns to the workflows constructInstance method yadayadyada ob.indexObject() All if fine. And this fails: container._setObject(id, ob) ob = container._getOb(id) ob.manage_permission( permission_to_manage='Access contents information', roles=ACCESS_CONTENTS_INFO_ROLES, acquire=0) returns to the workflows constructInstance method yadayadyada ob.indexObject() Now, it only fails around every second time. Mhm. Nope, not everytime. It's regukar, a unit test will fail on the same places both times, but *exactly the same call* will still fail about every second time. Hurray. I'm so happy this problem is so easy to track down! Grrr. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Weird IndexableObjectWrapper + TopicIndex + aq_acquired interactions.
Lennart Regebro wrote at 2005-9-19 17:38 +0200: ... aq_acquire will, if the first parameter is not an AcquisitionWrapper, and the third parameter is not None, wrap the object. Now, in our case, the object is an IndexableObjectWrapper, wrapping an Acquisition wrapped object. So, aq_acquire will Acquicision wrap the IndexableObjectWrapper, with the result that the object being used now has no context! Really? What is the aq_parent that was used when wrapping the object? It is context of the IndexableObjectWrapper. The context of the indexable wrapped object does not change. ... Then, it passes this to validate, who in turn passes it to allowed, who check that the object has the users user folder in it's context. And it hasn't, because it has no context. *blam* You get an AuthorizedError, and the object does not get indexed. Where does the context come from used when aq_acquire acquisition wrapped the IndexableObjectWrapper? The best way around such problems would probably by to make IndexableObjectWrapper a public class. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope] create a new log file
--On 19. September 2005 19:19:38 +0100 Nuno [EMAIL PROTECTED] wrote: Hi! How can I create a new log file, e.g. mylog.log, this is to log specific jobs in a different log file of event.log. I think you can not reuse the zLOG API of Zope for custom logfiles. You need to implement your own logging based on the Python 'logging' module. Check the Python documentation for information for details. -aj pgpae8zkrSBUr.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope scalability / efficiency question
mark hellewell wrote: Hi everyone, I've got a question I'd really appreciate some input on. If I'm running perhaps a dozen Zope sites, experiencing anywhere between several hits per second to a lot less, would it potentially be more efficient (decreased latency etc.) to run each site as its own Zope instance or have one Zope instance running muliple (CMF based) sites. I haven't even thought about adding ZEO into the mix yet. The basic aim of the exercise is to find out how many usable zope instances / sites I could get onto a typical mid-range modern server. I know it's a bit of a how long are your pieces of string sort of question, but any help you could offer would be gratefully accepted! If anyway has any experience of this sort of setup and can offer a little insight it might reduce the amount of testing I have to do myself. I don't think you'll see any improvement unless you have a multi-processor machine. In such a case, running X processes (where C is the number of cores) will fully load the machine, since Python threads won't skip processors. On a single-core machine, multiple instances probably will just increase your overhead, especially in memory. But I could be wrong: there's so many variables the best way to know is to test. (Caches and usage patters, for instance, can make a big difference.) If you do have several sites, you could be running into cache eviction issues since there are a lot of objects that need to be accessed. Check your cache fullness and watch your ZODB usage chart for excessive loads. --jcc -- Building Websites with Plone http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Zope scalability / efficiency question
I did some tests a few years back, basically that came out such that you run the number of zope instances as you have CPUs. I was able to get double the performance of a single instance on a dual cpu server when adding a second instance. On a single CPU server, I found that the number of requests the server was able to render was cut by nearly 50% +/- when adding a second instance. My rule for building out ZEO Client servers is: Single CPU - Single Zope instance Multiple Processors - # CPUs == # of Zope instances Make sure you have enough ram if you're running multiple instances. The number of sites you can run from a single instance without cache problems really takes some localized knowledge of how your instances are performing. I run *lots* of sites from a single Zope instance without splitting them off at the load balancer into different mini-pools. I do this because I can, but if I was performance challenged from, say, cache flipping, I would definitely do this. You could likely better off if you ran all of your sites within a single instance (spread across multiple multi-processor machines with enough ram (2 - 4 GBs should do?)). It's a tough question to answer with much precision without intimate knowledge of what you're doing and how your systems are performing. If they're in the same zope instance, managing them as separate entities is difficult. Your application and maintenance of these sites might be the best determination for how you should factor the instances across your hardware. Andrew Sawyers -- Zope Managed Hosting Software Engineer Zope Corporation (540) 361-1700 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J Cameron Cooper Sent: Tuesday, September 20, 2005 1:26 PM To: [EMAIL PROTECTED] Cc: zope@zope.org Subject: Re: [Zope] Zope scalability / efficiency question mark hellewell wrote: Hi everyone, I've got a question I'd really appreciate some input on. If I'm running perhaps a dozen Zope sites, experiencing anywhere between several hits per second to a lot less, would it potentially be more efficient (decreased latency etc.) to run each site as its own Zope instance or have one Zope instance running muliple (CMF based) sites. I haven't even thought about adding ZEO into the mix yet. The basic aim of the exercise is to find out how many usable zope instances / sites I could get onto a typical mid-range modern server. I know it's a bit of a how long are your pieces of string sort of question, but any help you could offer would be gratefully accepted! If anyway has any experience of this sort of setup and can offer a little insight it might reduce the amount of testing I have to do myself. I don't think you'll see any improvement unless you have a multi-processor machine. In such a case, running X processes (where C is the number of cores) will fully load the machine, since Python threads won't skip processors. On a single-core machine, multiple instances probably will just increase your overhead, especially in memory. But I could be wrong: there's so many variables the best way to know is to test. (Caches and usage patters, for instance, can make a big difference.) If you do have several sites, you could be running into cache eviction issues since there are a lot of objects that need to be accessed. Check your cache fullness and watch your ZODB usage chart for excessive loads. --jcc -- Building Websites with Plone http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to show field names from sql query?
Thomas Apostolou wrote at 2005-9-19 13:43 +0100: i use the following to get to show the results from an sql query. What are the expresions to show the field names? The ZSQL method result has a method names returning the field names. You can use it in a dtml-let, similar to: dtml-let result=TestODBCEM() field_names=result.names() dtml-in result prefix=row dtml-in field_names prefix=field dtml-var field_item !-- the field name -- dtml-var expr=_[field_item] !-- its value -- -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Multiple ZODB for virtual hosts with ZEO
David Pratt wrote at 2005-9-17 13:07 -0300: Is it possible for ZEO to be configured with multiple databases, This is still possible but might go away in future. Then, you would use more than a single ZEO; one ZEO per database, to be precise. Any ZEO client can connect to any number of ZEO servers or (currently) storages on one or many ZEO servers. one for each virtual host similar to creating a ZODB mount point for an instance so if there is a problem with a site's database it is limited to a single site and that individual backups can be made of each ZODB? You can do this -- without ZEO, with a single ZEO (and multiple storages) and with many ZEOs. In fact, this feature has nothing to do with ZEO but results from mountability. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Getting at third-party modules in dtml?
Axel Straschil wrote at 2005-9-20 04:07 +: Hi! Say I have a function that I want to make callable in my UI. It needs to be globally available, i.e. it needs to be callable *without* having an instance of my product yet. (This has to do with listing information about all acquirable instances of the product, so the user can choose from those available.) In a Product's __init__.py: def theSecret(self): return A hobbit! methods = { 'whatIsFrodo': theSecret } Save that i.E. in MyInstance/Products/MyFancy/__init__.py, restart Zope And than dtml-var whatIsFrodo. And if you do not want to pollute the Folder (class) namespace, you can define it as a constructors (to registerClass) and use it via objectManager.manage_addProduct[your product].constructor(...) -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Multiple databases/instances
I'm working on the scalability aspect of Zope, and am trying to see what the best practices are for creating multiple databases or multiple Zope instances. I am using ZEO and have allowed for multiple databases (Data.fs files) by editing zeo.conf just to try that out, because our current database is getting very large. The way I understand it, ZEO allows the work load to be distributed among multiple clients when you are getting a lot of hits, but does not address the issue of having a very large database for which it may slow down. So for this you would either create multiple instances of Zope/ZEO which each have their own database, or you would just create multiple databases within a single Zope/ZEO instance. Is there what is considered a best practice as far as choosing one of these options? Is there a database size I should try to maintain by distributing my Plone sites among different databases - or maybe just have a separate database for each? Or perhaps I am way off... Eric ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Getting at third-party modules in dtml?
Axel Straschil wrote at 2005-9-20 04:07 +: Hi! Say I have a function that I want to make callable in my UI. It needs to be globally available, i.e. it needs to be callable *without* having an instance of my product yet. (This has to do with listing information about all acquirable instances of the product, so the user can choose from those available.) In a Product's __init__.py: def theSecret(self): return A hobbit! methods = { 'whatIsFrodo': theSecret } Save that i.E. in MyInstance/Products/MyFancy/__init__.py, restart Zope And than dtml-var whatIsFrodo. And if you do not want to pollute the Folder (class) namespace, you can define it as a constructors (to registerClass) and use it via objectManager.manage_addProduct[your product].constructor(...) Very educational, thanks for the replies! I didn't understand Dieter's comment until I tried Axel's suggestion. It apparently works by adding a theSecret method to the Folder class and derived objects including the root App object. i.e. you can visit http://localhost:8080/theSecret and (if the method has a docstring) you'll see 'A hobbit!'. I have to say that's pretty darn obscure behavior. It's the antithesis of self-documenting, and I've never seen it used before. Is this documented somewhere? I see one example of it in OFS/tests/testProductInit.py... Also, AFAICT there's no way to declare security on that function. (which is OK in this case since I wanted something 'public' anyway). Anyway, in the end, I followed neither suggestion, since I don't want either to pollute the Folder (class) namespace, nor do I want to register a constructor that isn't really a constructor ... the former would be obnoxious to users who install my product, the latter seems likely to confuse whoever has to maintain this code after me! Instead, I bit the bullet and rewrote the offending part of the UI as a PageTemplateFile; it wasn't much work after all and I can leave the rest as DTML for now. I like this solution because client code (the template) has to explicitly look up the function via the 'modules' mapping. -PW ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Help with virtual hosting Zope on different ports
Unless you need some special Apache functionality, you may want to look and the Pound Rev-Proxy/Load Balancer at http://www.apsis.ch/pound. I find it much easier than getting involved with apache, it's lightweight, secure and designed with Zope in mind. two cents, -Jon. Michael Sanborn wrote: I have two Zope versions running behind Apache 1.3 (on FreeBSD 4) using different ports on the same server. The only domain name currently assigned to the server is for a Squishdot site on the older Zope version (2.5.1) that I haven't been able to upgrade, and I don't want to spend the time figuring it out right now. The newer Zope version (2.8.1) has a Plone site that I would like to run as a domain of its own. Can someone help me figure out the combination of Apache rewrite rules and Zope/Plone products I would need to use to accomplish this? Just to try to make it clear, what I want is: request: oldsite.com result: myserver:8093/oldsite request: newsite.com result: myserver:8580/newsite This is possible, isn't it? If it helps, here are the existing rewrite rules: VirtualHost oldsite.com ServerName oldsite.com ServerAdmin [EMAIL PROTECTED] DocumentRoot /u2/oldsite ScriptAlias /cgi-bin/ /u2/oldsite.cgi-bin/ RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(oldsite/)?(.*) /usr/local/Zope/Zope.cgi/oldsite/$2 [e=HTTP_CGI_AUTHORIZATION:%2,t=application/x-httpd-cgi,l] ErrorLog /u2/oldsite.admin/oldsite.errors TransferLog /u2/oldsite.admin/oldsite.access /VirtualHost VirtualHost www.oldsite.com ServerName www.oldsite.com ServerAdmin [EMAIL PROTECTED] DocumentRoot /u2/oldsite ScriptAlias /cgi-bin/ /u2/oldsite.cgi-bin/ RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(oldsite/)?(.*) /usr/local/Zope/Zope.cgi/oldsite/$2 [e=HTTP_CGI_AUTHORIZATION:%2,t=application/x-httpd-cgi,l] ErrorLog /u2/oldsite.admin/oldsite.errors TransferLog /u2/oldsite.admin/oldsite.access /VirtualHost Thanks in advance for any assistance, Michael Sanborn ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Jonathan Cyr [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] How to show field names from sql query?
Thomas Apostolou wrote: Hello all, i use the following to get to show the results from an sql query. What are the expresions to show the field names? table dtml-in expr=TestODBCEM(sysDSN=sysDSN, usr=usr, mypass=mypass, sSQL=sSQL) dtml-if sequence-even tr bgcolor=lightgreen dtml-else tr /dtml-if dtml-in sequence-item tddtml-var sequence-item/td /dtml-in /tr /dtml-in /table You can ask the Results object 'names()' to get the names of the columns of your results. Note you need to ask the results list, not an individual result, so you'll need to define TestODBCEM(sysDSN=sysDSN, usr=usr, mypass=mypass, sSQL=sSQL) as something so as to ask it for names and loop over it later. --jcc -- Building Websites with Plone http://plonebook.packtpub.com/ Enfold Systems, LLC http://www.enfoldsystems.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Getting at third-party modules in dtml?
Hi! before. Is this documented somewhere? Never seen a Documentation for that, everything in Zope that is not done Trough the Web is Use the source, Luke documented. I.E., this thread is worth a Documentation, but who will write it down ... ;-) Lg, AXEL. -- Gentoo? Debian? RedHat? SuSE? *BSD? Stop the distri-war, make little user! ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )