class Options(**kwoptions)[source]#

Bases: object

Options for configuring and tuning RelStorage.

These parameters can be provided as keyword options in the RelStorage constructor. For example:

storage = RelStorage(adapter, pack_gc=True, pack_prepack_only=True)

Alternatively, the RelStorage constructor accepts an options parameter, which should be an Options instance.

Changed in version 3.0: No longer accepts the poll_interval option.

Changed in version 2.0b2: The poll_interval option is now ignored and raises a warning. It is always effectively 0.

Changed in version 2.0b7: The cache_delta_size_limit grew to 20000 on CPython.

Changed in version 3.0a7: Add the blob_cache_size_check_external option, defaulting to False.

Change the default for shared_blob_dir to False.

Changed in version 3.3.3: Since packing no longer holds the commit lock, pack_batch_timeout is the interval between committing deletions. Changed from 1.0s to 15s. Note that this is not universally applied.


Produce a copy of these options, with keyword arguments overriding.

classmethod copy_valid_options(other_options)[source]#

Produce a new options featuring only the valid settings from other_options.


Produce a copy of these options, with keyword arguments overriding.

adapter = None#

The adapter factory configuration.

blob_cache_size = None#

How much local blob data to keep

blob_cache_size_check = 10#

Percentage of blob_cache_size; when any individual storage instance has written this many bytes of data into the blob cache, launch a cleanup process.

blob_cache_size_check_external = False#

Run the cache size check in an external process?

blob_chunk_size = 1048576#

The size to break blobs into for storage. Only applies to some databases.

blob_dir = None#

directory to hold blobs

cache_delta_size_limit = 100000#

Switch checkpoints after this many writes

cache_local_compression = 'none'#

How to compress local pickles

cache_local_dir = None#

Directory holding persistent cache files

cache_local_dir_compress = None#

Compress the cache files?

cache_local_dir_count = None#

How many persistent cache files to keep

cache_local_dir_read_count = None#

How many persistent cache files to read

cache_local_dir_write_max_size = None#

How big a cache file can be

cache_local_mb = 10#

How much memory to use for the pickle cache

cache_local_object_max = 16384#

The largest pickle to hold in the pickle cache

cache_module_name = 'relstorage.pylibmc_wrapper'#

Module to wrap a memcache connection with.

cache_prefix = ''#

Database-specific prefix key

cache_servers = ()#

List of memcache servers

commit_lock_id = 0#

Lock ID for Oracle

commit_lock_timeout = 30#

How long to wait for a commit lock, in seconds.

create_schema = True#

Automatically create the schema if needed

driver = 'auto'#

Which database driver to use

keep_history = True#

Preserve history?

name = None#

The name

pack_batch_timeout = 15.0#

Amount of time between commits/log messages.

pack_commit_busy_delay = 5.0#

How long to pause if we can’t get the lock.

..versionchanged:: 3.0a5

Deprecated and unused.

pack_gc = True#

Perform a GC when packing

pack_prepack_only = False#

Only prepack

pack_skip_prepack = False#

Skip prepack

read_only = False#

Read only?

replica_conf = None#

File containing replica info

replica_timeout = 600.0#


revert_when_stale = False#

Specifies what to do when a database connection is stale.

ro_replica_conf = None#

File containing read-only replica info

shared_blob_dir = False#

Is the blob directory shared?


Should committing exit the critical section (supported under gevent only) early? Here, early means before taking the final global database commit lock. Only applies to databases and drivers that can do this (take the lock and commit) in a single round trip to the database. The default is yes. However, if you have many committing processes at the same time, setting it to false may prevent a thundering herd effect.