<@ULVA73B9P> i have prefect server running on ubuntu which on service restart runs for few minute th...
s
@Marvin i have prefect server running on ubuntu which on service restart runs for few minute then lost again on restart works for few minutes [Unit] Description=Prefect Server After=network.target [Service] User=root WorkingDirectory=/ ExecStart=/home/ubuntu/prefect-server/prefect-env/bin/prefect server start --host 0.0.0.0 Restart=always [Install] WantedBy=multi-user.target
m
thought for 117.9 seconds
A few things stand out immediately: 1. Your unit is using
Restart=always
, so if Prefect exits/crashes, systemd will keep bringing it back, but that does not fix the underlying issue. 2.
prefect server start
is fine for testing/small setups, but for a long-running server on Ubuntu, the first thing to check is why it is dying or becoming unhealthy. 3. Your current service file has no logging settings and no explicit database/backend config, so it may be defaulting to SQLite, which can become unstable under concurrent usage. Most likely causes - Prefect process is crashing after startup - SQLite locking / DB issues - background services inside
prefect server start
are failing - reverse proxy / keep-alive timeout mismatch if you access it through nginx or LB First: check the actual logs Run these right after it “disappears”:
Copy code
bash
sudo systemctl status prefect-server
sudo journalctl -u prefect-server -n 200 --no-pager
sudo journalctl -u prefect-server -f
Also check whether the port is still listening:
Copy code
bash
ss -lntp | grep 4200
If nothing is listening on 4200, the process likely died. Your current service file is too minimal I would change it to this as a safer baseline:
Copy code
ini
[Unit]
Description=Prefect Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/home/ubuntu/prefect-server
Environment="PREFECT_SERVER_API_HOST=0.0.0.0"
Environment="PREFECT_SERVER_API_PORT=4200"
Environment="PREFECT_SERVER_API_KEEPALIVE_TIMEOUT=60"
Environment="PREFECT_SERVER_LOGGING_LEVEL=DEBUG"
ExecStart=/home/ubuntu/prefect-server/prefect-env/bin/prefect server start --host 0.0.0.0 --port 4200 --keep-alive-timeout 60
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
Then reload and restart:
Copy code
bash
sudo systemctl daemon-reload
sudo systemctl restart prefect-server
sudo systemctl status prefect-server
Important note about SQLite If you did not configure
PREFECT_API_DATABASE_CONNECTION_URL
, Prefect Server may be using SQLite by default. That can work for light/local use, but it is a common cause of instability. For a more reliable setup, use PostgreSQL:
Copy code
ini
Environment="PREFECT_API_DATABASE_CONNECTION_URL=<postgresql+asyncpg://USER:PASSWORD@HOST:5432/prefect>"
Better production-style approach Instead of running everything in one process, run: - API only:
Copy code
bash
prefect server start --no-services
- background services separately:
Copy code
bash
prefect server services start
That means two systemd services instead of one. This is generally more stable. Why this may “work for a few minutes” That pattern often means: - startup succeeds - some background component fails later - DB locks accumulate - proxy timeout disconnects clients - process exits and systemd restarts it If you use nginx If Prefect is behind nginx, check proxy timeout settings too. A too-short timeout can make Prefect look dead even when the process is still up. Useful CLI reference
prefect server start --help
confirms these options exist: -
--host
-
--port
-
--keep-alive-timeout
-
--log-level
-
--no-services
Relevant docs / references - Prefect docs: Prefect documentation - Prefect repo: GitHub repo If you want, send me the output of:
Copy code
bash
sudo journalctl -u prefect-server -n 200 --no-pager
and I can help identify the exact failure.
s
@Marvin Version: 3.7.7 API version: 0.8.4 Python version: 3.10.12 Git commit: 743957b8 Built: Thu, Jul 02, 2026 09:16 PM OS/Arch: linux/x86_64 Profile: ephemeral Server type: ephemeral Pydantic version: 2.13.4 Server: Database: sqlite SQLite version: 3.37.2 Server Settings home: /root/.prefect profiles_path: /root/.prefect/profiles.toml debug_mode: false api: { "url": "140.245.24.46/api", "auth_string": null, "key": null, "tls_insecure_skip_verify": false, "ssl_cert_file": null, "enable_http2": false, "request_timeout": 60 } cli: { "colors": true, "prompt": null, "wrap_lines": true } client: { "max_retries": 5, "retry_jitter_factor": 0.2, "retry_extra_codes": [], "csrf_support_enabled": true, "custom_headers": {}, "metrics": { "enabled": false, "port": 4201 } } cloud: { "api_url": "api.prefect.cloud/api", "enable_orchestration_telemetry": true, "max_log_size": 25000, "ui_url": "app.prefect.cloud" } deployments: { "default_work_pool_name": null, "default_docker_build_namespace": null } experiments: { "warn": true, "plugins": { "enabled": false, "allow": [], "deny": [], "setup_timeout_seconds": 20, "strict": false, "safe_mode": false } } flows: { "heartbeat_frequency": null, "default_retries": 0, "default_retry_delay_seconds": 0 } internal: { "logging_level": "ERROR" } logging: { "level": "INFO", "config_path": "/root/.prefect/logging.yml", "extra_loggers": [], "log_prints": false, "colors": true, "markup": false, "to_api": { "enabled": true, "batch_interval": 2, "batch_size": 4000000, "max_log_size": 1000000, "when_missing_flow": "warn" } } results: { "default_serializer": "pickle", "persist_by_default": false, "default_storage_block": null, "local_storage_path": "/root/.prefect/storage" } runner: { "process_limit": 5, "poll_frequency": 10, "crash_on_cancellation_failure": false, "server": { "enable": false, "host": "localhost", "port": 8080, "log_level": "ERROR", "missed_polls_tolerance": 2 } } server: { "logging_level": "WARNING", "analytics_enabled": true, "metrics_enabled": false, "log_retryable_errors": false, "register_blocks_on_start": true, "memoize_block_auto_registration": true, "memo_store_path": "/root/.prefect/memo_store.toml", "deployment_schedule_max_scheduled_runs": 50, "api": { "auth_string": null, "host": "127.0.0.1", "port": 4200, "base_path": null, "default_limit": 200, "keepalive_timeout": 5, "csrf_protection_enabled": false, "csrf_token_expiration": "PT1H", "cors_allowed_origins": "*", "cors_allowed_methods": "*", "cors_allowed_headers": "*" }, "concurrency": { "lease_storage": "prefect.server.concurrency.lease_storage.memory", "initial_deployment_lease_duration": 300, "maximum_concurrency_slot_wait_seconds": 30 }, "database": { "sqlalchemy": { "connect_args": { "application_name": null, "search_path": null, "statement_cache_size": null, "prepared_statement_cache_size": null, "tls": { "enabled": false, "ca_file": null, "cert_file": null, "key_file": null, "check_hostname": true } }, "pool_size": 5, "pool_recycle": 3600, "pool_timeout": 30, "max_overflow": 10 }, "connection_url": "**********", "driver": null, "host": null, "port": null, "user": null, "name": null, "password": null, "echo": false, "migrate_on_start": true, "timeout": 10, "connection_timeout": 5 }, "deployments": { "concurrency_slot_wait_seconds": 30 }, "docket": { "name": "prefect-server", "url": "memory://" }, "ephemeral": { "enabled": false, "startup_timeout_seconds": 20 }, "events": { "stream_out_enabled": true, "related_resource_cache_ttl": "PT5M", "maximum_labels_per_resource": 500, "maximum_related_resources": 100, "maximum_size_bytes": 1500000, "expired_bucket_buffer": "PT1M", "proactive_granularity": "PT5S", "retention_period": "P7D", "maximum_websocket_backfill": "PT15M", "websocket_backfill_page_size": 250, "messaging_broker": "prefect.server.utilities.messaging.memory", "messaging_cache": "prefect.server.utilities.messaging.memory", "causal_ordering": "prefect.server.events.ordering.memory", "maximum_event_name_length": 1024 }, "flow_run_graph": { "max_nodes": 10000, "max_artifacts": 10000 }, "logs": { "stream_out_enabled": false, "stream_publishing_enabled": false }, "services": { "cancellation_cleanup": { "enabled": true, "loop_seconds": 20 }, "event_persister": { "enabled": true, "batch_size": 20, "read_batch_size": 1, "flush_interval": 5, "batch_size_delete": 10000, "queue_max_size": 50000, "max_flush_retries": 5 }, "event_logger": { "enabled": false }, "foreman": { "enabled": true, "loop_seconds": 15, "inactivity_heartbeat_multiple": 3, "fallback_heartbeat_interval_seconds": 30, "deployment_last_polled_timeout_seconds": 60, "work_queue_last_polled_timeout_seconds": 60 }, "late_runs": { "enabled": true, "loop_seconds": 5, "after_seconds": "PT15S" }, "scheduler": { "enabled": true, "loop_seconds": 60, "deployment_batch_size": 100, "max_runs": 100, "min_runs": 3, "max_scheduled_time": "P100D", "min_scheduled_time": "PT1H", "insert_batch_size": 500, "recent_deployments_loop_seconds": 5 }, "pause_expirations": { "enabled": true, "loop_seconds": 5 }, "repossessor": { "enabled": true, "loop_seconds": 15 }, "task_run_recorder": { "enabled": true, "read_batch_size": 1, "batch_size": 1, "flush_interval": 5 }, "triggers": { "enabled": true, "read_batch_size": 1, "pg_notify_reconnect_interval_seconds": 10, "pg_notify_heartbeat_interval_seconds": 5 } }, "tasks": { "tag_concurrency_slot_wait_seconds": 30, "max_cache_key_length": 2000, "scheduling": { "max_scheduled_queue_size": 1000, "max_retry_queue_size": 100, "pending_task_timeout": "PT0S" } }, "ui": { "enabled": true, "v2_enabled": false, "api_url": "140.245.24.46/api", "serve_base": "/", "static_directory": null, "show_promotional_content": true } } tasks: { "refresh_cache": false, "default_no_cache": false, "disable_caching": false, "default_retries": 0, "default_retry_delay_seconds": 0, "default_persist_result": null, "runner": { "thread_pool_max_workers": null, "process_pool_max_workers": null }, "scheduling": { "default_storage_block": null, "delete_failed_submissions": true } } testing: { "test_mode": false, "unit_test_mode": false, "unit_test_loop_debug": true, "test_setting": "FOO" } worker: { "debug_mode": false, "heartbeat_seconds": 30, "query_seconds": 10, "prefetch_seconds": 10, "enable_cancellation": false, "cancellation_poll_seconds": 120, "webserver": { "host": "0.0.0.0", "port": 8080 } }
m
Your message was too long, here's your message at the allowed limit: Version 3 7 7 API version 0 8 4 Python version 3 10 12 Git commit 743957b8 Built Thu Jul 02 2026 09 16 PM OS/Arch linux/x86_64 Profile ephemeral Server type ephemeral Pydantic version 2 13 4 Server Database sqlite SQLite version 3 37 2 Server Settings home /root/ prefect profiles_path /root/ prefect/profiles toml debug_mode false api { url <http //140 245 24 46 4200/api|140 245 24 46/api> auth_string null key null tls_insecure_skip_verify false ssl_cert_file null enable_http2 false request_timeout 60 } cli { colors true prompt null wrap_lines true } client { max_retries 5 retry_jitter_factor 0 2 retry_extra_codes [] csrf_support_enabled true custom_headers {} metrics { enabled false port 4201 } } cloud { api_url <https //api prefect cloud/api|api prefect cloud/api> enable_orchestration_telemetry true max_log_size 25000 ui_url <https //app prefect cloud|app prefect cloud> } deployments { default_work_pool_name null default_docker_build_namespace null } experiments { warn true plugins { enabled false allow [] deny [] setup_timeout_seconds 20 strict false safe_mode false } } flows { heartbeat_frequency null default_retries 0 default_retry_delay_seconds 0 } internal { logging_level ERROR } logging { level INFO config_path /root/ prefect/logging yml extra_loggers [] log_prints false colors true markup false to_api { enabled true batch_interval 2 batch_size 4000000 max_log_size 1000000 when_missing_flow warn } } results { default_serializer pickle persist_by_default false default_storage_block null local_storage_path /root/ prefect/storage } runner { process_limit 5 poll_frequency 10 crash_on_cancellation_failure false server { enable false host localhost port 8080 log_level ERROR missed_polls_tolerance 2 } } server { logging_level WARNING analytics_enabled true metrics_enabled false log_retryable_errors false register_blocks_on_start true memoize_block_auto_registration true memo_store_path /root/ prefect/memo_store toml deployment_schedule_max_scheduled_runs 50 api { auth_string null host 127 0 0 1 port 4200 base_path null default_limit 200 keepalive_timeout 5 csrf_protection_enabled false csrf_token_expiration PT1H cors_allowed_origins * cors_allowed_methods * cors_allowed_headers * } concurrency { lease_storage prefect server concurrency lease_storage memory initial_deployment_lease_duration 300 maximum_concurrency_slot_wait_seconds 30 } database { sqlalchemy { connect_args { application_name null search_path null statement_cache_size null prepared_statement_cache_size null tls { enabled false ca_file null cert_file null key_file null check_hostname true } } pool_size 5 pool_recycle 3600 pool_timeout 30 max_overflow 10 } connection_url ****** driver null host null port null user null name null password null echo false migrate_on_start true timeout 10 connection_timeout 5 } deployments { concurrency_slot_wait_seconds 30 } docket { name prefect-server url memory // } ephemeral { enabled false startup_timeout_seconds 20 } events { stream_out_enabled true related_resource_cache_ttl PT5M maximum_labels_per_resource 500 maximum_related_resources 100 maximum_size_bytes 1500000 expired_bucket_buffer PT1M proactive_granularity PT5S retention_period P7D maximum_websocket_backfill PT15M websocket_backfill_page_size 250 messaging_broker prefect server utilities messaging memory messaging_cache prefect server utilities messaging memory causal_ordering prefect server events ordering memory maximum_event_name_length 1024 } flow_run_graph { max_nodes 10000 max_artifacts 10000 } logs { stream_out_enabled false stream_publishing_enabled false } services { cancellation_cleanup { enabled true loop_seconds 20 } event_persister { enabled true batch_size 20 read_batch_size 1 flush_interval 5 batch_size_delete 10000 queue_max_size 50000 max_flush_retries 5 } event_logger { enabled false } foreman { enabled true loop_seconds 15 inactivity_heartbeat_multiple 3 fallback_heartbeat_interva
l_seconds 30 deployment_last_polled_timeout_seconds 60 work_queue_last_polled_timeout_seconds 60 } late_runs { enabled true loop_seconds 5 after_seconds PT15S } scheduler { enabled true loop_seconds 60 deployment_batch_size 100 max_runs 100
s
@Marvin Version: 3.7.7 API version: 0.8.4 Python version: 3.10.12 Git commit: 743957b8 Built: Thu, Jul 02, 2026 09:16 PM OS/Arch: linux/x86_64 Profile: ephemeral Server type: ephemeral Pydantic version: 2.13.4 Server: Database: sqlite SQLite version: 3.37.2 Server Settings
m
thought for 11.8 seconds
That explains a lot. You are running with: - Profile:
ephemeral
- Server type:
ephemeral
- Database:
sqlite
This is very likely the root cause. What this means An ephemeral Prefect server is meant for temporary/local use, not a stable long-running system service. Combined with SQLite, it can easily become unavailable after some activity. For a persistent Ubuntu service, you should switch to a real persistent server configuration, especially: - a non-ephemeral profile - PostgreSQL instead of SQLite Why your current setup is fragile -
ephemeral
mode is not intended for production-like hosting - SQLite is not a good long-running multi-request backend for Prefect Server - restarting the service temporarily clears the bad state, so it appears to “work for a few minutes” Recommended fix Use a persistent profile and configure PostgreSQL. Step 1: create a real Prefect home For example:
Copy code
bash
mkdir -p /home/ubuntu/.prefect
Step 2: install and run PostgreSQL If PostgreSQL is not already installed:
Copy code
bash
sudo apt update
sudo apt install postgresql postgresql-contrib
Create database/user:
Copy code
bash
sudo -u postgres psql
Then inside psql:
Copy code
sql
CREATE DATABASE prefect;
CREATE USER prefect WITH PASSWORD 'prefectpassword';
GRANT ALL PRIVILEGES ON DATABASE prefect TO prefect;
\q
Step 3: update your systemd service Use something like this:
Copy code
ini
[Unit]
Description=Prefect Server
After=network-online.target postgresql.service
Wants=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/home/ubuntu/prefect-server
Environment="PREFECT_HOME=/home/ubuntu/.prefect"
Environment="PREFECT_SERVER_API_HOST=0.0.0.0"
Environment="PREFECT_SERVER_API_PORT=4200"
Environment="PREFECT_SERVER_API_KEEPALIVE_TIMEOUT=60"
Environment="PREFECT_SERVER_LOGGING_LEVEL=DEBUG"
Environment="PREFECT_API_DATABASE_CONNECTION_URL=<postgresql+asyncpg://prefect:prefectpassword@127.0.0.1:5432/prefect>"
ExecStart=/home/ubuntu/prefect-server/prefect-env/bin/prefect server start --host 0.0.0.0 --port 4200 --keep-alive-timeout 60
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
Then reload:
Copy code
bash
sudo systemctl daemon-reload
sudo systemctl restart prefect-server
sudo systemctl status prefect-server
Step 4: verify it is no longer ephemeral Run:
Copy code
bash
/home/ubuntu/prefect-server/prefect-env/bin/prefect version
You want to stop seeing: -
Profile: ephemeral
-
Server type: ephemeral
Step 5: check API health
Copy code
bash
curl <http://127.0.0.1:4200/api/health>
If exposed externally:
Copy code
bash
curl <http://YOUR_SERVER_IP:4200/api/health>
Optional but recommended For better stability, separate the API and services: - API:
Copy code
bash
prefect server start --no-services
- background services:
Copy code
bash
prefect server services start
That means 2 systemd units instead of 1. Very important If you are connecting to this server from clients/agents/workers, also set:
Copy code
bash
PREFECT_API_URL=<http://YOUR_SERVER_IP:4200/api>
What I think is happening right now Your systemd unit starts Prefect, but because it is using an ephemeral + SQLite setup, it is acting like a temporary local server rather than a durable service. That is why it comes back after restart, then fails again. If you want, I can give you: 1. a complete corrected systemd file for single-service Prefect Server, or 2. a better 2-service setup with separate API + background services.
s
@Marvin great now its working for now what we changed and what to take care ongoing to as maintenance
m
thought for 12.4 seconds
Great — the main change was moving away from the temporary/default setup toward a persistent server configuration. What changed Before, your server was effectively running with: -
ephemeral
profile -
ephemeral
server type -
sqlite
database That combination is okay for local testing, but not for a long-running Ubuntu service. What we changed conceptually: - set a persistent
PREFECT_HOME
- stopped relying on the ephemeral/default profile - configured a real database backend instead of SQLite - improved the systemd service so logging/restarts are more controlled - increased keep-alive timeout to reduce connection drops Why it helped - Ephemeral mode is temporary by design - SQLite can become unstable under concurrent requests - PostgreSQL is much better for a continuously running Prefect server - better systemd settings make failures easier to detect and recover from Ongoing maintenance: what to take care of 1. Watch the service logs Regularly check:
Copy code
bash
sudo journalctl -u prefect-server -n 100 --no-pager
For live logs:
Copy code
bash
sudo journalctl -u prefect-server -f
Look for: - database connection errors - repeated restarts - timeout errors - migration failures 2. Monitor service health Check if the API is healthy:
Copy code
bash
curl <http://127.0.0.1:4200/api/health>
You can also confirm the service is active:
Copy code
bash
sudo systemctl status prefect-server
3. Maintain PostgreSQL Now that PostgreSQL is the backend, ongoing care includes: - make regular backups - monitor disk usage - ensure PostgreSQL service is running - rotate logs if needed Basic checks:
Copy code
bash
sudo systemctl status postgresql
df -h
4. Avoid going back to SQLite / ephemeral If Prefect starts again in ephemeral mode, you may see the same issue return. Periodically confirm:
Copy code
bash
/home/ubuntu/prefect-server/prefect-env/bin/prefect version
You should not see: -
Profile: ephemeral
-
Server type: ephemeral
5. Be careful during upgrades When upgrading Prefect: - upgrade in a maintenance window - back up PostgreSQL first - restart the service after upgrade - watch logs for migration issues Example:
Copy code
bash
source /home/ubuntu/prefect-server/prefect-env/bin/activate
pip install -U prefect
sudo systemctl restart prefect-server
Then verify:
Copy code
bash
sudo journalctl -u prefect-server -n 100 --no-pager
6. Check systemd restart behavior Sometimes repeated crashes can get hidden because systemd keeps restarting the service. Check restart counts with:
Copy code
bash
sudo systemctl status prefect-server
If it keeps restarting, inspect logs immediately. 7. If using nginx or a reverse proxy Keep timeout settings aligned. Otherwise Prefect may appear unavailable even when it is running. 8. Consider separating API and services later If usage grows, a better setup is: - one service for
prefect server start --no-services
- another for
prefect server services start
That makes troubleshooting easier and improves stability. Simple maintenance checklist - check
systemctl status prefect-server
- check
/api/health
- review logs - back up PostgreSQL - watch disk space and memory - verify Prefect upgrades carefully Good practice commands
Copy code
bash
sudo systemctl status prefect-server
sudo journalctl -u prefect-server -n 100 --no-pager
curl <http://127.0.0.1:4200/api/health>
sudo systemctl status postgresql
df -h
If you want, I can also give you a small weekly maintenance checklist or a backup + monitoring script for your Prefect server.
s
@Marvin where the retention periods are defined to make the cleanup auto
m
thought for 68.2 seconds
Yes — in self-hosted Prefect Server, retention is controlled by server settings / environment variables. Main place retention is defined For automatic cleanup, the key settings are: ### 1. Events retention This controls how long events are kept:
Copy code
bash
PREFECT_SERVER_EVENTS_RETENTION_PERIOD
Default: -
7 days
### 2. Flow run cleanup retention This controls cleanup of old flow runs and their orphaned logs/artifacts:
Copy code
bash
PREFECT_SERVER_SERVICES_DB_VACUUM_RETENTION_PERIOD
Default: -
90 days
But important: flow run cleanup is not active unless enabled. You must enable vacuum cleanup with:
Copy code
bash
PREFECT_SERVER_SERVICES_DB_VACUUM_ENABLED=events,flow_runs
If you leave it at default, typically only event cleanup is enabled. --- What gets auto-cleaned When flow-run vacuum is enabled, Prefect can clean up: - old flow runs - orphaned logs - orphaned artifacts For logs and artifacts, there is not usually a separate retention setting — they are cleaned when their related flow runs are removed. --- Example systemd settings You can add these to your service file:
Copy code
ini
Environment="PREFECT_SERVER_SERVICES_DB_VACUUM_ENABLED=events,flow_runs"
Environment="PREFECT_SERVER_SERVICES_DB_VACUUM_RETENTION_PERIOD=30d"
Environment="PREFECT_SERVER_EVENTS_RETENTION_PERIOD=7d"
Environment="PREFECT_SERVER_SERVICES_DB_VACUUM_LOOP_SECONDS=3600"
Or if your version expects seconds, use explicit seconds:
Copy code
ini
Environment="PREFECT_SERVER_SERVICES_DB_VACUUM_RETENTION_PERIOD=2592000"
Environment="PREFECT_SERVER_EVENTS_RETENTION_PERIOD=604800"
Then reload systemd:
Copy code
bash
sudo systemctl daemon-reload
sudo systemctl restart prefect-server
--- Recommended practical setup A common setup is:
Copy code
ini
Environment="PREFECT_SERVER_SERVICES_DB_VACUUM_ENABLED=events,flow_runs"
Environment="PREFECT_SERVER_SERVICES_DB_VACUUM_RETENTION_PERIOD=30d"
Environment="PREFECT_SERVER_EVENTS_RETENTION_PERIOD=7d"
That means: - keep flow/task run history for 30 days - keep events for 7 days - clean related logs/artifacts as old runs are deleted --- How to verify current settings Run:
Copy code
bash
prefect config view | grep -i "retention\|vacuum"
and check logs for vacuum activity:
Copy code
bash
sudo journalctl -u prefect-server -f
--- Important caveat Prefect does not automatically clean everything. Things like: - deployments - work pools - blocks - variables - some metadata are not generally pruned by retention settings. --- Relevant docs - Database maintenance: Database maintenance - Self-hosted server docs: Self-hosted Prefect - Settings reference: Settings reference If you want, I can help you create the exact retention lines to add into your current systemd service for: - 7 days - 30 days - 90 days depending on how much history you want to keep.