-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Slow down taginfo requests #3955
Comments
The biggest problem seems to be that people misuse this feature as a name search. With 50 million names in the database, doing a substring search will never be fast. I am seeing query times of 10s to 20s in the log on these queries. Running several of these at the same time due to the search-as-you-type is really problematic. Is it possible to cancel running requests when the next character is typed? I am not sure, though, whether the server supports that canceling. |
I'm not sure why people would ever do a name search. It would only happen if they are using the raw tag editor to add a name, but I guess some people might do it. @joto Is searching certain keys slower than others? I guess what I am wondering is - should we blacklist, or treat differently, certain keys like |
Autocompletion of names would be quite useful if iD were searching the right things: For highways:
For POI (less important, and more difficult):
Intermediate or advanced users do likely edit much more features than new users do, and I would expect that many intermediate or advanced users work with all fields section closed when maintaining feature types which they are used to edit. All fields section doesnt't show all present information, and it doesn't show all supported information at a single view. Working with all tags seems to be much more efficient to use in this case. All field has its benefits for new users, or in case of tagging rare feature types where the user is not aware of the tagging rules. |
@bhousel Yes, searching is much slower for keys with more values. Just blacklisting |
That's good to know. Could you get a list of the "keys with most values" that we might want to blacklist? I looked on taginfo.openstreetmap.org but don't think there is a way to do it - this probably requires a database query. |
https://taginfo.openstreetmap.org/keys |
There are many keys which are unlikely to be edited by iD, these can be blacklisted, but the effect is likely small. We can sort the remaining keys with many keys into categories how to handle autocompletion
Keys like wikipedia have nearly as much values as objects are tagged. It is quite unlikely that a Wikipedia link which is already existing in OSM is desired when tagging a new object. Therefore, searching Taginfo doesn't make sense in this case. We should search Wikipedia itself for existing articles instead. |
This is what the Wikipedia field under “All fields” does. Likewise, various address fields autocomplete based on nearby features. Perhaps we could special-case the underlying |
My plan is to just blacklist the top 100 keys from (exception: I think it's safe to just exclude those keys from value lookup or combobox autocomplete. |
I'd add source, fixme, and note to the exclusion list, and blacklist name:*. I was undecided on addr:city, but I think I'm against blacklisting it. When you've typed in 3-4 letters of most cities you get some meaningful results. Some of the tags like ref, name, etc benefit from an autocomplete based on what's nearby, but not one based on worldwide tag stats. |
I'd also exclude Blacklisting 100 keys seems to be much more than required in view of server load, but I agree that autocomletion based on taginfo doesn't make sense for most of these keys. An estimation of the generated server load seems to be the product of three factors:
|
@pnorman, @slhh, the address fields in the All Fields section do autocomplete based on what's nearby, not taginfo. As far as I can tell, this change would only affect the raw tag editor. I don't think any of the other top 100 fields are things that we use combo boxes for in the All Fields section. Anyway I don't want to overthink this. @joto says that "searching is much slower for keys with more values." so iD should just avoid doing searches like that. |
done in #3975 |
We're hitting the taginfo service too frequently and should slow down the requests when the user is typing.
Currently these calls are debounced - but only at 100msec - which seems like it would not be very effective at preventing api calls except for fairly quick typing.
We can delay the calls a bit more, and also consider requiring 3-4 characters of typing before sending a query. We had this before and removed it for some reason - I can't remember why right now.
The text was updated successfully, but these errors were encountered: