[openstack-dev] Keystone handling http requests synchronously

Jay Pipes jaypipes at gmail.com
Mon Mar 25 13:39:52 UTC 2013


On 03/25/2013 03:19 AM, Kanade, Rohan wrote:
>>Because the mysql client connection is C-based, calls to it will be
>>blocking operations on greenthreads within a single process, meaning
>>even if multiple greenthreads are spawned for those 200 incoming
>>requests, they will be processed synchronously.
> 
> Hi Jay, can you please specify what methods in the sqlalchemy library
> are blocking the greenthreads in a single process?
> If i call get_session multiple times during an http api request (say
> create_user), does it block all greenthreads on each get_session[1]? Or
> does the session.commit, session.begin, or session.rollback methods
> block all greenthreads?

It's actually not the SQLAlchemy library at all... it's the fact that
all greenthreads in the same process share a single linked external C
library and eventlet cannot monkey-patch the blocking calls in the mysql
library in order to make them non-blocking. See here for more details:

http://docs.openstack.org/developer/nova/devref/threading.html

Best,
-jay



More information about the OpenStack-dev mailing list