From 5a173eb6643086c9888d477edcbcdb9dd4fd9814 Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Wed, 6 Jul 2016 16:03:00 +0800 Subject: [PATCH] Adjust MySQL access with eventlet PyMySQL works well with eventlet[1], and it's the default MySQL DB API driver for oslo.db now[2]. So we need adjust the statement. [1]https://wiki.openstack.org/wiki/PyMySQL_evaluation [2]http://docs.openstack.org/developer/oslo.db/installation.html Change-Id: Ib9b0bb9427dd34abbda25a0c91e9832743c6fc08 --- doc/source/threading.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/source/threading.rst b/doc/source/threading.rst index 8fbc973172ed..3836ff610c99 100644 --- a/doc/source/threading.rst +++ b/doc/source/threading.rst @@ -38,10 +38,11 @@ contributors use ``greenthread.sleep()`` instead of ``time.sleep()``. MySQL access and eventlet ------------------------- -Queries to the MySQL database will block the main thread of a service. This is -because OpenStack services use an external C library for accessing the MySQL -database. Since eventlet cannot use monkey-patching to intercept blocking -calls in a C library, the resulting database query blocks the thread. +There are some MySQL DB API drivers for oslo.db, like `PyMySQL`_, MySQL-python +etc. PyMySQL is the default MySQL DB API driver for oslo.db, and it works well with +eventlet. MySQL-python uses an external C library for accessing the MySQL database. +Since eventlet cannot use monkey-patching to intercept blocking calls in a C library, +so queries to the MySQL database will block the main thread of a service. The Diablo release contained a thread-pooling implementation that did not block, but this implementation resulted in a `bug`_ and was removed. @@ -52,3 +53,4 @@ a discussion of the `impact on performance`_. .. _bug: https://bugs.launchpad.net/nova/+bug/838581 .. _mailing list thread: https://lists.launchpad.net/openstack/msg08118.html .. _impact on performance: https://lists.launchpad.net/openstack/msg08217.html +.. _PyMySQL: https://wiki.openstack.org/wiki/PyMySQL_evaluation