SOAP v2 WS-I 호출이 너무 느린 이유는 무엇입니까 (제품 업데이트 당 7-10 초)?


16

우리는 WS-I와 함께 Magento SOAP v2 API를 사용하고 있습니다.

문제는 SOAP 호출이 매우 느리다는 것입니다 (제품 당 7-10 초!). 이미지없이 catalogProductUpdate를 호출합니다. 상점 자체는 잘 작동하지만 SOAP 호출은 느립니다. 캐시를 활성화하고 성능 향상 (SOAP 가져 오기가 느 렸을 때 다른 많은 상점에 도움이 됨)을 위해 색인을 해제했습니다.

로그 파일을 다양한 파일에 넣어서 어디에서 오류가 발생했는지 확인했습니다. 이것은 함수 호출 및 디스패치 이벤트의 조합 로그입니다.

20.03.2013 14:17:43: Mage_Api_V2_SoapController
20.03.2013 14:17:43: dispatchEvent: controller_action_postdispatch_api_v2_soap_index
20.03.2013 14:17:43: dispatchEvent: controller_action_postdispatch_api
20.03.2013 14:17:43: dispatchEvent: controller_action_postdispatch
20.03.2013 14:17:43: dispatchEvent: controller_front_send_response_before
20.03.2013 14:17:43: dispatchEvent: http_response_send_before
20.03.2013 14:17:43: dispatchEvent: controller_front_send_response_after
20.03.2013 14:17:43: Mage::run
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: core_collection_abstract_load_before
20.03.2013 14:17:51: dispatchEvent: core_collection_abstract_load_after
20.03.2013 14:17:51: dispatchEvent: core_collection_abstract_load_before
20.03.2013 14:17:51: dispatchEvent: core_collection_abstract_load_after
20.03.2013 14:17:51: dispatchEvent: core_collection_abstract_load_before
20.03.2013 14:17:51: dispatchEvent: core_collection_abstract_load_after
20.03.2013 14:17:51: dispatchEvent: controller_front_init_before
20.03.2013 14:17:51: dispatchEvent: controller_front_init_routers
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: model_load_after
20.03.2013 14:17:51: dispatchEvent: core_abstract_load_after
20.03.2013 14:17:51: Mage_Core_Controller_Varien_Front
20.03.2013 14:17:51: Mage_Core_Controller_Varien_Front
20.03.2013 14:17:51: Mage_Core_Controller_Varien_Router_Standard
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: core_locale_set_locale
20.03.2013 14:17:51: dispatchEvent: controller_action_predispatch
20.03.2013 14:17:51: dispatchEvent: controller_action_predispatch_api
20.03.2013 14:17:51: dispatchEvent: controller_action_predispatch_api_v2_soap_index
20.03.2013 14:17:51: Mage_Core_Controller_Varien_Action
20.03.2013 14:17:51: Mage_Api_Model_Server
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: Mage_Api_Model_Server_Handler_Abstract
20.03.2013 14:17:51: Neues Update: 2110000438920 
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: model_load_after
20.03.2013 14:17:51: dispatchEvent: core_abstract_load_after
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: model_load_before
20.03.2013 14:17:51: dispatchEvent: catalog_product_load_before
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: model_load_after
20.03.2013 14:17:51: dispatchEvent: catalog_product_load_after
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: prepareDataForSave Dauer: 0.75447800 1363789071-0.77473800 1363789071=0.02026
20.03.2013 14:17:51: dispatchEvent: catalog_product_validate_before
20.03.2013 14:17:51: dispatchEvent: catalog_product_validate_after
20.03.2013 14:17:51: dispatchEvent: application_clean_cache
20.03.2013 14:17:51: dispatchEvent: model_save_before
20.03.2013 14:17:51: dispatchEvent: catalog_product_save_before
20.03.2013 14:17:51: dispatchEvent: model_load_after
20.03.2013 14:17:51: dispatchEvent: core_abstract_load_after
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: catalog_product_media_save_before
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
20.03.2013 14:17:51: dispatchEvent: application_clean_cache
20.03.2013 14:17:51: dispatchEvent: model_save_after
20.03.2013 14:17:51: dispatchEvent: catalog_product_save_after
20.03.2013 14:17:51: dispatchEvent: model_save_after
20.03.2013 14:17:52: dispatchEvent: cataloginventory_stock_item_save_after
20.03.2013 14:17:52: dispatchEvent: resource_get_tablename
20.03.2013 14:17:52: dispatchEvent: core_collection_abstract_load_before
20.03.2013 14:17:52: dispatchEvent: core_collection_abstract_load_after
20.03.2013 14:17:52: dispatchEvent: resource_get_tablename
20.03.2013 14:17:52: dispatchEvent: model_load_before
20.03.2013 14:17:52: dispatchEvent: core_abstract_load_before
20.03.2013 14:17:52: dispatchEvent: resource_get_tablename
20.03.2013 14:17:52: dispatchEvent: model_load_after
20.03.2013 14:17:52: dispatchEvent: core_abstract_load_after
20.03.2013 14:17:52: dispatchEvent: start_process_event_cataloginventory_stock_item_save
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: model_save_before
20.03.2013 14:17:52: dispatchEvent: core_abstract_save_before
20.03.2013 14:17:52: dispatchEvent: resource_get_tablename
20.03.2013 14:17:52: dispatchEvent: resource_get_tablename
20.03.2013 14:17:52: dispatchEvent: model_save_after
20.03.2013 14:17:52: dispatchEvent: core_abstract_save_after
20.03.2013 14:17:52: dispatchEvent: end_process_event_cataloginventory_stock_item_save
20.03.2013 14:17:52: dispatchEvent: start_index_events_catalog_product_mass_action
20.03.2013 14:17:52: dispatchEvent: end_index_events_catalog_product_mass_action
20.03.2013 14:17:52: dispatchEvent: resource_get_tablename
20.03.2013 14:17:52: dispatchEvent: core_collection_abstract_load_before
20.03.2013 14:17:52: dispatchEvent: core_collection_abstract_load_after
20.03.2013 14:17:52: dispatchEvent: start_process_event_catalog_product_save
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: index_process_change_status
20.03.2013 14:17:52: dispatchEvent: model_save_before
20.03.2013 14:17:52: dispatchEvent: core_abstract_save_before
20.03.2013 14:17:52: dispatchEvent: model_save_after
20.03.2013 14:17:52: dispatchEvent: core_abstract_save_after
20.03.2013 14:17:52: dispatchEvent: end_process_event_catalog_product_save
20.03.2013 14:17:52: dispatchEvent: model_save_commit_after
20.03.2013 14:17:52: dispatchEvent: core_abstract_save_commit_after
20.03.2013 14:17:52: dispatchEvent: model_save_commit_after
20.03.2013 14:17:52: dispatchEvent: cataloginventory_stock_item_save_commit_after
20.03.2013 14:17:52: dispatchEvent: model_save_commit_after
20.03.2013 14:17:52: dispatchEvent: core_abstract_save_commit_after
20.03.2013 14:17:52: dispatchEvent: model_save_commit_after
20.03.2013 14:17:52: dispatchEvent: catalog_product_save_commit_after
20.03.2013 14:17:52: update Dauer: 0.02026

