[Zope-dev] Re: Bump up the nr of ZOpe trhreads

2002-09-10 Thread Dario Lopez-Kästen


- Original Message -
From: Chris McDonough [EMAIL PROTECTED]


 You'll also want to change the number of database connections.  If
 you use FileStorage, put the following in a custom_zodb.py file in
 your Zope software home or instance home (if you run an instance
 home setup):

 import ZODB.FileStorage
 import ZODB.DB

 filename = os.path.join(INSTANCE_HOME, 'var', 'Data.fs')
 Storage = ZODB.FileStorage.FileStorage(filename)
 DB = ZODB.DB(Storage, pool_size=25, cache_size=2000)

 The pool_size parameter is the number of database connections.
 The number of database connections should always be higher than the
 number of threads by a few (it doesn't make sense to have fewer
 database connections than threads).


Great, thanks :-)

But, am I still limited to max 7 zope threads? I wish to have around 20.
About 1/2 to 1 year ago I recall being told that with

python z2.py -t nrOfThreads

nrOfThreads could be set to whatever but Zope would not use more than 7 in
any case. Is this so still? Can it be changed? And is -t a parameter for
zserver or for the ZODB?

TIA

/dario

- 
Dario Lopez-Kästen, [EMAIL PROTECTED]IT Systems  Services
System Developer/System Administrator Chalmers University of Tech.




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Bump up the nr of ZOpe trhreads

2002-09-10 Thread Toby Dickenson

On Monday 09 Sep 2002 10:02 am, Dario Lopez-Kästen wrote:
 Hello!

 Apart from the -t option to z2.py (that, afaik, limits me to only 7), what
 other settings do I need to change to bump up the number of Zope threads to
 around 20,

remember that -t 20 uses 20 times more memory than -t 1 .

Might you be better off with a smaller number of threads, and use the memory 
for a huge cache for oracle queries?

 both for ZServer and for ZODB Accesses? If i change these
 settings, which one will allow me to have around 20 threads available to
 access an external Oracle DB (the zserver or the ZODB)?


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Re: Bump up the nr of ZOpe trhreads

2002-09-10 Thread Chris McDonough

On Tue, 2002-09-10 at 06:51, Dario Lopez-Kästen wrote:
 But, am I still limited to max 7 zope threads?

No.

 nrOfThreads could be set to whatever but Zope would not use more than 7 in
 any case. Is this so still? Can it be changed? And is -t a parameter for
 zserver or for the ZODB?

You can set this to whatever you like, but as I said before it doesn't
make sense to have fewer database connections than threads, so they go
sort of hand-in-hand.

The parameter is the number of ZPublisher worker threads.  This is how
many threads are hanging around to service requests that come in to
ZPublisher (typically via ZServer, but not always).  These threads are
*related* to the ZODB (as each one typically accesses it), but are not
ZODB threads (there is no such thing).

- C



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Re: Bump up the nr of ZOpe trhreads

2002-09-10 Thread Dario Lopez-Ksten

snip

Great, now I understand better. Thanks a lot! :-)

/dario




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Unit testing on win32 with FAT requires patch to custom_zodb.py,isthis a known issue?

2002-09-10 Thread Craeg K Strong

Hello:

I was just curious as to what the status is on this.
I just had to apply the patch to yet another Win2000 computer.
Thanks,

--Craeg

Shane Hathaway wrote:
 On Thu, 29 Aug 2002, Chris Withers wrote:
 
 
Shane Hathaway wrote:

No, this is not a known issue.  Could you provide a traceback?

Traceback (most recent call last):
   File testStripogram.py, line 103, in ?
 import Zope
   File D:\ZOPE\25228D~1.1\lib\python\Zope\__init__.py, line 40, in ?
 m=imp.load_module('Zope.custom_zodb', m[0], m[1], m[2])
   File D:\ZOPE\25228D~1.1\lib\python\Testing\custom_zodb.py, line 7, in ?
 Storage = DemoStorage(base=FileStorage(dfi, read_only=1), quota=(120))
   File D:\ZOPE\25228D~1.1\lib\python\ZODB\FileStorage.py, line 200, in __init_
_
 raise ValueError, can\'t create a read-only file
ValueError: can't create a read-only file
 
 
 Apparently the file Data.fs.in doesn't exist.  Why?  (Try adding print
 dfi to custom_zodb.py.)
 
 Shane



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Passing a Folder as a Parameter to a Script

2002-09-10 Thread Edward Pollard

Hello Folks,

A fairly straightfoward question. I'm trying to create some scripts that
allow the folder and file structure of the content to control dynamicly
the content of the menus that present said content.

In a directory are folders. These folders are the Menu Headings of the
content.
Beneath each Menu Heading are some links in a submenu determined by
the files within the associated folder.

If I call the submenu script explicitly in the correct context, it
generates the correct content. However the menu items should not be hard
coded so I want to pass the folder to the script which  generates the
submenu content. I have it all figured out except the parameter passing.

I have included the relevant part of the Page Template at the bottom.

The script menuWidget looks for folders in the current context. The
script subMenuWidget looks for Page Templates in the current context,
but needs to be modified to accept an ObjectManager object as a
parameter. (the items object from the menu repetition loop)

I've looked around, fidgeted, snooped, and guessed. No luck. I can't
seem to call it correctly. I believe I only need to add a parameter to
the script in the ZMI, and change these lines
div tal:define=submenu here/org/subMenuWidget.py tal:omit-tag=

(from the template)

submenuitems = context.objectValues('Page Template')
(from subMenuWidget.py)

For completeness I will include the code of subMenuWidget, but I doubt
its relevant to this semantic and syntactic question.

Thanks in Advance.

Edward

PS - if anyone has any good ideas on how to sort the collection of
ObjectManager objects based on the numeric content of the isRanked
comment, advice is appreciated.

From the Page Template:
---
div tal:define=menu here/menuWidget.py tal:omit-tag=
div tal:condition=menu tal:omit-tag=
div tal:repeat=items menu tal:omit-tag=
P/Pbfont color=#0033CCspan
tal:replace=items/title_or_idfolder id/span/font/bbr
font size=-1
div tal:define=submenu here/org/subMenuWidget.py tal:omit-tag=
 span tal:condition=submenu tal:omit-tag=
 span tal:repeat=subitems submenu tal:omit-tag=
  span tal:replace=subitems/title_or_idsubfolder/span
   /span
/span
 p tal:condition=not:submenubSubmenu Here/b/p
 /div
 /font
   p/p
/div
 /div
p tal:condition=not:menubMain Menu Here/b/p
   /div
---


content of subMenuWidget.py
---
submenuitems = context.objectValues('Page Template')
d1 = {}
returnitems = []
for eachItem in submenuitems:
   if eachItem.getProperty('isRanked',0):
  index = eachItem.getProperty('isRanked',1000)
  while d1.has_key(index):
 index = index + 1
  d1[index] = eachItem
keys = d1.keys()
keys.sort()
for key in keys:
   dictObject = d1[key]
   returnitems.append(dictObject)
return returnitems
-


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Correction: Previous Message Off-Topic, Disregard

2002-09-10 Thread Edward Pollard

Netscape was so kind as to direct my message to the entirely wrong
mailing list.

Humblest Apologies,

Edward


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )