Python Forum

Full Version: Slow websockets server -> client
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all, first post here :)
i've been using python for a while - due to my raspberries :) - and lastly i'm having some fun with the websockets module.
i have a web page (served by an apache server, not passing through python..) connecting to the websocket server (here is python).
and well.. it works, i can send and receive information to and from the client.
BUT
the strange part arrived when i tried to implement some google charts. I decided to pass the charts' data through the websocket connection (avoiding an ajax connection through the webserver) and, sadly, here is my problem.
The data transfer is DEADLY slow! I mean, let's say the chart data is 50kb of text - it's a json -, it is taking something like 15 seconds to be sent to the client
I found out the mask function could be implemented, and i tried, but i think it's not even used for outgoing data (server -> client)
I tried also to increment the write buffer. no result.
Did i miss something?
Thanks a lot :)

nb:
- the server cpu is not stressed during those 15 seconds
- i checked the time is consumed not producing data - which comes from a db -, but sending them
- the connection is in local lan, so it's not a bandwidth issue..