Performance of event-source

前端 未结 2 401
逝去的感伤
逝去的感伤 2021-01-20 21:03

I\'m currently working on a large project, which requires server-sent events implementation. I\'ve decided to use event-source transport for it, and started from simple chat

2条回答
  •  逝去的感伤
    2021-01-20 21:15

    • is such technique reasonable to use in moderately loaded web-sites(1000-5000 users on-line)?

    Pretty much the only way of doing it unless you put the refresh timer in the client side and use the server side as web services only. Load will be high with that amount of users but your limited by doing a pure php only solution I'd rather look at a c/c++ daemon on the server and raw sockets

    • if yes, is there any way to boost performance?

    memcached as a temp storage then a back end process to commit the archive hourly / minutely whatever to the mysql db

    • could mySQL database be a bottleneck in this case?

    yes but depends how much hardware you're willing to throw at the solution or how confident you are at setting up something such as master-slave replication using one read and one write db

    Hope that helps

提交回复
热议问题