← Back to team overview

openstack team mailing list archive

Re: eventlet weirdness

 

Someone might have already said this (sure wish the listserv sent me mail faster), but we tried out PyMysql and it was exceptionally slow, even under almost no load.

I have a branch in my github that I was using to test out unblocking the database access. For my cases I found that it was unblocked but that it didn't really help performance as much as I had hoped.

branch: https://github.com/markwash/nova/tree/optional-db-api-thread-no-pool

just the relevant commit: https://github.com/markwash/nova/commit/99e38d3df579670808711eb8acd1f96806d8b6f0

"Vishvananda Ishaya" <vishvananda@xxxxxxxxx> said:

> Yes it does.  We actually tried to use a pool at diablo release and it was very
> broken. There was discussion about moving over to a pure-python mysql library, but
> it hasn't been tried yet.
> 
> Vish
> 
> On Mar 1, 2012, at 11:45 AM, Yun Mao wrote:
> 
>> There are plenty eventlet discussion recently but I'll stick my
>> question to this thread, although it's pretty much a separate
>> question. :)
>>
>> How is MySQL access handled in eventlet? Presumably it's external C
>> library so it's not going to be monkey patched. Does that make every
>> db access call a blocking call? Thanks,
>>
>> Yun
>>
>> On Wed, Feb 29, 2012 at 9:18 PM, Johannes Erdfelt <johannes@xxxxxxxxxxx> wrote:
>>> On Wed, Feb 29, 2012, Yun Mao <yunmao@xxxxxxxxx> wrote:
>>>> Thanks for the explanation. Let me see if I understand this.
>>>>
>>>> 1. Eventlet will never have this problem if there is only 1 OS thread
>>>> -- let's call it main thread.
>>>
>>> In fact, that's exactly what Python calls it :)
>>>
>>>> 2. In Nova, there is only 1 OS thread unless you use xenapi and/or the
>>>> virt/firewall driver.
>>>> 3. The python logging module uses locks. Because of the monkey patch,
>>>> those locks are actually eventlet or "green" locks and may trigger a
>>>> green thread context switch.
>>>>
>>>> Based on 1-3, does it make sense to say that in the other OS threads
>>>> (i.e. not main thread), if logging (plus other pure python library
>>>> code involving locking) is never used, and we do not run a eventlet
>>>> hub at all, we should never see this problem?
>>>
>>> That should be correct. I'd have to double check all of the monkey
>>> patching that eventlet does to make sure there aren't other cases where
>>> you may inadvertently use eventlet primitives across real threads.
>>>
>>> JE
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~openstack
>>> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~openstack
>>> More help   : https://help.launchpad.net/ListHelp
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~openstack
>> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~openstack
>> More help   : https://help.launchpad.net/ListHelp
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp
> 




References