Skip to content

Auto restart based on condition #671

@lermontex

Description

@lermontex

Describe you feature request

Is your feature request related to a problem? Please describe.
There are some known issues with connecting to the database #290, #233, #438, and there may be other reasons to limit the web server's runtime

Describe the solution you'd like
How about implementing the ability to automatically restart the web server when certain limits are reached? A similar feature is supported in Symfony Messenger:

Don't Let Workers Run Forever
Some services (like Doctrine's EntityManager) will consume more memory over time. So, instead of allowing your worker to run forever, use a flag like messenger:consume --limit=10 to tell your worker to only handle 10 messages before exiting (then the process manager will create a new process). There are also other options like --memory-limit=128M and --time-limit=3600.

Stopping Workers That Encounter Errors
If a worker dependency like your database server is down, or timeout is reached, you can try to add reconnect logic, or just quit the worker if it receives too many errors with the --failure-limit option of the messenger:consume command.

https://symfony.com/doc/current/messenger.html#deploying-to-production

This way it would be possible to set up several containers using Docker Swarm (for example) and achieve uninterrupted operation of the web server

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy