The socket. io response is too slow for 2 seconds.

Source: Internet
Author: User
1. how to prevent socket. i/O request captured 2. why my socket. io requests are two such requests: post, get, dozens of milliseconds, and 3 more than one second. if you have a chat room, you can chat privately and enjoy the reward 4. socket cluster-related and disconnection reconnection mechanisms, read a lot...

1. how to prevent socket. io requests from being captured
2. Why does my socket. io request have two such requests: post, get, dozens of milliseconds, and more than one second?
3. if you have a chat room, you can chat privately and enjoy the reward.
4. socket cluster-related and disconnection and reconnection mechanisms. I have read a lot of articles about a single multi-node service with ip_hash and nginx load. there is no stress test yet, the server is configured with 4-core 8 GB memory.
5. There are a lot of live apps on the market, and live room chat rooms use php workerman and also have nodejs socketio. the technology of various platforms on the market feels similar, and the first-line optimization and high concurrency are relatively powerful.

Reply content:

1. how to prevent socket. io requests from being captured
2. Why does my socket. io request have two such requests: post, get, dozens of milliseconds, and more than one second?
3. if you have a chat room, you can chat privately and enjoy the reward.
4. socket cluster-related and disconnection and reconnection mechanisms. I have read a lot of articles about a single multi-node service with ip_hash and nginx load. there is no stress test yet, the server is configured with 4-core 8 GB memory.
5. There are a lot of live apps on the market, and live room chat rooms use php workerman and also have nodejs socketio. the technology of various platforms on the market feels similar, and the first-line optimization and high concurrency are relatively powerful.

First, we need to clarify a problem. When talking about [high concurrency] and typical [C10K] problems. Jump out of the program to check the problem.

The development language of world No. 1, giving you a M memory VPS, you should be slow or slow.
The server configured in world No. 1 provides you with an outbound bandwidth of Kbps. you should be slow or not.

Then answer the question.

1. how to prevent socket. io requests from being captured

No solution, as long as there is a network request can be captured packets. The only thing you can do is encrypt the package. New problems: how to prevent decryption. There is no solution. the reverse encryption process is called decryption. encryption must have decryption algorithms. if you use HTTPS, you can only prevent man-in-the-middle and local users from capturing packets. I'm sorry if I use a private agreement.socket.ioMust it be a web application? So are all the encryption operations, including the encryption algorithm, also made public on the webpage?
Conclusion: the cost of packet capture and decryption should be increased as much as possible, so that the input of packet capture and decryption attempts is greater than the output. Who else will solve you.

2. Why is my socket. io request .....

I don't know how to write your js. Otherwise, the browser you tested does not support websocket. this is the LONGPOLL mode of socket. io. When the browser does not support websocket, The flash proxy should be considered first. if flash is not supported, the longpoll mode can only be used (Baidu)

4. socket cluster-related and disconnection reconnection mechanisms

The logic of the code. The simplest front-end is a haproxy or nginx anti-DDoS. Back to multiple backends. There is a Gateway or other logic processing in the middle to save the connection of each client. Deleted after disconnection. To send a message to the client, first find the server to which the client connects and then command the server to send data.

5. There are a lot of live apps on the market, and the live room chat room uses php workerman and nodejs socketio ......

Video streaming media is not just a matter of language and technology. There are professional RTMP solutions ready-made open-source solutions all over the world, and which one is the most stable. Nodejs/php is now playing a bullet screen and chatting in real time. I have never seen it before.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.