1
我們有一個連接到GCSQL的谷歌應用程序引擎應用程序,我們在嘗試連接數據庫時遇到了很多DeadlineExceededError問題。 錯誤似乎是由很多用戶在短時間內打開應用程序所產生的。 當我們在此期間查看儀表板上的開放連接時,同時不會有超過45個打開的連接 ,並且它在查詢(閱讀,寫入和連接)的很大比例上失敗,花費太多時間去做吧。 由於這段時間,服務關閉,我們收到錯誤。DeadlineExceededError連接到Google Cloud SQL
錯誤例如:
Traceback (most recent call last):
File "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 223, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
return handler.dispatch()
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "/base/data/home/apps/s~ono-hat-prod/1.365115032772094991/onohatpreprod.py", line 5541, in post
cursor.execute("SELECT %s FROM actuaciones WHERE numero = '%s' " % (rc,idHat))
File "/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py", line 499, in execute
self._DoExec(request)
File "/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py", line 375, in _DoExec
response = self._conn.MakeRequest('Exec', request)
File "/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py", line 873, in MakeRequest
response = self._MakeRetriableRequest(stub_method, request)
File "/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py", line 897, in _MakeRetriableRequest
response = self.MakeRequestImpl(stub_method, request)
File "/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms_apiproxy.py", line 67, in MakeRequestImpl
except apiproxy_errors.ApplicationError, e:
DeadlineExceededError
的一段代碼,直到發生錯誤:
class detalleActuacion(webapp2.RequestHandler):
def post(self):
idHat = self.request.get('id')
logging.info(idHat)
num_conexiones = 0
num_cierres = 0
conn = rdbms.connect(instance=_INSTANCE_NAME, database='Actuaciones')
num_conexiones = num_conexiones + 1
cursor = conn.cursor()
dict_act = {}
request_cad = 'solucionado,duracion,numero,fecha_inicio_ventana,fecha_fin_ventana,'
request_cad = request_cad+'tipo,titulo,tipo_cliente,ubicacion,zona_regional,'
request_cad = request_cad+'zona_local,ciudad_ticket,zona_regional_subticket,zona_local_subticket,'
request_cad = request_cad+'zona_local_ticket,skill,num_recursos,num_actuaciones,ubi_emplaz,'
request_cad = request_cad+'ubi_provincia,ubi_lat,ubi_long,ubi_via,ubi_calle,ubi_numero,ubi_adic,'
request_cad = request_cad+'ubi_CP,miga_terminal,miga_tlf,miga_dir,severidad,prioridad,serv_CATV,'
request_cad = request_cad+'serv_datos,serv_DTV,serv_empresa,serv_telefonia,instr,num_rep,'
rc = request_cad+'fecha_creac,fecha_creac_tp,fecha_sol,fecha_sol_tp,fecha_cierre,fecha_cierre_tp,'
rc = rc+'fecha_inicio,fecha_fin,descr_adic,descr_log,grupo_pos,accion,cola,estado,estado_ticket,'
rc=rc+'doc_adj,detalle_equipos,tarea,subtarea,subzona,TIR,elem_red,descripcion,num_afectados,'
rc=rc+'repeticion,fecha_repeticion,dias_repeticion,dias_semana,fin_repeticion,cl_afectados,'
rc=rc+'plan_tp,marca_seguimiento,tipificacion,miga,zona,bandeja,alerta,descr_log1,descr_log2,descr_log3,descr_log4,descr_log5,descr_log6,descr_log7,descr_log8,descr_log9,'
rc=rc+'elem_red_2,estado_CRM,tecnico,tecnico2,tecnico3,tecnico4,tecnico5,num_asignaciones,ultima_modificacion,tiempo_proceso,fecha_inicio_real,fecha_fin_real'
rc=rc+',observaciones1,observaciones2,observaciones3,observaciones4,observaciones5,observaciones6,observaciones7,observaciones8,observaciones9,observaciones10'
cursor = conn.cursor()
cursor.execute("SELECT %s FROM actuaciones WHERE numero = '%s' " % (rc,idHat))
預先感謝您的協助。