Core features of node.js as far as I understood are (also): event-based structure and very cheap "threads" sleeping. So, it may be really good idea (and probably cheaper) to do not create periodic ajax requests, but to hold events like "user A got a new message" and let user's A connection thread sleep until this event happens.
核心功能的节点。在我看来,js(也是):基于事件的结构和非常便宜的“线程”休眠。因此,最好不要创建周期性的ajax请求(可能也更便宜),而是保存“用户A获得新消息”之类的事件,并让用户的连接线程休眠直到事件发生。
How do you think - what would be cheaper for server (RAM, CPU) to use?
你怎么想——对于服务器(RAM, CPU)来说,什么会更便宜?