Skip to content

Loading…

fix DictDB default size limit #2997

Merged
merged 2 commits into from

1 participant

@minrk
IPython member

typo had the default size as 1MB, not the intended 1GB.
Also fix its exclusion from generated config.

minrk added some commits
@minrk minrk fix typo in DictDB.size_limit
limit meant to be 1GB, but typo made it 1MB
73ccb72
@minrk minrk add DictDB to autogenerated config / help
for cull fraction, etc.
d486747
@minrk minrk merged commit cb4547a into ipython:master

1 check passed

Details default The Travis build passed
@minrk minrk deleted the minrk:db_limit branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2013
  1. @minrk

    fix typo in DictDB.size_limit

    minrk committed
    limit meant to be 1GB, but typo made it 1MB
  2. @minrk

    add DictDB to autogenerated config / help

    minrk committed
    for cull fraction, etc.
Showing with 16 additions and 6 deletions.
  1. +14 −5 IPython/parallel/apps/ipcontrollerapp.py
  2. +2 −1 IPython/parallel/controller/dictdb.py
View
19 IPython/parallel/apps/ipcontrollerapp.py
@@ -54,18 +54,27 @@
from IPython.parallel.controller.heartmonitor import HeartMonitor
from IPython.parallel.controller.hub import HubFactory
from IPython.parallel.controller.scheduler import TaskScheduler,launch_scheduler
-from IPython.parallel.controller.sqlitedb import SQLiteDB
+from IPython.parallel.controller.dictdb import DictDB
from IPython.parallel.util import split_url, disambiguate_url
-# conditional import of MongoDB backend class
+# conditional import of SQLiteDB / MongoDB backend class
+real_dbs = []
+
+try:
+ from IPython.parallel.controller.sqlitedb import SQLiteDB
+except ImportError:
+ pass
+else:
+ real_dbs.append(SQLiteDB)
try:
from IPython.parallel.controller.mongodb import MongoDB
except ImportError:
- maybe_mongo = []
+ pass
else:
- maybe_mongo = [MongoDB]
+ real_dbs.append(MongoDB)
+
#-----------------------------------------------------------------------------
@@ -148,7 +157,7 @@ class IPControllerApp(BaseParallelApplication):
description = _description
examples = _examples
config_file_name = Unicode(default_config_file_name)
- classes = [ProfileDir, Session, HubFactory, TaskScheduler, HeartMonitor, SQLiteDB] + maybe_mongo
+ classes = [ProfileDir, Session, HubFactory, TaskScheduler, HeartMonitor, DictDB] + real_dbs
# change default to True
auto_create = Bool(True, config=True,
View
3 IPython/parallel/controller/dictdb.py
@@ -103,11 +103,12 @@ class DictDB(BaseDB):
_culled_ids = set() # set of ids which have been culled
_buffer_bytes = Integer(0) # running total of the bytes in the DB
- size_limit = Integer(1024*1024, config=True,
+ size_limit = Integer(1024**3, config=True,
help="""The maximum total size (in bytes) of the buffers stored in the db
When the db exceeds this size, the oldest records will be culled until
the total size is under size_limit * (1-cull_fraction).
+ default: 1 GB
"""
)
record_limit = Integer(1024, config=True,
Something went wrong with that request. Please try again.