Answer the question
In order to leave comments, you need to log in
Server architecture?
Hi all. Now there is such a server architecture:
The application makes calculations in a loop every 100 ms, creates a local tcp connection (with the nginx server), sends information ~ 30-40 bytes through this connection with a POST request, closes the connection.
Naturally, this is very slow, and there are several reasons:
Answer the question
In order to leave comments, you need to log in
Yes, the second option with related UDP is preferable. There is, however, something to think about.
1. Will clients be able to connect via UDP (is there a firewall)? Of course, you can use UDP 53…
2. How will you distribute clients? When working via HTTP, the client turns out to be browser-based, i.e. distribution for free. Any socket-based client will have to be distributed in binary form.
3. You should also think about udp vs tcp. If you have a server and a client within the same locale, then definitely - udp. If the order in which the client receives packets over the Internet is important to you, then you will have to implement some kind of your own protocol with numbering inside udp.
As uTorrent practice shows, the reimplementation of TCP to UDPdelivers a profit. But you need to soberly assess that 20% of the gain in speed will cost 80% of the complexity of the code.
If you don’t want to write your transport with a delivery guarantee, but you still need a delivery guarantee, then you can use TCP, scoring a small overhead. Or maybe really take uTP .
Use ZeroMQ to communicate. There are bindings for any language, I guess.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question