Article DetailsDetailsHelp Details This article aims to provide the steps on how to diagnose and resolve the "Poor Connection" error in Neo4j Bloom. We will discuss where to find relevant logs, how to identify long-running Cypher queries and offer practical suggestions to improve performance. The "Poor Connection" error in Neo4j Bloom typically occurs when the response from the Neo4j server takes longer than the configured timeout of 60s by default. Several factors can contribute to this issue: Large Data Volumes: Handling large datasets can impact the connection between Bloom and the database, leading to performance issues.Complex Queries: Running long or unoptimized queries can consume excessive resources, causing delays.Network Latency: Poor network infrastructure or high latency can disrupt communication between Bloom and the Neo4j server. Bloom polls the database periodically by issuing SHOW DATABASES. If this response takes longer than the configured timeout the "Poor Connection" message is displayed.Insufficient Server Resources: Limited CPU, memory, or disk I/O on the server can affect the database's responsiveness.Inefficient Indexing: A large number of indexes, especially overlapping full-text indexes, can slow down query execution. Troubleshooting: 1- Web Browser Console: The first place to look for more details is the Web Browser Developer Tools Console (Inspect): This error indicates that a Bloom query was not completed within the specified time-out. It also shows that the error was during fetching full-text index property value suggestions. We will use this example to investigate the issue further on the server side. 2- Identifying Long-Running Queries in Server Logs When Bloom's queries time out or result in a "Poor Connection" error, it's important to identify any long-running Cypher queries that might be causing performance bottlenecks. Analyzing the server's query logs can help pinpoint these queries. Example: 2024-09-26 06:53:48.148+0000 ERROR Query started: id:10414 - 61669 ms: 0 B - bolt-session bolt neo4j-bloom/v2.11.0 dbname - theUser - CALL db.index.fulltext.queryNodes("Index1", "appl~") YIELD node AS var0 ... UNION CALL db.index.fulltext.queryNodes("Index2", "appl~") ... {app: 'bloom', container_app: 'standalone', type: 'system', version: '2.11.0', vendor: 'neo4j'} - The transaction has been terminated. Retry your operation in a new transaction, and you should see a successful result. The transaction has not completed within the specified timeout (dbms.transaction.timeout). You may want to retry with a longer timeout. The query above issued by Bloom has timed out, it contains several sub-queries, joined by UNION, to look for a text in all the full-text indexes in the Database. In this case full-text index searches were failing because of this long-running query. 3- Analysing the overall server performance: In addition to the query logs, examine the debug.log for: Errors: Any error messages that could indicate issues with query execution.Unusual Activity: Unexpected behaviors or warnings that could impact performance.GC Stop-the-World Events: Garbage collection pauses that can halt the JVM and affect query execution. If you find errors or significant GC events, they could be contributing to the "Poor Connection" error. If no errors or indications are found in the logs, the investigation should focus on other environmental factors. Utilise appropriate measurements and tools such as: Java Flight Recorder (JFR): To collect detailed profiling information about the JVM.Thread Dumps: To analyse thread states and identify bottlenecks.Network Latency Tests: To assess the quality and speed of the network connection between Bloom and the Neo4j server. 4- Steps to Address Long-Running Queries Optimise the custom queries: Rewrite the query to be more efficient. Use EXPLAIN and PROFILE in Neo4j Browser to analyse the query plan.Add Indexes: Create appropriate indexes to speed up query execution.Simplify Bloom Perspectives: Reduce the complexity of perspectives to limit the scope of queries.Enable "Hide uncategorized nodes": to limit the scope of queries.Limit Returned Data: Use LIMIT clauses to restrict the amount of data retrieved.Increase the Timeout and reduce the node limit: Change your Bloom settings to increase the timeout and reduce the node query limit: 5- Notes and Best Practices for Using Full-Text Search Indexes Neo4j Bloom enables users to perform full-text search queries directly against the database using their search input at any time. This feature is especially helpful when the default suggestions provided by Bloom do not fullfil the user's requirements. The full-text search option is listed last in the suggestions, ensuring it is accessible when needed but not used inadvertently. However, executing these searches can lead to very long-running queries, particularly if the database schema is complex and the number of full-text indexes is large. Full-text indexes best practices include: Index Only Necessary Properties: Limit indexes to properties that are frequently searched to conserve resources.Consolidate Indexes: Reduce the number of full-text indexes.Optimise Perspectives: Limit the number of categories and associated labels in perspectives to reduce query complexity. InformationTitleResolving Neo4j Bloom's "Poor Connection" ErrorArticle Created Date11/18/2024, 2:08 PMURL NameResolving-Neo4j-Bloom-s-Poor-Connection-ErrorLast Modified Date11/26/2024, 3:53 AM