Ask Your Question
0

Why Glance spend a long time connecting to MySQL?

asked 2013-04-08 04:01:15 -0500

smallma gravatar image

updated 2013-04-08 04:15:30 -0500

Hello ,

We're using glance 2012.1+stable~20120608-5462295-0ubuntu2.2. We got a info as 'Lost connect to MySQL server during query' and glance spend 17 minutes to wait the response. is there any solution for shortened time? The following section is error message. Thanks.

-- Error Message:

2013-04-08 10:52:19 24193 DEBUG [routes.middleware] Match dict: {'action': u'show', 'controller': <glance.common.wsgi.resource object="" at="" 0x2f5dd10="">, 'id': u'test'}

2013-04-08 11:09:57 24193 WARNING [glance.registry.db.api] Got mysql server has gone away: (2013, 'Lost connection to MySQL server during query')

2013-04-08 11:09:57 24193 DEBUG [eventlet.wsgi.server] Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 382, in handleoneresponse result = self.application(self.environ, start_response)

File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in call resp = self.call_func(req, args, *self.kwargs)

File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 210, in call_func return self.func(req, args, *kwargs)

File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 279, in call response = req.get_response(self.application)

File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1086, in getresponse application, catchexc_info=False)

File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1055, in callapplication appiter = application(self.environ, start_response)

File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in call return resp(environ, start_response)

File "/usr/lib/pymodules/python2.7/routes/middleware.py", line 131, in call response = self.app(environ, start_response)

File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in call return resp(environ, start_response)

File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in call resp = self.call_func(req, args, *self.kwargs)

File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 210, in call_func return self.func(req, args, *kwargs)

File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 477, in call request, **action_args)

File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 494, in dispatch return method(args, *kwargs)

File "/usr/lib/python2.7/dist-packages/glance/registry/api/v1/images.py", line 274, in show image = dbapi.imageget(req.context, id)

File "/usr/lib/python2.7/dist-packages/glance/registry/db/api.py", line 287, in image_get image = query.one()

File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2184, in one ret = list(self)

File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2227, in iter return self.executeand_instances(context)

File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2240, in executeandinstances closewith_result=True)

File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2231, in connectionfrom_session **kw)

File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 730, in connection closewithresult=closewithresult)

File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 736, in connectionforbind ... (more)

edit retag flag offensive close merge delete

Comments

Are any of your other services having the same problem keeping a MySQL connection open?

briancline gravatar imagebriancline ( 2013-04-10 10:24:33 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-06-12 00:33:34 -0500

pallab gravatar image

When I am trying to create the image in glance I am facing the below problem. Please help.

root@01HW448838:/home/test# glance image-create --location /home/test/ubuntu-12.04-server-cloudimg-amd64-disk1.img --is-public true --disk-format qcow2 --container-format bare --name "Ubuntu" Error communicating with /v1/images: timed out

Thanks in advance. :)

edit flag offensive delete link more
0

answered 2013-04-11 06:17:47 -0500

Hi!

There are 2 configuration variable sthat you might be interested in:

The first is sql_max_retries, which defines the number of times sqlalchemy will try to connect to the database. The second one is sql_retry_interval, which defines the seconds sqlalchemy will wait before retrying a connection.

The default values for those variables are 60 and 1 which means it will retry to connect 60 times with an interval of 1 second between each.

Also, what is the value of sql_idle_timeout ? This parameter defines the maximum time (in seconds) a connection will live before it is recycled.

  • Did you modify those parameters?
  • Are you having the same issue in other services? From your error, my guess is that Mysql is not reachable when that happens.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2013-04-08 04:01:15 -0500

Seen: 469 times

Last updated: Jun 12 '13