Installation docs [skip ci]
This commit is contained in:
parent
c081f272f4
commit
a1730bbdf8
|
@ -54,37 +54,55 @@ The MySQL adapter accepts most parameters supported by the mysqlclient
|
|||
library (the maintained version of MySQL-python), including:
|
||||
|
||||
driver
|
||||
Either "MySQLdb" (which can either by ``mysqlclient`` or
|
||||
``MySQL-python``), or "PyMySQL", or "umysqldb".
|
||||
Either "MySQLdb" (which can be provided by the either of the
|
||||
PyPI distributions `mysqlclient
|
||||
<https://pypi.python.org/pypi/mysqlclient>`_ or `MySQL-python
|
||||
<https://pypi.python.org/pypi/MySQL-python/>`_), or "PyMySQL", or
|
||||
"umysqldb".
|
||||
|
||||
host
|
||||
string, host to connect
|
||||
|
||||
user
|
||||
string, user to connect as
|
||||
|
||||
passwd
|
||||
string, password to use
|
||||
|
||||
db
|
||||
string, database to use
|
||||
|
||||
port
|
||||
integer, TCP/IP port to connect to
|
||||
|
||||
unix_socket
|
||||
string, location of unix_socket (UNIX-ish only)
|
||||
|
||||
conv
|
||||
mapping, maps MySQL FIELD_TYPE.* to Python functions which convert a
|
||||
string to the appropriate Python type
|
||||
|
||||
connect_timeout
|
||||
number of seconds to wait before the connection attempt fails.
|
||||
|
||||
compress
|
||||
if set, gzip compression is enabled
|
||||
|
||||
named_pipe
|
||||
if set, connect to server via named pipe (Windows only)
|
||||
|
||||
init_command
|
||||
command which is run once the connection is created
|
||||
|
||||
read_default_file
|
||||
see the MySQL documentation for mysql_options()
|
||||
|
||||
read_default_group
|
||||
see the MySQL documentation for mysql_options()
|
||||
|
||||
client_flag
|
||||
client flags from MySQLdb.constants.CLIENT
|
||||
|
||||
load_infile
|
||||
int, non-zero enables LOAD LOCAL INFILE, zero disables
|
||||
|
||||
|
@ -95,10 +113,13 @@ The Oracle adapter accepts:
|
|||
|
||||
driver
|
||||
Other than "auto" the only supported value is "cx_Oracle".
|
||||
|
||||
user
|
||||
The Oracle account name
|
||||
|
||||
password
|
||||
The Oracle account password
|
||||
|
||||
dsn
|
||||
The Oracle data source name. The Oracle client library will
|
||||
normally expect to find the DSN in ``/etc/oratab``.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _caching-checkpoints:
|
||||
|
||||
==========================
|
||||
Caching with checkpoints
|
||||
==========================
|
||||
|
|
|
@ -2,21 +2,23 @@
|
|||
Installation
|
||||
==============
|
||||
|
||||
RelStorage 1.7 is supported on Python 2.7, Python 3.4 and 3.5, and PyPy2.
|
||||
RelStorage 2.0 is supported on Python 2.7, Python 3.4, 3.5 and 3.6,
|
||||
and PyPy2 5.4.1 or later.
|
||||
|
||||
You can install RelStorage using pip::
|
||||
|
||||
pip install RelStorage
|
||||
|
||||
Installing CFFI (and a functioning compiler) is also recommended::
|
||||
|
||||
pip install cffi
|
||||
If you use a recent version of pip to install RelStorage on a
|
||||
supported platform (OS X, Windows or "manylinx"), you can get a
|
||||
pre-built binary wheel. If you install from source or on a different
|
||||
platform, you will need to have a functioning C compiler.
|
||||
|
||||
RelStorage requires a modern version of ZODB; it is tested with ZODB
|
||||
4.3 but *might* work with ZODB as old as 3.10. If you need to use an
|
||||
older version of ZODB, install RelStorage 1.6.0. Likewise, if you need
|
||||
Python 2.6 support, install RelStorage 1.6.0 (note that 1.6.0 *does
|
||||
not* run on Python 3 or PyPy).
|
||||
4.3 and 5.0 but *might* work with ZODB as old as 3.10. If you need to
|
||||
use an older version of ZODB, install RelStorage 1.6. Likewise, if
|
||||
you need Python 2.6 support, install RelStorage 1.6 (note that 1.6
|
||||
*does not* run on Python 3 or PyPy).
|
||||
|
||||
Database Adapter
|
||||
================
|
||||
|
@ -52,7 +54,7 @@ Platform MySQL PostgreSQL Oracle
|
|||
CPython2 MySQL-python; **psycopg2**; **cx_Oracle**
|
||||
**mysqlclient**; psycopg2cffi;
|
||||
*PyMySQL*; *pg8000*
|
||||
umysql
|
||||
umysqldb
|
||||
CPython3 **mysqlclient**; **psycopg2**; **cx_Oracle**
|
||||
*PyMySQL* *pg8000*
|
||||
PyPy **PyMySQL** **psycopg2cffi**;
|
||||
|
@ -64,6 +66,16 @@ PyPy **PyMySQL** **psycopg2cffi**;
|
|||
make sure that RelStorage's ``blob-chunk-size`` is less than
|
||||
16MB as well.
|
||||
|
||||
.. note:: `This fork of umysqldb
|
||||
<https://github.com/NextThought/umysqldb.git>`_ is
|
||||
recommended. The ``full-buffer`` branch of `this ultramysql
|
||||
fork
|
||||
<https://github.com/NextThought/ultramysql/tree/full-buffer>`_
|
||||
is also recommended if you encounter strange MySQL packet
|
||||
errors.
|
||||
|
||||
mysqlclient, pg8000 and umysql are compatible (cooperative) with gevent.
|
||||
|
||||
Memcache Integration
|
||||
====================
|
||||
|
||||
|
@ -72,7 +84,7 @@ RelStorage clients, you'll need to install either `pylibmc
|
|||
<https://pypi.python.org/pypi/pylibmc>`_ (C based, requires Memcache
|
||||
development libraries and CPython) or `python-memcached
|
||||
<https://pypi.python.org/pypi/python-memcached>`_ (pure-Python, works
|
||||
on CPython and PyPy).
|
||||
on CPython and PyPy, compatible with gevent).
|
||||
|
||||
|
||||
Once RelStorage is installed, it's time to :doc:`configure the database <configure-database>`
|
||||
|
|
|
@ -336,8 +336,8 @@ cache-local-compression
|
|||
.. versionadded:: 1.6
|
||||
|
||||
cache-delta-size-limit
|
||||
This is an advanced option. RelStorage uses a system of
|
||||
checkpoints to improve the cache hit rate. This option
|
||||
This is an advanced option. RelStorage uses :ref:`a system of
|
||||
checkpoints <caching-checkpoints>` to improve the cache hit rate. This option
|
||||
configures how many new objects should be stored before creating a
|
||||
new checkpoint.
|
||||
|
||||
|
@ -347,6 +347,11 @@ cache-delta-size-limit
|
|||
|
||||
The default is 20000 on CPython, 10000 on PyPy.
|
||||
|
||||
.. versionchanged:: 2.0b7
|
||||
Double the default size from 10000 to 20000 on CPython. The
|
||||
use of LLBTree for the internal data structure means we use
|
||||
much less memory than we did before.
|
||||
|
||||
Persistent Local Caching
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -31,40 +31,76 @@ class Options(object):
|
|||
.. versionchanged:: 2.0b2
|
||||
The `poll_interval` option is now ignored and raises a warning. It is always
|
||||
effectively 0.
|
||||
|
||||
.. versionchanged:: 2.0b7
|
||||
The ``cache_delta_size_limit`` grew to 20000 on CPython.
|
||||
"""
|
||||
|
||||
#: The name
|
||||
name = None
|
||||
#: Read only?
|
||||
read_only = False
|
||||
#: directory to hold blobs
|
||||
blob_dir = None
|
||||
#: Is the blob directory shared?
|
||||
shared_blob_dir = True
|
||||
#: How much local blob data to keep
|
||||
blob_cache_size = None
|
||||
#: ?
|
||||
blob_cache_size_check = 10
|
||||
#: The size to break blobs into for storage
|
||||
blob_chunk_size = 1 << 20
|
||||
#: Preserve history?
|
||||
keep_history = True
|
||||
#: File containing replica info
|
||||
replica_conf = None
|
||||
#: File containing read-only replica info
|
||||
ro_replica_conf = None
|
||||
#: ?
|
||||
replica_timeout = 600.0
|
||||
#: Specifies what to do when a database connection is stale.
|
||||
revert_when_stale = False
|
||||
#: Perform a GC when packing
|
||||
pack_gc = True
|
||||
#: Only prepack
|
||||
pack_prepack_only = False
|
||||
#: Skip prepack
|
||||
pack_skip_prepack = False
|
||||
#: Length of time to hold a lock.
|
||||
pack_batch_timeout = 1.0
|
||||
#: How long to pause if we can't get the lock
|
||||
pack_commit_busy_delay = 5.0
|
||||
#: List of memcache servers
|
||||
cache_servers = () # ['127.0.0.1:11211']
|
||||
#: Module to wrap a memcache connection with.
|
||||
cache_module_name = 'relstorage.pylibmc_wrapper'
|
||||
#: Database-specific prefix key
|
||||
cache_prefix = ''
|
||||
#: How much memory to use for the pickle cache
|
||||
cache_local_mb = 10
|
||||
#: The largest pickle to hold in the pickle cache
|
||||
cache_local_object_max = 16384
|
||||
#: How to compress local pickles
|
||||
cache_local_compression = 'zlib'
|
||||
#: Directory holding persistent cache files
|
||||
cache_local_dir = None
|
||||
#: How many persistent cache files to keep
|
||||
cache_local_dir_count = 20
|
||||
#: How many persistent cache files to read
|
||||
cache_local_dir_read_count = None
|
||||
#: How big a cache file can be
|
||||
cache_local_dir_write_max_size = None
|
||||
#: Compress the cache files?
|
||||
cache_local_dir_compress = False
|
||||
#: Switch checkpoints after this many writes
|
||||
cache_delta_size_limit = 20000 if not PYPY else 10000
|
||||
#: How long to wait for a commit lock
|
||||
commit_lock_timeout = 30
|
||||
#: Lock ID for Oracle
|
||||
commit_lock_id = 0
|
||||
#: Automatically create the schema if needed
|
||||
create_schema = True
|
||||
#: Which database driver to use
|
||||
driver = 'auto'
|
||||
|
||||
# If share_local_cache is off, each storage instance has a private
|
||||
|
|
Loading…
Reference in New Issue