-
Notifications
You must be signed in to change notification settings - Fork 46
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
Strange issue with localhost vs 127.0.0.1 #286
Comments
hm, if you use Wireshark to capture the traffic, do you see any difference? |
I took the time to answer you the most detailed as possible:
Yes a lot, I will post them below, but I'm not very familiiar with this tool.
Look like using
Absolutely
See by yourself on the Wireshark trace below. Wireshark trace with
|
hm, can you save the pcap files instead please? (in the file save menu) |
Here's what you asked: The same 4 dumbs created with the exact same script. |
hm, starting with the filesizes:
you can already see, that the localhost collection-close is ~3 times as large as the 127.0.0.1 one. With connection keepalive, its still 1/6 the size which the localhost one is larger. this is probably responsible for the additional time required. But I'm no expert in the Microsoft TCP stack implementation to tell you why its doing this. One can also see that tcp-retransmission pagkages are ipv6. You also can see, that the the If you sniff port 50 tcp & udp, do you maybe see it also doing DNS-lookups? that could even make it slower. |
To be honest i don't have much more time to investigate on this as I finished Arangodb implementation in Phpfastcache but I can tell you this: Many concurrent database I implemented (Couchdb/Mongodb/Couchbase/etc) don't have this issue even if I used "localhost" instead of "127.0.0.1". At first I though it could be related to a misconfiguration of my And you're right, using a "Keep-Alive" connection is way much more efficient since my script send a lot of queries to the Arangodb API. The script is located here |
does it reproduce on linux? You see without keepalive it seems even 3 times the amount of packages is sent, else the file wouldn't differ so much in size. |
@Geolim4 : from what I can tell is that the arangodb-php driver replaces
If for whatever reason this is a problem in some environments, we could make this replacing optional. |
Oops, just realized that the above function will only be called if active failover is used and there is more than a single endpoint. |
I tried it on my work computer (Ubuntu 18.04): No issue at all.
I'm using as single endpoint so I don't think this piece of code is called, indeed. |
Ok, thanks! Gonna try to find a Windows machine to see if I can reproduce the issue locally. |
I would like to write a big troll joke about Windows users, but I'm myself developing on Windows at home for some personal reasons and I see it as an opportunity to catch some bugs on an "unusual" platform that you support :P If you want to tests it easily with the scripts I made follow the steps:
|
Also you uncomment this line before running tests to see the trace function printing debug: |
yes, definitely - Ports are good for stability and performance. Windows and Mac are much less reluctant against errors that linux may mitigate unheard - we have seen this on our CI more than once. |
Hello,
I'm the Phpfastcache maintainer and I'm currently implementing support of Arangodb for the next major release (v9).
But I noticed that using an endpoint with "localhost" is VERY slow (look for Test duration:):
Using "127.0.0.1" is drastically more efficient (look for Test duration:):
At this moment I'm really unable to tell you if it's arangodb-php-related, arangodb-related or simply php-related but I think you now have a lead to investigate on this issue and maybe warn your users in the WIKI/Docs.
Here's is the configuration used for the tests made above:
The text was updated successfully, but these errors were encountered: