| |

VerySource

 Forgot password?
 Register
Search
View: 857|Reply: 3

Message queue processing is slow

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-6 13:00:01
| Show all posts |Read mode
Recently, the news column is used to count the PV of each news on the website. The specific solution is as follows:
Whenever a user visits a news on an asp.net web page, the ID of the news is sent to the message queue, and then a background window service is used to asynchronously process the messages in the message queue. Each time a message is received, the ID in the database is processed. The PV value equal to the news of the received ID accumulates 1, the server uses the window 2003 database is sql server 2005! It is found that when a user has a large number of simultaneous views during a certain period of time, there will be a slow message processing phenomenon, and many messages are accumulated in the message queue. Waiting for processing! The message queue has no size limit! May I ask if any experts have encountered this problem, please advise solutions! Thank you!
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-7 09:03:01
| Show all posts
I don't think there is a good way to solve this problem. I can only find some compromises, such as classifying messages and putting them in different MQs. In addition, try to use Recive instead of peek methods to ensure that the Keep as few messages as possible.

If there are not many news IDs, you can also set an MQ for each ID. When the user accesses an ID, only an empty message is sent to the corresponding MQ, so that there is no need to judge each message.

The above is for reference only :)
Reply

Use magic Report

0

Threads

8

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-7 14:27:01
| Show all posts
Message queue processing is slow. This is primarily a problem with your handlers. If your window service processing efficiency is high enough, why is there a backlog?
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-10 20:36:02
| Show all posts
Thank you for your guidance. My situation is as follows:
Currently more than 40,000 news is stored in the database, and it will continue to increase in the future! So it's impossible to have a queue per news
In addition, news is divided into large and small categories, a certain news must belong to a certain big category, and a small category under this big category, the structure of the message I send is such a composition
News ID + "|" + News category ID + "|" + News category ID
When the window service receives it, it uses a regular expression to separate the IDs in the message according to the vertical lines in the message, and then calls a stored procedure in the database, taking these 3 IDs as parameters, and the news ID is used to update a single piece of news. Of the news, the news sub-category ID is used to update the total PV of the sub-category, and the news sub-category ID is used to update the general PV of the sub-category! Please enlighten masters what the problem is! Thank you!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list