-
Notifications
You must be signed in to change notification settings - Fork 7
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
Transaction speed running C++ on Linux #45
Comments
hi, i assume you're related to @miksovic? anyway, thank you very much for your effort, no further tests are necessary. it's clear that the c++ implementation is considerably slower... and you say it doesn't spend much time in CPU, so it seems to be waiting on locks or IO. my first thought was maybe my c++ skills were rusty and I used lots of copy-constructing or something in that spirit, but if it's not CPU bound, it's less probable to be the cause. it's more likely that i'm either doing the IO wrong, or that my some pointers:
a good test would be running using as for attaching files -- it would be easiest to just create a repo on github and upload your files there (that way it's revision-controlled and easy to share), or you could use http://gist.github.com (or pastebin, etc.) and last but not least -- i'm busy over my head at the moment, it might take me a several days to get to it. any progress you guys make would be greatly appreciated (you don't have to solve the problem -- just locate it). the best way is to fork the project, commit your changes/tests, and then send me a pull request. thanks, |
Hi yes, @miksovic is primarily working on Windows and I'm working on Linux. Thanks for your response. I'm not sure this is entirely C++ related. Maybe it's more a Linux thing. I've run strace and ltrace over both my client and server programs and don't have a huge amount of new information. I'll post the results of my tests as separate comments: |
First up is testing my Linux clients (Python and C++) against a Linux C++ server: Python Client$ ltrace -c -S python ./client.py 73.34 62.395172 87388 714 SYS_select Again with strace 78.64 0.000081 0 408 sendto C++ CLient$ ltrace -c -S ./client 27.29 12.051400 107 112473 mcount $ time strace -c ./client 100.00 0.004000 19 209 recvmsg |
Now Linux Clients to Windows C# Server process on network machine. Python Client on Linux$ time ltrace -c -S python ./client.py 72.59 60.406528 84602 714 SYS_select $ time strace -c python ./client.py 59.46 0.000022 0 916 755 open C++ Client on Linux$ time ltrace -c -S ./client 19.65 45.960395 74490 617 _ZNSi4readEPcl $ time strace -c ./client -nan 0.000000 0 11 read |
Running C# -> C# on the Windows box is extremely fast by comparison although I don't have timings (too fast). I'm beginning to wonder if my Linux box has some sort of problem. It's obviously not restricted to C++ as both C++, C# and Python clients behave the same way, as far as I can tell, regardless of what language the server is implemented in. I appreciate that you're busy and I don't expect you to solve this for me. I'll keep trying to identify the cause of the poor performance and I'll do anything I can to try and locate the problem. Cheers |
thanks for the effort! -tomer |
C++ to C++, linux box, modified the C++ test to include a small performance test:
results in |
okay, strace seems to reveal some interesting facts: first of all, boost uses client side
server side
both the server and the client seem to be waiting a long time (blocking on |
I don't know if you've been working on this lately but how difficult would it be to replace the Boost socket handling with a simple implementation of a socket library. I've been experimenting with some simple socket handling code and the strace info reveals no problems in sending/receiving times. (~8 seconds per 40,000 calls compared with 8 seconds per 100 calls) At first glance, linking this into the rest of the C++ framework in libagnos however would require quite a bit of work as I'm not really familiar with the boundaries of the boost code and which features you are making use of. |
yes, i think the problem is boost's |
Any updates on this issue? |
no, i'm not actively maintaining agnos any more... |
I've got a potential problem with speed of calls between a client and a server process running C++ code under linux.
The issue is that I can get a very low throughput in terms of number of transactions per second. We've tried C# on windows and can get 10's of thousands of calls per second when running the client/server both on the same PC (localhost) or across a network.
Under Linux running the C++ code, I can't get anywhere near that number of transactions.
I have a simple loop that performs two RPC calls 100 times and timing this with the Linux "time" command. This takes approx 16 seconds when running the client & server on the same PC. It's roughly the same across a network.
Running the Linux C++ client against the Windows C# Server results in approx the same slow behaviour. (~16s per 200 calls)
Running the Windows C# client against the Linux C++ Server results in approx the same slow behaviour.
Running a Linux Python client against a C++ Linux server results in the same slow behaviour (~16s per 200 calls)
It looks like the Linux C++ code is possibly waiting for a timeout or maybe there is something blocking, waiting to setup a connection. I'm guessing here but the CPU barely notices so it doesn't appear to be a lack of raw CPU cycles.
We've been unable to create a C++ Windows version to compare C++ vs C# and nor have I been able to figure out the relevant python syntax to create a python server under Linux.
If I can figure out how to attach some sample code to this issue I will do so, otherwise I'll post it here shortly.
The text was updated successfully, but these errors were encountered: