-
Notifications
You must be signed in to change notification settings - Fork 58
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
client is a potential bottleneck #39
Comments
That sounds interesting. It is also interesting because different servers still handle the connections differently. If the client was the sole problem, then all servers "able to keep up" should have roughly the same behaviour. From my initial tests on data for the handshake times only two systems exhibit the same behaviour: erlang-cowboy and go-websocket. The rest of the bunch have considerably different characteristics. I agree this is worth investigating. I'll consider reading through the client code in order to try to figure out what it does and if I can find something odd in there, among other things. |
@jlouis, notice, my systems were both single-core. Considering that a client does much more processing than a simplistic server, that what might caused the oddity. Also, I can confirm that almost all systems behave comparably on my tests. I should try to add another core to the client machine and try again. Thanks for the insight. |
So guys, I added the second CPU core to my client machine, ran some tests and I now have interesting results for you. First of all, I think my theory on the client being a bottleneck in some cases was right. Check out these screenshots to see what I mean: Results: On a side note: Haskell and Go were unbelievably awful in terms of memory consumption. While it is a known fact that Go has severe memory problems on 32bit architectures due to the questionable GC design, I am surprised about the haskell-snap behavior. |
That definitely looks like an overload problem on your hardware. Also note you are not even getting the 10k handshakes which Eric was getting on go and Erlang - so the faster machine Eric has might help in this case at handling all the connectivity. Perhaps you should post specs as well as Eric, so we have an idea of what kind of machine is currently needed to handle the load. As for the 32bit limit on the Go GC, it is the price they have to pay because their language does not use a precise GC (which is a rather bad decision IMO). |
@jlouis, I am not sure about the overload now that I have added the second core to the client. At least it is not because of CPU now. Perhaps some other hidden price of virtualization. Indeed I am eager to find out the results on a real hardware. Notice, by displaying the screenshots I tried to show that the erlang client was consuming more than 1 CPU to compete with certain fast servers. |
The server hardware that I have is the following:
The client I will be using is my Macbook Pro bootcamped into Ubuntu 12.04 (at least that is the plan) MBP's stats:
|
Sorry, the server only has 2GB of memory. I copy/pasted that from the Craigslist Ad. One of the 2GB modules were bad, so I removed it. I may have to pick up a 1 or 2GB module if the OS + each server start swapping. |
Does anyone know if I should add a "cool down" period between stopping on server and starting the other? Could there be any residual effects of one test in the kernel that could affect the result of another test? |
To save you some googling, the server is 64bit. |
Once all the processes have exited/killed it should be fine. A 15 sec pause to be on the safe side. |
Update: I've been testing the servers on a pair of linode-512 machines. The outcome is this: a basic linode hardware is capable of handling ~19k of active concurrent connections (pypy,erlang,java). It's like 1$ a month for a 1,000 of websockets :) |
I like how this thing is turning into a way to benchmark VPS hosts as well as individual WS implementations. |
@aglyzov what was the number of active concurrent connections on the linode for the other benchs like gevent for instance ? |
@perone gevent-websocket was not doing great unfortunately. There was a cut-off near 11k. |
@aglyzov thanks for sharing ! |
When testing one has to ensure the client machine is powerful enough to withstand a CPU load
created by the erlang client program.
On several occasions I saw the client to consume more CPU than a server on an identical pair
of machines. I observed the htop output of both the client and server machines at the same time
and it was clear that the erlang client was bounded by CPU while the server had a fair amount of
reserve. This was especially so in the first stage of the test when new connections get created.
Then, after some connections died off due to the client timeout, the client CPU usage lowered
considerably.
So, assuming the testing machines are the same, the client might be a bottleneck in some cases.
This needs to be checked thoroughly.
The text was updated successfully, but these errors were encountered: