[openstack-dev] [all] Replace mysql-python with mysqlclient
Mike Bayer
mbayer at redhat.com
Thu Apr 30 17:54:13 UTC 2015
On 4/30/15 11:16 AM, Dan Smith wrote:
>> There is an open discussion to replace mysql-python with PyMySQL, but
>> PyMySQL has worse performance:
>>
>> https://wiki.openstack.org/wiki/PyMySQL_evaluation
> My major concern with not moving to something different (i.e. not based
> on the C library) is the threading problem. Especially as we move in the
> direction of cellsv2 in nova, not blocking the process while waiting for
> a reply from mysql is going to be critical. Further, I think that we're
> likely to get back a lot of performance from a supports-eventlet
> database connection because of the parallelism that conductor currently
> can only provide in exchange for the footprint of forking into lots of
> workers.
>
> If we're going to move, shouldn't we be looking at something that
> supports our threading model?
yes, but at the same time, we should change our threading model at the
level of where APIs are accessed to refer to a database, at the very
least using a threadpool behind eventlet. CRUD-oriented database
access is faster using traditional threads, even in Python, than using
an eventlet-like system or using explicit async. The tests at
http://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/
show this. With traditional threads, we can stay on the C-based MySQL
APIs and take full advantage of their speed.
More information about the OpenStack-dev
mailing list