Improved scalability can be achieved by activating the queuing mechanism for email and page opens. Use this if you are getting too much traffic at once from people opening pages or opening emails.
NOTE: Mautic 3.x users who are implementing RabbitMQ or Beanstalkd need to configure the settings directly in their local configuration file. If you are using the legacy Mautic 2.x series the steps below remains the same.
You can activate and configure the queuing mechanism by going to configuration:
RabbitMQ is one of the available queue protocols that Mautic supports. In order to use it, you must have a RabbitMQ server running. Instructions on how to install RabbitMQ can be obtained on their website. For testing purposes, you can use you can use cloudamqp which offers a RabbitMQ as a service.
Once you have setup a RabbitMQ server, you can configure Mautic to use it by setting the appropriate parameters (
mautic.rabbitmq_*) in your installation's configuration file.
|rabbitmq_host||The hostname of the RabbitMQ server|
|rabbitmq_port||The port that the RabbitMQ server is listening on|
|rabbitmq_vhost||The virtual host to use for this RabbitMQ server|
|rabbitmq_user||The username for the RabbitMQ server|
|rabbitmq_password||The password for the RabbitMQ server|
|rabbitmq_idle_timeout||The number of seconds after which the queue consumer should timeout when idle|
|rabbitmq_idle_timeout_exit_code||The exit code to be returned when the consumer exits due to idle timeout|
Beanstalkd is another available queue protocol that Mautic supports. In order to use it, you must have a Beanstalkd server running. Instructions on how to install Beanstalkd can be obtained on their website.
Once you have setup a Beanstalkd server, you can configure mautic to use it by setting the appropriate parameters (
mautic.beanstalkd_*) in your installation's configuration file.
|beanstalkd_host||The hostname of the Beanstalkd server|
|beanstalkd_port||The port that the Beanstalkd server is listening on|
|beanstalkd_timeout||The default TTR for Beanstalkd jobs|
Once the queuing mechanism is activated, any page hits and email opens will be queued up to be processed later. To process them, you will need to run some console commands on a regular basis.
Processing page hits is done by using the following command:
php /path/to/mautic/bin/console mautic:queue:process --env=prod -i page_hit
Processing email hits is done by using the following command:
php /path/to/mautic/bin/console mautic:queue:process --env=prod -i email_hit
When these commands are run, they will continue to run until you stop the program by using the keyboard combination
Control + C. If you want to run them to process only, say, 50 page hits or email hits, you can run the command like this instead:
php /path/to/mautic/bin/console mautic:queue:process --env=prod -i page_hit -m 50
php /path/to/mautic/bin/console mautic:queue:process --env=prod -i email_hit -m 50
You need to run the following cron to keep pushing the jobs.
php /path/to/mautic/bin/console mautic:email:send
See the documentation on cron jobs for further information.
Found errors? Think you can improve this documentation? edit this page