简体   繁体   English

10,000个用户或10,000个setInterval()?

[英]10,000 users or 10,000 setInterval()?

I'm using APE-Project, 我正在使用APE-Project,

Is it better to have 10,000 connected users or 10,000 pages that use a setInterval() to send each N milliseconds a request to a PHP page? 有10,000个连接用户或10,000个页面使用setInterval()将每个N毫秒的请求发送到PHP页面更好吗?

Thanks 谢谢

APE claims it can scale upto 100k connections per machine. APE声称它可以扩展到每台机器100k连接。 It's using proper evented I/O so it just scales becuase it doesn't have one thread/process per connection. 它正在使用适当的事件I / O,所以它只是缩放,因为它没有每个连接一个线程/进程。

Just use 10000 connected clients with web sockets. 只需使用10000个连接的客户端和Web套接字。

PHP isn't well known to be able to handle large amounts of concurrent long-lived connections. 众所周知,PHP无法处理大量并发长期连接。 If you decide to use PHP you might want to use setInterval to pull updates from the server. 如果您决定使用PHP,则可能需要使用setInterval从服务器提取更新。 This way you don't have to keep expensive connections open. 这样您就不必保持昂贵的连接打开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM