Home  >  Article  >  Backend Development  >  How to optimize the database part when using SSE to push messages?

How to optimize the database part when using SSE to push messages?

WBOY
WBOYOriginal
2016-12-05 13:44:241381browse

Added a new message reminder function to the old program, which can now be pushed using SSE.
In the background PHP, a query statement is directly executed to see if there is any new message, and if there is, it will be output.

Relatively small site. Mainly worried about whether the server will be under too much pressure? How to improve?

Reply content:

Added a new message reminder function to the old program, which can now be pushed using SSE.
In the background PHP, a query statement is directly executed to see if there is any new message, and if there is, it will be output.

Relatively small site. Mainly worried about whether the server will be under too much pressure? How to improve?

If the number of visits is not large, database query will be sufficient. If the number of visits is large, you can consider redis or the like.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn