Re: DB.open() has 9 open connections with a pool_size of 7 with ZEO

Jim Fulton <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAPDm-Fg4CCe9ErFtzTJ4CFAjCWf=n57qerSPaxDX8znpM3v06g@mail.gmail.com>
On Tue, Nov 15, 2016 at 3:41 PM, Boylan, Ross <[email protected]> wrote:

> I got the warning in the subject line for a DB created with
> dbname = "./zeotalk"
> db = ZEO.DB(dbname)
>

Rather than using the shortcut form for creating the database, you'll need
to create the storage and then create the database:

  storage = ZEO.client(dbname)
  db = ZODB.DB(storage, pool_size=nThreads+2)

BTW, what you're referring to as dbname is really the server address.

Jim


> I have multiple threads (not processes) opening connections against the
> shared db.
>
> http://www.zodb.org/en/latest/reference/zodb.html#databases shows DB
> takes a pool_size argument,
> so I tried
> db = ZEO.DB(dbname, pool_size=nThreads+2)
> resulting in
>   File "./tng.py", line 17, in <module>
>     db = ZEO.DB(dbname, pool_size=nThreads+2)
>   File "/home/ross/.local/lib/python3.4/site-packages/ZEO-5.
> 0.1-py3.4.egg/ZEO/__init__.py", line 29, in DB
>     s = client(*args, **kw)
>   File "/home/ross/.local/lib/python3.4/site-packages/ZEO-5.
> 0.1-py3.4.egg/ZEO/__init__.py", line 26, in client
>     return ZEO.ClientStorage.ClientStorage(*args, **kw)
> TypeError: __init__() got an unexpected keyword argument 'pool_size'
>
> Looking around in the ZEO source, __init__.py has
> def client(*args, **kw):
>     import ZEO.ClientStorage
>     return ZEO.ClientStorage.ClientStorage(*args, **kw)
>
> def DB(*args, **kw):
>     s = client(*args, **kw)
>     try:
>         import ZODB
>         return ZODB.DB(s)
>     except Exception:
>         s.close()
>         raise
> and ClientStorage.__init__ does not have a pool_size argument.
>
> I guess I could do a version of the DB function defined above that allowed
> me to pass parameters to the ZODB.DB method.  Is that the right approach?
> Should I be setting something when I start the ZEO server?
>
> Thanks.
> Ross
>
> --
> You received this message because you are subscribed to the Google Groups
> "zodb" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jim Fulton
http://jimfulton.info

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.