Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have a simple Symfony application hosted on a DigitalOcean Droplet. It is a private application with a password-protected dashboard (apache) and there are a few background processes. That’s why I chose the following droplet for now:
The background processes run via the Symfony Messenger. I have introduced the following systemd program for this:
[Unit]
Description=Symfony messenger-consume %i (async)
[Service]
ExecStart=php /var/www/html/current/bin/console messenger:consume async -vv --time-limit=3600 --memory-limit=372M
Restart=always
RestartSec=30
WorkingDirectory=/var/www/html/current
StandardOutput=append:/var/www/html/shared/var/log/systemd/messenger-async.log
StandardError=append:/var/www/html/shared/var/log/systemd/messenger-async.log
[Install]
WantedBy=default.target
The –time-limit=3600 option terminates the program after one hour and then restarts it automatically. With the option –memory-limit=372M this also happens when the memory has been reached.
The configured log file shows that this works:
[OK] Consuming messages from transport "async".
// The worker will automatically exit once it has exceeded 372M of memory, been
// running for 3600s or received a stop signal via the messenger:stop-workers
// command.
// Quit the worker with CONTROL-C.
19:42:25 INFO [messenger] Stopping worker. ["transport_names" => ["async"]]
19:42:25 INFO [messenger] Worker stopped due to time limit of 3600s exceeded ["timeLimit" => 3600]
[OK] Consuming messages from transport "async".
// The worker will automatically exit once it has exceeded 372M of memory, been
// running for 3600s or received a stop signal via the messenger:stop-workers
// command.
// Quit the worker with CONTROL-C.
20:42:57 INFO [messenger] Stopping worker. ["transport_names" => ["async"]]
20:42:57 INFO [messenger] Worker stopped due to time limit of 3600s exceeded ["timeLimit" => 3600]
...
After some time, the program is terminated because it seems to receive a signal 15 from somewhere:
[OK] Consuming messages from transport "async".
// The worker will automatically exit once it has exceeded 372M of memory, been
// running for 3600s or received a stop signal via the messenger:stop-workers
// command.
// Quit the worker with CONTROL-C.
22:18:27 INFO [messenger] Received signal 15. ["signal" => 15,"transport_names" => ["async"]]
22:18:27 INFO [messenger] Stopping worker. ["transport_names" => ["async"]]
However, the program will no longer restart automatically after this. Only when I reconnect to the server via SSH does the program start again automatically. Does anyone have any idea what could be causing my program to terminate and why it only restarts when I connect to the server? I can’t see anything in the graphs of the droplet, for example there is no utilization above 75%.
ebeecroft
Noor Ellis
384d3f11289345379905a243f7b817
IsaacMvd
Ervan Agus
Teckno
dc1bce8262314f84b368813178d9e4
gerard
gerard
Stan Flint