Table of Contents
回复内容:
Home Backend Development PHP Tutorial mysql - 关于PHP邮件群发多进程问题

mysql - 关于PHP邮件群发多进程问题

Jun 06, 2016 pm 08:45 PM
apache linux mysql nginx php

我现在要给100000个邮箱账号发送邮件,打算启用一个主进程,然后再fork几个子进程,主进程给每个子进程分配一些邮箱账号,让子进程来实现邮件的发送。(一个主进程+多个子进程 这种方式是我必须要采用的,亲们)

问题是每个子进程在干活的时候,有可能会出问题,比如有的账号邮件没有发送成功,还比如有的子进程执行了一半就死掉了,这时候分配给它的活没干完,我怎么才能把它没干完的活捡起来

我的初步想法是再启个定时任务进程不停的去检测有没有发送失败的邮箱账号或死掉的进程,如果有就捡起来接着执行,但相同的问题也会发生在这个进程的身上,所以我没什么好办法了,来请教大家。。。

回复内容:

我现在要给100000个邮箱账号发送邮件,打算启用一个主进程,然后再fork几个子进程,主进程给每个子进程分配一些邮箱账号,让子进程来实现邮件的发送。(一个主进程+多个子进程 这种方式是我必须要采用的,亲们)

问题是每个子进程在干活的时候,有可能会出问题,比如有的账号邮件没有发送成功,还比如有的子进程执行了一半就死掉了,这时候分配给它的活没干完,我怎么才能把它没干完的活捡起来

我的初步想法是再启个定时任务进程不停的去检测有没有发送失败的邮箱账号或死掉的进程,如果有就捡起来接着执行,但相同的问题也会发生在这个进程的身上,所以我没什么好办法了,来请教大家。。。

开启队列服务,让子进程和主进程通过队列来工作

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the difference between syntax for adding columns in different database systems What is the difference between syntax for adding columns in different database systems Apr 09, 2025 pm 02:15 PM

不同数据库系统添加列的语法为: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: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

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.

Key Linux Operations: A Beginner's Guide Key Linux Operations: A Beginner's Guide Apr 09, 2025 pm 04:09 PM

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 vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

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.

How to build a SQL database How to build a SQL database Apr 09, 2025 pm 04:24 PM

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: Essential Skills for Developers MySQL and SQL: Essential Skills for Developers Apr 10, 2025 am 09:30 AM

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: Adaptations and Innovations The Future of PHP: Adaptations and Innovations Apr 11, 2025 am 12:01 AM

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 Classic 50 Question Answers SQL Classic 50 Question Answers Apr 09, 2025 pm 01:33 PM

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.

See all articles