흥미로운 부분은 다음과 같습니다.

20.03.2013 14:17:43: Mage::run
20.03.2013 14:17:51: dispatchEvent: resource_get_tablename
...
20.03.2013 14:17:51: Mage_Core_Controller_Varien_Front

Mage::run와 다음 이벤트 / 기능 호출 사이에는 항상 7-10 초가 Mage_Core_Controller_Varien_Front있습니다. 어떤 아이디어가 여기서 잘못 될 수 있습니까?

업데이트가 15 초가 걸리는 동일한 설정으로 다른 상점 (다른 서버의 다른 고객)과 동일한 문제가 있습니다.


구성로드 시간을 디버그하려고 했습니까? 지연의 가장 큰 이유 인 것 같습니다
Petar Dzhambazov

"디버그 구성로드 시간"의 의미를 설명해 주시겠습니까?
Anna Völkl

Petar가 구성 노드 트리를 컴파일하는 데 걸리는 시간에 대해 이야기하고 있다고 생각합니다.
Matthias Zeis

예, 실제 요청이 처리되기 전에 Magento를 부트 스트랩하는 데 걸리는 시간입니다. 또한 왜 Mage :: run이 로그에 있습니까? 나는 api.php에서 그러한 호출을 보지 못했습니다
Petar Dzhambazov

아래에 빠른 성능 팁이 있지만 개발자 / 개발자가 API에 대해 팔꿈치를 얻는 데 관심이 있다면이 API 시리즈는 디스패치를 ​​자세히 다루고 성능 문제를 추적하는 데 도움이 될 수 있습니다. alanstorm.com/category/magento# magento_api
Alan Storm

답변:


17

WSDL 파일을 캐시하기위한 PHP 설정이 있습니까? PHP의 SoapServer구현 (Magento에서 사용) 은 SOAP 호출 중에 적어도 한 번 이상 WSDL 파일을 검사해야합니다 . 요청 시간이 기하 급수적으로 증가 할 수 있습니다. 의 설정을 확인하십시오

System -> Configuration -> Magento Core Api -> Enable WSDL Cache

그리고 yes로 설정되어 있는지 확인하십시오. 이것은 PHP에게 WSDL 파일을 캐시하도록 지시하여 성능을 향상시킵니다.


3
나는 또한 동일한 프로젝트를 진행하고 있으므로 예, 이미 WSDL 캐시를 활성화했습니다. 약 1 초의 차이가 있었지만 전체 업데이트 호출에 8-10 초가 걸린다는 점을 고려하면 그리 많지는 않습니다 ...
Daniel Lang

2
백엔드에서 WSDL 캐시 사용이 "예"로 설정되어 있습니다.
Anna Völkl

이것이 실제 해결책은 아니지만 질문을 끝내기 위해이 답변을 선택합니다.
Anna Völkl

이것은 30 초에서 4 초로 업데이트했습니다. 승리.
dgig
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.