dialogflow multiple parallel requests handling
Hi all, I'm dealing with dialogflow integration for chatbot in one of my applications. Trained intents , published different versions to different environments. Upto this works excellent as expected. But when we move to production and we got parallel request to dialogflow through node. At this time, getting many timeout responses and users not getting configured messages .
Configured webhook in the dialogflow and getting custom data from node API with detectIntent.
Using
Node.js : 14.17.6
Dialogflow ES
dialogflow library : @google-cloud/dialogflow": "^4.5.0
getting error as :
webhookStatus: {
details: [],
code: 4,
message: 'Webhook call failed. Error: DEADLINE_EXCEEDED, State: URL_TIMEOUT, Reason: TIMEOUT_WEB.'
}
Test Info : If we hit 10 parallel dialogflow detectIntent requests, at least 5 - 7 responses getting timeout_web error as mentioned above 😞 .
Need help ASAP, Thanks in advance 😃 .
Hi Vinay, Just a note : Dialogflow has quotas set up for both CX and ES versions and they are highlighted here based on EX Trial and Essentials edition. However the current issue does not look to be related to quota restriction. I could find a reference of a similar google issue here in another google product.
Keeping the above analysis aside, I tried to replicate the issue using 30 concurrent users but I was not able to, given that I was using the same node and dialogflow versions. Will you be able to post the full stack trace of the error ?, It will help in getting more details around the issue.
Hi @ibrezm1 ,
Thanks for the quotas info. I identified issue when i moved to production and got more users interaction. So, replicated the parallel request with async library. Full error trace
[
{
responseId: '05653bd5-b8e9-4548-9548-25420542e45b-bda801c7',
queryResult: {
fulfillmentMessages: [],
outputContexts: [],
queryText: '<user_query_input>',
speechRecognitionConfidence: 0,
action: '',
parameters: [Object],
allRequiredParamsPresent: true,
fulfillmentText: '',
webhookSource: '',
webhookPayload: null,
intent: [Object],
intentDetectionConfidence: 0.6454788446426392,
diagnosticInfo: [Object],
languageCode: 'en',
sentimentAnalysisResult: null,
cancelsSlotFilling: false
},
webhookStatus: {
details: [],
code: 4,
message: 'Webhook call failed. Error: DEADLINE_EXCEEDED, State: URL_TIMEOUT, Reason: TIMEOUT_WEB.'
},
outputAudio: <Buffer >,
outputAudioConfig: null
},
null,
null
]
Hi @VinayBaviri ,
I am sure you would have checked it already but wanted highlight: Are you using webhooks for fulfillment. if yes , their are certian limitations as per the Dialogflow Documentation
The following limitations apply to your response:
The response must occur within 10 seconds for Google Assistant applications or 5 seconds for all other applications, otherwise the request will time out.
The response must be less than or equal to 64 KiB in size.
As a quick check, can you validate if the webhook you are using is meeting the above critera, if you are using webhooks? Specifically under the performance load that you have mentioned
Yes @ibrezm1 , i'm using webhook fulfillment which will trigger configured API route in node. For one request, its completing in min 1.555s and max 2.287s . Sometimes, one request is taking more than 5 sec and failing. Not able to get where the exact issue is !!. Also to mention, i'm not doing any complex or time-taking operations on the webhook API in the node 😞 . Its really killing the entire performance of the application feature 😭 .
Thank you for filing this issue. This Github repo is used for issues with the Dialogflow NodeJS library. This issue appears to be a question about your specific implementation rather than a problem with the product or library. Unfortunately this is not a staffed support channel for Dialogflow. Please consider the Dialogflow support options listed here: https://cloud.google.com/dialogflow/docs/support/getting-support