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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 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)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1253
24
What is the significance of the session_start() function? What is the significance of the session_start() function? May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

macOS and Linux: Compatibility and User Experience macOS and Linux: Compatibility and User Experience Apr 30, 2025 am 12:05 AM

macOS and Linux have their own advantages in compatibility and user experience. macOS has excellent compatibility within the Apple ecosystem, and the user experience is simple and intuitive; Linux has outstanding hardware compatibility and software flexibility. The user experience varies from distribution to distribution, emphasizing personalization and control.

Composer: The Package Manager for PHP Developers Composer: The Package Manager for PHP Developers May 02, 2025 am 12:23 AM

Composer is a dependency management tool for PHP, and manages project dependencies through composer.json file. 1) parse composer.json to obtain dependency information; 2) parse dependencies to form a dependency tree; 3) download and install dependencies from Packagist to the vendor directory; 4) generate composer.lock file to lock the dependency version to ensure team consistency and project maintainability.

What are the advantages of using MySQL over other relational databases? What are the advantages of using MySQL over other relational databases? May 01, 2025 am 12:18 AM

The reasons why MySQL is widely used in various projects include: 1. High performance and scalability, supporting multiple storage engines; 2. Easy to use and maintain, simple configuration and rich tools; 3. Rich ecosystem, attracting a large number of community and third-party tool support; 4. Cross-platform support, suitable for multiple operating systems.

Laravel environment construction and basic configuration (Windows/Mac/Linux) Laravel environment construction and basic configuration (Windows/Mac/Linux) Apr 30, 2025 pm 02:27 PM

The steps to build a Laravel environment on different operating systems are as follows: 1.Windows: Use XAMPP to install PHP and Composer, configure environment variables, and install Laravel. 2.Mac: Use Homebrew to install PHP and Composer and install Laravel. 3.Linux: Use Ubuntu to update the system, install PHP and Composer, and install Laravel. The specific commands and paths of each system are different, but the core steps are consistent to ensure the smooth construction of the Laravel development environment.

Apache's Role in Web Development: Pioneering Technology Apache's Role in Web Development: Pioneering Technology May 01, 2025 am 12:12 AM

Apache's role in web development includes static website hosting, dynamic content services, reverse proxying and load balancing. 1. Static website hosting: Apache has simple configuration and is suitable for hosting static websites. 2. Dynamic content service: Provide dynamic content by combining it with PHP, etc. 3. Reverse proxy and load balancing: As a reverse proxy, it distributes requests to multiple backend servers to achieve load balancing.

Docker and Linux: The Perfect Partnership Docker and Linux: The Perfect Partnership Apr 30, 2025 am 12:02 AM

Docker and Linux are perfect matches because they can simplify the development and deployment of applications. 1) Docker uses Linux's namespaces and cgroups to implement container isolation and resource management. 2) Docker containers are more efficient than virtual machines, have faster startup speeds, and the mirrored hierarchical structure is easy to build and distribute. 3) On Linux, the installation and use of Docker is very simple, with only a few commands. 4) Through DockerCompose, you can easily manage and deploy multi-container applications.

What are the typical use cases for Linux versus Windows? What are the typical use cases for Linux versus Windows? May 03, 2025 am 12:01 AM

Linuxisidealforcustomization,development,andservermanagement,whileWindowsexcelsineaseofuse,softwarecompatibility,andgaming.Linuxoffershighconfigurabilityfordevelopersandserversetups,whereasWindowsprovidesauser-friendlyinterfaceandbroadsoftwaresupport

See all articles