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
Nominatim slow query #1139
Comments
@mtmail about Try running test queries with 'EXPLAIN', see a similar discussion at #1023 (comment)_ Here it is:
|
OK, those queries are fast. It might be worth trying an Do you have monitoring on disk IO, e.g. via AWS Cloudwatch(?). Do you remember how long the initial import ran? I see the GP storage type is network mounted (https://aws.amazon.com/ebs/details/) and the T2 instances are not EBS optimized (https://aws.amazon.com/ec2/instance-types/). I can't tell if that means the disk IO is slow or unsuitable for small burst, I only have experience with the super small T2.micro instances. |
Here is the
Yes, I have detailed AWS CloudWatch monitoring. What I noticed was that even running slow queries like this:
the use of CPU and Disk remains almost null. (I waited a few minutes to get this print) My initial setup it took about three days. For that I set up the swap , could this mess up something? In relation about EBS on T2 instance I have another Nominatim instance with full planet with T2 Instances and everything works fine. |
Please run |
Three days is pretty good. Doubling hardware and faster discs might get you to two days. I was just wondering if took two weeks (we have user reporting that on underpowered hardware). |
@lonvia after run
|
Wait, are you saying that the slow queries only happen after the database was restarted and things settle down after a while? That would be perfectly normal. Postgresql has to fetch many gigabytes of index data before it can serve the queries efficiently. |
I understand. Extremely grateful for the help. There's something else, can you tell me if it's normal?
and after a few calls I get status code 200 normally. Postgresql Log:
Can AMI be messing something up? |
I think you have a wrong idea what 'caching' means in this context. It means that Postgresql fetches data from disk into RAM. Once the most frequently used data is there, it can answer many queries from the data that is cached in RAM and thus is much faster than before. When Postgresql is restarted, it forgets about all the data it has in RAM and needs to start fresh. If you create an AMI and spin it up on another machine, that is the same as restarting Postgresql. So yes, it is normal, that here too the first queries are slow. |
I always worked with Nominatim with an incredible performance, I did not know that the creation of the cache could take so long. |
@gnosis75 I'm trying to do almost exactly the same thing as you - were you able to figure out a good way to warm up the cache after creating an instance from the AMI? |
@gnosis75 +1 |
@Emil-Zhou (Comments on year-long closed issues are easy to miss. There's a |
I recently imported the nominatim with full planet and queries are undesirable performance. The first query, before the cache is created, takes longer than 20 seconds and sometimes I see this error:
Due to the delay of the queries I thought the problem was the lack of some index and then I executed:
What does this line mean? NOTICE: index "place_id_idx" does not exist, skipping
After that, I turn on the postgresql log and called the search api with these parameters:
Looking at the logs I thought some functions might be missing, and execute this:
Some info about my installation:
I did not come up with a solution with no command executed
What else can I do to try to solve this?
The text was updated successfully, but these errors were encountered: