-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Performance regression for Dev Tools /api/console/proxy?path=_mapping
requests
#8417
Comments
We are experiencing the exact same issue, cluster versions 2.16.0 and 2.17.0 and 2.17.1. |
From the network tab, requests are made to three endpoints for 3 diff meta data including _mapping, _aliases, and _template. These frequent call and fetching meta data are expected and it is crucial for features like autocomplete in the Dev Console. Regarding the performance, I check the fetch method and don't think we made any changes that can cause this but we shoudl compare the response sizes and contents. Should we assign someone or ask for help? CC: @ashwin-pc @joshuali925 |
I did some investigation on this, here are the findings. the most time consuming part of api call is sending request to OpenSearch cluster and waiting for response. OpenSearch-Dashboards/src/plugins/console/server/routes/api/console/proxy/create_handler.ts Lines 114 to 117 in e9c9983
going deeper on this method call on opensearch-js lib try {
// add logs to show the how long it will take
console.log('deserialize start: ' + start)
result.body = this.serializer.deserialize(payload);
console.log('deserialize end: takes ' + (Date.now() - start) + 'ms')
} catch (err) {
this.emit('response', err, result);
return callback(err, result);
}
by looking at commit history about |
found a typo that will cause JSON11 parse will execute every time when json string has number with it. For the json string mentioned in the issue, there is no large number with it. By fixing this, JSON11 parse will be skipped, and total api time will down to 5-6 seconds that matches with 2.14. raised a PR to fix issue at opensearch-js side opensearch-project/opensearch-js#889 @AMoo-Miki would you mind to take a look? |
Describe the bug
When Dev Tools is open, requests are made periodically and upon each API command to 3 endpoints, one of which is:
After building a cluster and filling it up as per the repro steps below, this request takes:
For the tests above, the Opensearch and Opensearch Dashboards versions were the same each time. However, even if I keep Opensearch on 2.17.0 for all 3 versions of Dashboards, I see the exact same slowdown, suggesting that the issue is with Dashboards rather than Opensearch itself.
To Reproduce
https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/#sample-docker-compose-file-for-development
Note that I updated the heap size to 2g for each node and I'm running this on a c4.m8 VM.
elasticsearch==7.12.1
to be installed):With the Chrome Developer Tools Network tab open, run a command in Dashboards Dev Tools. Check how long the triggered request to
/api/console/proxy?path=_mapping&method=GET&dataSourceId=
takes.Repeat the test for versions 2.14.0, 2.15.0 and 2.17.0
Expected behavior
The requests shouldn't take 3 times as long as in 2.14.0. What's more, the impact is multiplicative since every request made in Dev Tools triggers this request - see: #5654
OpenSearch Version
2.17.0
Dashboards Version
2.17.0
Plugins
Using the stock
opensearchproject/opensearch-dashboards
docker images.Screenshots
N/A
Host/Environment (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: