PHP web application and bulk mailing

I developed a web application in which students across the country come and register for academic purposes. It is expected that over the next year, users will be about 100 thousand.

I need to send all these people periodic letters. Web application developed using codeigniter. Php script can run for 3000 seconds. But the application cannot send letters to more than 100 users.

The machine I am running in is in the cloud and has 256 MB of memory. I used the free -m command to check memory usage, but that doesn't seem to be the problem. Everything works fine for 10-20 letters.

What will be the best solutions? Is there a way to transfer this work to another application / program / shell script?

+3
source share
5 answers

It is very useful to get this from your web server threads and into something that works autonomously. Usually for such things I have tables in the database where the relevant information is written from the website, so when I am ready to send by email, something on the backend can collect emails and send them. If you send 100,000 emails, you will need multithreading.

, . Campaign Enterprise, , - ODBC. , , .

: PHP script PHP . , ? (, - . - PHP, set_time_limit().)

0

, cronjob, n . php, . cronjob , .

, / cronjob, .

+1

MailChimp . - , 100 . .

PHP API.

https://developer.mailchimp.com/

+1

, pcntl_fork .

Fork: Using the fork process, you can send emails to groups and send them. each batch can have its own child fork process in it

Daemon: With Daemon, you can create a batch of emails and send them for processing by the daemon. the demon could launch several parties at once.

0
source

Source: https://habr.com/ru/post/1768677/


All Articles