Comments (12)
So it looks like your client only 'sends' data to the server right ? Is your server reply back with the same data ? If that's the case stop doing that as it will take time to 'download and process that data on the client'.
Also are you compiling the library in Release mode ? Here is what you should do to do that if you are using the top level makefile.
diff --git a/makefile b/makefile
index 30b3a29..01a3ba5 100644
--- a/makefile
+++ b/makefile
@@ -9,10 +9,10 @@ install: brew
# on osx it is good practice to make /usr/local user writable
# sudo chown -R `whoami`/staff /usr/local
brew:
- mkdir -p build && (cd build ; cmake -DUSE_TLS=1 -DUSE_WS=1 .. ; make -j install)
+ mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Release -DUSE_TLS=1 -DUSE_WS=1 .. ; make -j install)
ws:
- mkdir -p build && (cd build ; cmake -DUSE_TLS=1 -DUSE_WS=1 -DUSE_MBED_TLS=1 -DUSE_VENDORED_THIRD_PARTY=1 .. ; make -j)
+ mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Release -DUSE_TLS=1 -DUSE_WS=1 -DUSE_MBED_TLS=1 -DUSE_VENDORED_THIRD_PARTY=1 .. ; make -j)
uninstall:
xargs rm -fv < build/install_manifest.txt
from ixwebsocket.
My server doesn't reply any message to the client in this part of app.
No I haven't compiled IXW in Release mode. I've just used:
make
sudo make install
`
```
from ixwebsocket.
from ixwebsocket.
The BW is not the problem.
I will build IXW in ReleaseMode then enable per message comperession. Good advices
I let you know the result.
Thans for your help.
You always come to my aid
from ixwebsocket.
from ixwebsocket.
Dear @bsergean ,
I've compiled IXW in ReleaseMode and tested with disabling and enabling perMessageDeflate.
sadly non of them has been highly effective.
the another parameter that crosses my mind is fragmentation size
.
One the server side, I get the data fragmented into 42 to 45 parts(the length of each one is exactly 8192
except the last part).
So I took a look at the IXWebsocketTransport.cpp line:796
and realized that seemingly the large data is broken into some parts.
Is there any parameter to increase the len of each fragmented part or decrease the number of part?
I guess by decreasing the step size, we will have lower processing cost
from ixwebsocket.
I got new thing that I think it's very important.
when there is no packet to be sent, the cpu is still busy and around 20% of it's performance is taken.
I think the IXW tries to have a negotiation with the server to keep its connection alive.
from ixwebsocket.
from ixwebsocket.
Dear @bsergean ,
seemingly my last message hasn't been sent on the github.
doesn't matter. I find the problem.
there is an endless loop in IXWebsocket.cpp line: 291 to 351
I don't know why and don't have enough OS information about that, but I'm pretty sure, based my experiences , Raspbian is too sensitive to endless loop. it takes high processing cost even there is no command inside.
I put sleep(5)
inside the loop and it's solved. I know if I have a message from the server, it's triggered every 5 seconds but my server's message is not so critical.
from ixwebsocket.
I tried running ws connect on macOS, and watched CPU usage which was at 0%.
If you have a standalone program that I can run and that display the problem please attach it to this issue and I can try to troubleshoot this further. There shouldn't be any need for that sleep in that wait loop. There should be no sleep call in that wait loop, the loop block waiting for input when it call poll.
I'm happy if you found a workaround, but I don't think that the whole mystery is solved.
from ixwebsocket.
I tested on the Ubuntu too and the CPU usage was around 1%
As I mentioned I don't why the Raspbian gets stuck into trouble when there's an endless loop,even an empty loop. it's a little bit strange to me.
I'm working on it. I'll send you a standalone instance of the app to be watched
from ixwebsocket.
from ixwebsocket.
Related Issues (20)
- No Close event when server TCP socket closed HOT 2
- Allow to bind after construction of `ix::WebSocketServer` and `ix::HttpServer` HOT 1
- Need a way to identify the clients of a WebsocketServer HOT 1
- How to build project that includes IXWebSocket without using vcpkg HOT 1
- the client did not receive the close event HOT 3
- Cannot link against IXWebsocket HOT 1
- HTTPServer questions? HOT 2
- Question about weak_ptr in API HOT 1
- Source code release v11.4.4 contains an error in IXSocketMbedTLS.cpp line 52 HOT 3
- Can I use IXHttpClient to upload files to server? HOT 1
- each http request cause socket reconnection HOT 1
- [BUG] Does not receive a close or error message. and the mapping configured in the host file does not take effect
- Memory leak in proxy code HOT 4
- Universal Windows application TLS certificate issue HOT 2
- UWP App undefined method PathMatchSpecA HOT 2
- Client connection closed immediately on re-connection after ping timeout HOT 1
- Disable ZLIB when install as vcpkg package? HOT 1
- Build error. (mbedtls) HOT 2
- [Feature Request] Add support for OpenSSL SSLKEYLOGFILE HOT 9
- Unable to connect to ws endpoint behind standard AWS load balancer (ALB) HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ixwebsocket.