In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Business requirements
The json data sent by the app client to the server interface is sent once a day and will be sent again after clearing the cache.
Business logic before the problem:
The php interface first converts json into an array to re-insert non-existent data into a large table.
The user already exists and the new id
Enter another table of details
The problem is:
When the user clears the cache due to special circumstances, the app sends json string into the library and the concurrency is high, which causes the CPU to soar to 88% and remain high.
Optimization ideas:
1. Asynchronous queue processing
2. Redis filtering (that is, only the first request of the day is processed)
3. Redis auxiliary storage app name (batch insert data app name table after verification)
4. Splicing, inserting and adding, such as in the details table
Solution:
1. Modify the API redis filter + such as list queue and store the result in redis
First of all, redis puts the previous historical data in the redis hash with the Chinese key name id as the key value.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.