-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Running very slow. #366
Comments
I will run your benchmark and see what I get. |
@dkeeney, thank you for providing the detail. I build server and client from your source files with x64 setting and checked the performance on my Windows. As you can see the following results, both client and server seem to perform as normal. Client :
Server:
|
You are getting wonderful results. When I access your server with the benchmark the results are good too: I wonder if its a windows thing when both client and server are on the same machine. |
I ran a our Unit Test for the library we are building. This contains something like the tests I gave you but uses real data and real calls into our library. It starts the server on one thread and then the client in a second thread. The client connects to the server and exchanges messages to try out all of our REST interface. Under Linux and it was really fast...all messages together was 127ms. So I have something setup wrong someplace. |
I don't know if this is a clue or not, but using my client/server test, on Windows with Visual Studio 2019, each message round trip is taking almost exactly 2000ms. They range from 2003ms to 2015ms. I wonder if there is a 2 second timeout someplace....perhaps in the thread pool? |
Either that or the delay is coming from Windows attempting to resolve or redirect your connection somewhere else, failing and then falling back to local machine |
Perhaps. But connection timeouts are a lot longer... I tried setting the client timeout to 30 seconds and it made no difference. This would not be a DNS lookup delay because I am sending to "Localhost" which resolves locally. I am still thinking thread pool or some sort of lock but I have no bases for that theory. |
Found the problem --- The fix then is to use "127.0.0.1" rather than "localhost" as the host in my client app when connecting to my own machine. Or go fix the IP6 configuration. The problem had nothing to do with this software library. |
Glad to hear you found the solution. |
you are genius, it help me a lot!! |
Saved my day! Got exactly the same ~2sec delay. Was driving me crazy. @yhirose maybe add some info in readme about using 127.0.0.1 vs localhost? I see that this problem arises for many people and it is far from obvious. |
Keep it open with 'information', so that others can benefit from the solution. |
All messages passing from client to server and back are very slow....about a second for one round trip. These should be less than a millisecond. You don't need a time stamp to see the delay because it is obvious when you see the messages come up in the log display.
I am using version 0.5.5
I am running on Visual Studio 2019, x64, both debug and release modes.
To demonstrate this I wrote a pair of routines that you can use to see the problem by hacking up your client and server examples.
In one Command prompt window, run the server. Then in another Command prompt window run the client.
Here is the Client
Here is the server:
The text was updated successfully, but these errors were encountered: