N1QL query is getting timeout out

Hi,
We are using community edition:(4.5.1)

Most of the time N1Ql query is not returning the data. It is getting timed out. When we restart the couchbase server, it starts workings but again after sometime queries are getting timed out.
We have 17000 records in the bucket. Bucket RAM quota is 4GB.
Please let us know if we can find more details related to this issue.

Also when we are running query from console also,from their also we are not getting the result.

Thanks,
Ashish

@omi.ashish:

Can you share your queries, their EXPLAIN, etc?

We find the issue, one of the queries was not using proper index and it was getting timeout. We have fixed it. But the question is why after that none of the queries were responding. Do we need to do any other setting?

We found another issue, again because of 1 query , all n1ql queries stop responding. Is there any settings which can be done in couchbase to avoid this.

We are getting following error message-
Error message : - [Error performing bulk get operation - cause: {1 errors, starting with bad magic: 0x02}], exception: [].

Thank you

Check your queries. Once of the query might be doing lot of documents Fetch and caused other queries blocked. No settings. You can restart query service. This has been improved in feature releases.

Note also that depending on your setup, queries may pipeline on HTTP connections. It may have been that your other queries were in the pipeline behind the one that timed out. In most of the current SDKs there is automatic connection pooling and it will distribute across HTTP connections, but there is often a safe limit to the number of connections so there may be some queueing. I can provide more advice if you indicate which SDK you’re using and if you’re using the REST interface directly, check how you’re queueing HTTP requests.

From the symptoms though, it looks like it’s more related to the query KV fetch. @vsr1- does the max_parallelism apply here by chance? The docs seem to indicate the default would be 1, unless overridden.

Thanks for the reply.

We are using Couchbase.NetClient - Version =“2.4.6.0” and we are using QueryAsync as a call for retrieving our data.