# Queue Service Configuration

For sites that need to handle a large number of email dispatches or background tasks, configuring a queue is essential.

# Why is a Queue Needed?

A queue allows time-consuming tasks (such as sending order emails or generating language packs) to be executed asynchronously in the background, preventing frontend page freezes.

# Systemd Configuration Example (Linux)

It is recommended to create a beikeshop.service on your server to keep the queue process running persistently:

[Unit]
Description=BeikeShop Queue Worker

[Service]
Type=simple
User=www
Restart=on-failure
ExecStart=/usr/bin/php /path/to/your/website/root/artisan queue:work --queue=default

[Install]
WantedBy=multi-user.target

Save and exit.

# Service Management Commands

After the service is created, you can manage the beikeshop.service with the following commands:

sudo systemctl start beikeshop.service // Start
sudo systemctl stop beikeshop.service // Stop
sudo systemctl restart beikeshop.service // Restart
sudo systemctl status beikeshop.service // Check status
sudo systemctl enable beikeshop.service // Enable on boot