Slow websockets server -> client - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Networking (https://python-forum.io/forum-12.html) +--- Thread: Slow websockets server -> client (/thread-21154.html) |
Slow websockets server -> client - pattagghiu - Sep-17-2019 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.. |