Simple queries hang in browser, work fine in fresh browser window

The problem

When using the browser interface, a query hangs for no apparent reason. This happens several times a day while working. If the query does finally run (after 30+ seconds), the report back is always fine. e..g., Created 654 relationships, started streaming 327 records in less than 1 ms and completed after 125 ms.

  • Happens with quick queries and more elaborate ones
  • Happens with large and small amounts of data
  • I usually return tabular data (e.g., RETURN n.myField instead of RETURN n), but it happens whether I return tabular or visualized data
  • Happens when I have many cards in the browser stream, or if I've Xed out all the previous cards. Closing the old cards has its own performance benefits so I usually X out all but 2-3 cards.
  • Happens in regular browser and incognito mode

Performance is great otherwise, and this problem only happens via a browser. I haven't seen any issues when running the queries with cypher-shell or python; that said, I haven't used those much with LOAD CSV, which is what I've been doing a lot lately.

The solution

Terminate the card and run the query again in a fresh card. If that doesn't work, open a new tab, reconnect, and run the query in a card there. The new window/ connection fixes the issues almost every time.

Sometimes, I can go back to the previous tab and queries will work again, but most of the time I end up just closing that old tab.

In need to troubleshooting advice

Can anyone recommend how I can fix this problem? Or test further to identify the root cause?

I saw some similar posts (e.g., @dan.flavin1's article on where are my results, question #1591), but I still can't figure out what's happening. It's definitely not an issue with the database architecture or the query design since the problem persists irrespective of my query statements (and they work fine in the terminal). Given that reconnecting on a new tab almost always fixes is the issue, could it be something with the cache?

Opening a new tab is not a huge inconvenience; it just slows things down and leaves me to wonder if the problem is my query or the browser. The bigger concern for me is that I use neo4j for teaching. I don't want the students to feel anxiety and confusion... you know, more than they will already when learning graph databases.

My environment

Browser is MS Edge. I'm on the latest stable version (92.x), but it's been happening for a year. It happens on other browsers too, but I use Edge because there aren't extensions and I don't use it for anything else. I tried on Private Browser session too, but it eventually starts happening there too.

Machine is Windows 10 20H2, 32 GB RAM, Intel Core i7-10610U CPU @ 1.80GHz, 2.30 GHz

Database is enterprise (4.2.1). I connect remotely [distance of a few miles] using VPN and logging in using my university SSO credentials. Connections always work great. :server connect returns

You are connected as user XXXXX
to neo4j+s://
Connection credentials are stored in your web browser.

The database is fairly small (200k nodes, 1M relationships) and there are only a few users.

You might want to take a look at the Where’s My Neo4j Cypher Query Results? :angry: :zap: :interrobang: blog for some background on what can seem like a fast query running slow in the browser along with some alternatives. What the post doesn't mention is that there can be different browser memory usage scenarios that are out of your control, which might contribute to the behaviour you're seeing. Consider that the Neo4j Browser is an electron.js (javascript) application.

Thanks Dan. Yes, your article helped me troubleshoot in the first place and narrow down the possible issues.

I think you're correct that this is a browser memory usage issue. I guess I'll keep doing what I'm doing and hope it's fixed when I update in the future.