A classic question, how to push messages to 5 million users as quickly as possible

  1. 5 million users belong to users who are finally filtered out to meet specific criteria, and filtering should also be counted as
  2. .
  3. the server is configured with 4 cores of 8G
  4. MySQL Master / Slave Service
  5. can be matched with cached database and message queue
  6. discuss the optimal solution
Php
Feb.27,2021

Damn it, don't five people dare to say anything if they pay attention to it? Step on me after the comments upstairs, as for it.

I pretended to ask and answer myself. (in fact, the landlord mainly saw a classmate answer a similar question last time. The answer was very good, but he forgot what it was called.

Damn it, don't five people dare to say anything if they pay attention to it? Step on me after the comments upstairs, as for it.

I pretended to ask and answer myself. (in fact, the landlord mainly saw a classmate answer a similar question last time. The answer was very good, but he forgot what it was called.
< H2 > Step 1. Filter data < / H2 >

Multi-process [cooperative process] to read and filter qualified policies set by user ID, from the library to avoid repeated queries. It took about two hours for 500W to drive 20 processes on a 4-core 8G machine. I haven't tried it yet. If you have relevant stress test experience. Thank you for your advice. Complete the data filtering and get the 480W users who need to be pushed, and put the 480W user packets into the cache [message queue]

< H2 > Step 2. Multi-process push < / H2 >

Open the multi-process [cooperative process] model to get the data from the cache [message queue] in which key-value pairs are assigned in advance, and then distribute it to users

< H2 > think about problems < / H2 >
  1. how to do cloud control well, for example, the operator MM accidentally wrote typos and pushed them out. I think suddenly Stop, makes it impossible for some users who have not been pushed to receive
  2. how to make regular backups without traversing the whole table?
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e87851-685d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e87851-685d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?