~300ms delay after a LOGON Bolt message #2513
Labels
bug
bug
community
community
Effort - Unknown
Effort - Unknown
Frequency - EveryTime
Frequency - EveryTime
Reach - Some
Reach - Some
Severity - S2
Severity - S2
Memgraph version
2.22.0
Environment
Memgraph on Docker 4.36.0 (and part of a Docker network, with Traefik proxying and customized
hosts
whose IP the IP of our VPN (using OpenVPN), despite everything running locally)WSL 2 on Windows 11 Pro (version 23H2, build 22631.4460)
GPU 13th Intel Core i7-13620H 2.40 GHz
32 Go RAM
64-bits OS
Describe the bug
I use Memgraph from PHP through Bolt. When getting the response after a
LOGON
message, I get a delay between 250 and 350 ms. As I am in a PHP-FPM environment, I do a LOGON each time an user hits my endpoints, causing noticeable latency. When using Neo4J with the exact same code, I have the latency on the first call only, then I have a delay between 15 and 25 ms.To Reproduce
I use PHP 8.3 and this library: https://github.com/neo4j-php/Bolt
Code follows:
Output is, after repeated attempts:
Expected behavior
Having repeated call on LOGON results not in delays between 250 ans 350 ms.
Logs
After a bit of investigation, I've noted that the delays comes when asking for the two-byte header of the response data chunk. In fact, when tinkering with the aforementionned library, the response involves calling
$header = $this->connection->read(2)
, which leads (I've added thevar_dump
):Resulting in:
(In this cas, this is the header of the response of a LOGON message; this header is
90
after unpacking).Additional context
I have tested my setup with PHP running on another Docker instance, or with PHP running directly on Windows: same issue. Tested with Docker 4.27.0: same issue. Tested with Memgraph 2.20.0: same issue.
After running tests, this problem seems not to come from PHP or the library I use.
Verification Environment
Once we fix it, what do you need to verify the fix?
Do you need:
The text was updated successfully, but these errors were encountered: