mysql - 关于PHP邮件群发多进程问题
我现在要给100000个邮箱账号发送邮件,打算启用一个主进程,然后再fork几个子进程,主进程给每个子进程分配一些邮箱账号,让子进程来实现邮件的发送。(一个主进程+多个子进程 这种方式是我必须要采用的,亲们)
问题是每个子进程在干活的时候,有可能会出问题,比如有的账号邮件没有发送成功,还比如有的子进程执行了一半就死掉了,这时候分配给它的活没干完,我怎么才能把它没干完的活捡起来
我的初步想法是再启个定时任务进程不停的去检测有没有发送失败的邮箱账号或死掉的进程,如果有就捡起来接着执行,但相同的问题也会发生在这个进程的身上,所以我没什么好办法了,来请教大家。。。
回复内容:
我现在要给100000个邮箱账号发送邮件,打算启用一个主进程,然后再fork几个子进程,主进程给每个子进程分配一些邮箱账号,让子进程来实现邮件的发送。(一个主进程+多个子进程 这种方式是我必须要采用的,亲们)
问题是每个子进程在干活的时候,有可能会出问题,比如有的账号邮件没有发送成功,还比如有的子进程执行了一半就死掉了,这时候分配给它的活没干完,我怎么才能把它没干完的活捡起来
我的初步想法是再启个定时任务进程不停的去检测有没有发送失败的邮箱账号或死掉的进程,如果有就捡起来接着执行,但相同的问题也会发生在这个进程的身上,所以我没什么好办法了,来请教大家。。。
开启队列服务,让子进程和主进程通过队列来工作

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



不同数据库系统添加列的语法为:MySQL:ALTER TABLE table_name ADD column_name data_type;PostgreSQL:ALTER TABLE table_name ADD COLUMN column_name data_type;Oracle:ALTER TABLE table_name ADD (column_name data_type);SQL Server:ALTER TABLE table_name ADD column_name data_

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

Linux beginners should master basic operations such as file management, user management and network configuration. 1) File management: Use mkdir, touch, ls, rm, mv, and CP commands. 2) User management: Use useradd, passwd, userdel, and usermod commands. 3) Network configuration: Use ifconfig, echo, and ufw commands. These operations are the basis of Linux system management, and mastering them can effectively manage the system.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

Building an SQL database involves 10 steps: selecting DBMS; installing DBMS; creating a database; creating a table; inserting data; retrieving data; updating data; deleting data; managing users; backing up the database.

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.

The future of PHP will be achieved by adapting to new technology trends and introducing innovative features: 1) Adapting to cloud computing, containerization and microservice architectures, supporting Docker and Kubernetes; 2) introducing JIT compilers and enumeration types to improve performance and data processing efficiency; 3) Continuously optimize performance and promote best practices.

SQL (Structured Query Language) is a programming language used to create, manage, and query databases. The main functions include: creating databases and tables, inserting, updating and deleting data, sorting and filtering results, aggregating functions, joining tables, subqueries, operators, functions, keywords, data manipulation/definition/control language, connection types, query optimization, security, tools, resources, versions, common errors, debugging techniques, best practices, trends and row locking.
