Storage and Performance

Choose where PSF Guard keeps the files it makes, how full their disks may get, and how much of the processor its work may take. This page also covers the header's background jobs, how the server stops, what survives a restart, and the desktop app's log files. To keep copies of settings and catalogs, see Backups.

New in 0.12. The background jobs list splits your work from automatic work and counts queued jobs, waiting jobs and jobs that need your attention. When the server stops, running work reaches a safe point before exit. Shutdown no longer hangs until the service manager kills the server.

Choose where files go

Each database keeps the files PSF Guard generates in three folders, with a slug folder per database in each:

FolderContentsSet with
CacheImage previews, star lists, plate solves, quality scans and other per-image results--cache-dir, [cache] directory
StacksStacks, color previews, WBPP stacks, saved processing, and WBPP runs that have no runs folder of their own--stack-dir, [cache] stack_directory
Calibration mastersMasters built from your calibration frames--calibration-dir, [cache] calibration_directory

Stacks and masters go in the cache unless you set a folder of their own. Set one to put them on another volume: stacks on a large network share, for example, with the cache on a fast local disk. The command line wins over the config file, and both win over Settings.

# On the command line
psf-guard server --stack-dir /mnt/nas/psf-guard/stacks \
  --calibration-dir /mnt/nas/psf-guard/masters

# Or in the server's TOML file
[cache]
stack_directory = "/mnt/nas/psf-guard/stacks"
calibration_directory = "/mnt/nas/psf-guard/masters"

Choose folders in Settings

Open Settings → Storage → Folders, in the desktop app too. Type or browse to a folder for Cache, Stacks or Calibration masters, then click Save folders. Leave Stacks or Calibration masters empty to use the cache. A folder the server's config file fixes reads Set by the server config file and cannot change here. Choosing folders needs database management. Settings asks before closing if you have unsaved folder changes.

The cache, stacks and calibration masters can use separate folders.
The cache, stacks and calibration masters can use separate folders.

A folder saved in Settings takes effect at the next start, which moves the files there first. Until then the field shows the folder still in use. In the desktop app, Restart now restarts the whole app to carry out the move.

Only Settings moves files. A folder changed on the command line or in the config file is used as it is, and the old files stay where they were.

Disk use

Settings → Storage → Disk use shows every volume the three folders sit on: how full it is, its limit, which folders and databases it holds, and how much of it is stacks, calibration masters and image previews.

Review disk use and the cleanup rules. The volume usage limit includes other files on the disk.
Review disk use and the cleanup rules. The volume usage limit includes other files on the disk.

Volume usage limit (90% by default) is the highest share of the whole volume, other files included, that PSF Guard lets it reach, as df counts it. 100% disables automatic cleanup. Changing the limit needs database management.

What PSF Guard deletes when a volume exceeds its limit

Every five minutes, and right after a limit changes, PSF Guard reads each volume. When one is over its limit, PSF Guard deletes only what lives on that volume, in this order:

OrderDeletedRule
1Image previews, annotated previews, star listsLeast recently viewed first, until the volume is two points under its limit. Anything viewed in the last quarter hour stays.
2Stack resume checkpointsA day old or more.
3Calibration mastersUnused for a week, least recently used first. Only while no build runs, and only when that brings the volume back under.
NeverStacks, color previews, WBPP stacksThey take minutes to hours to make.

A preview comes back the next time someone opens the image, and a master is built again from its frames when a stack needs it. A master whose frames are gone, or that the catalog does not record, is never deleted: it could not be built again. A limit changed in Settings checks the volumes at once but leaves masters to the next regular pass.

Limits for stacks and masters

Tick Separate limits for stacks and calibration masters to give folders on their own volumes limits of their own: Stack volume usage limit and Calibration master volume usage limit; the first slider then reads Cache volume usage limit. A volume that holds more than one folder uses the lowest of their limits. A full stack volume never deletes previews from a cache on another disk.

Hourly cleanup

Rebuilds write new files beside old ones. Once an hour, in every database and whatever the disk limit, PSF Guard deletes what nothing uses any more:

WhatDeleted
Stacks a newer build of the same target and channel replacedOnce no index or job refers to them, after a day
Stretch and deconvolution resultsA week after they were last selected or used
Artifact searchesWhen their stack is gone
Stacks of deleted projectsWith the project's index. Merging projects keeps the merged project's stacks.
Stack resume checkpointsAfter 30 days with no build writing or resuming from them. At once when no build could resume from them, such as one from an older stacking pipeline.
Calibration masters a newer master built from the same frames replacedOnce unused for a day and no stack refers to them
Half-written masters a stopped build leftA day old
WBPP run foldersNever: a run's output may exist nowhere else

Masters are swept only while no stack build runs. An index that cannot be read stops the sweep of that database rather than leaving what it refers to unprotected; the server log identifies the file.

Neither the disk limit nor the cleanup touches your frames. To free the space rejected frames take, remove old rejects.

Processor use

Settings → Performance → Processor use sets how many cores each kind of work may use, as a share of the logical cores. A change applies to work that starts after it, without a restart.

Allocate more processor time to interactive work than to background jobs.
Allocate more processor time to interactive work than to background jobs.
ShareCoversDefault
Work you wait onStack builds, color and stretches you start, quality scans you start, previews being looked at50%, or scan_worker_ratio
Background workAutomatic stack refreshes, quality backfill and new-frame analysis in every database, calibration grading, flat measuring, preview pre-generation25%, or background_worker_ratio

Each share is a limit for all such work together, not for each job. Jobs running at once split it: a stack refresh, quality backfill in every database and preview pre-generation share the background share. A job takes the workers free when it starts and gives them back when it ends. It never waits: one that starts while the share is spent runs on one worker. Work you wait on also pauses background work.

The share covers Seiza's own threads. Since Seiza 0.24, each job runs debayering, stretching, star detection and stacking on the workers it was given, so one background preview no longer keeps every core busy. Previews you look at, plate solves, star lists and PSF views still use every core, since background work pauses while they run. Quality scans plate-solve several frames at once, up to their share. RC-Astro's tools are programs of their own and choose their own threads.

A share chosen here is kept in the registry and wins over the config file. Use the default goes back to the file's value. Memory can lower the count further: a pool never holds more frames than half the free memory allows. GET and PUT /api/settings/workers read and set the shares; null means the default.

Background jobs in the header

The header shows background work as one small chip: a progress ring, the overall progress percentage, and an icon with a count for each state with jobs: running (a play mark), queued (a numbered list), waiting (an hourglass) and needs you (a warning triangle). Hover a count to read its name. On a phone the chip leaves out the running count, since the progress percentage already shows running work. Hover, focus or click the chip to open the list.

The jobs chip shows progress and the counts of running, queued and waiting jobs.
The jobs chip shows progress and the counts of running, queued and waiting jobs.

The list shows jobs across all databases under two headings, each with its own counts:

HeadingJobs
Started by youStack preparation, builds and processing runs you start, reprocessing after your builds, quality scans and duplicate checks you asked for, WBPP runs, a catalog refresh you asked for, and backups and transfers started by hand
AutomaticQuality backfill and the analysis of new frames, automatic scans, Measuring flats, Reading frame sites, catalog refreshes on expiry or at start, automatic stack refreshes and reprocessing after those refreshes, scheduled backups, and transfers a connection's policy queued

The list also shows previews, imports, exports, artifact searches and planning transfers to remote sites. Calibration grading, health checks, light-header reads, flat matching and catalog upkeep show their progress here. When you add or change a database, PSF Guard builds its query indexes and reads older calibration frames’ readout modes without waiting for a restart.

Previews, imports, exports, artifact searches and star catalog installations have Stop. Stopping an import rolls it back. Stopping an export keeps completed files, which the next export skips. Quality scans you start queue behind the current scan and run before database-wide analysis; that analysis pauses and repeats its interrupted target afterwards.

Under each heading, jobs that need your attention come first, then running, queued, waiting and paused work. The header counts each state separately.

The jobs list shows the running automatic stack build and the jobs queued behind it.
The jobs list shows the running automatic stack build and the jobs queued behind it.
Waiting jobs identify the stack build that must finish first.
Waiting jobs identify the stack build that must finish first.

Changing a line or stopping work needs write access. A stack build's row reads, for example, Rejecting transients · pass 2/3 · frame 4/14 through the final rejection pass, a calibration master build shows which master and what Seiza is doing with it, and a processing run shows its step and when it started. Scheduled backups list here too; see Backups.

Automatic refreshes

With Rebuild stack previews on their own on, under Settings → Stacking, new frames and grade changes queue a refresh after a settling delay. A refresh still settling is not listed or counted: nothing runs yet. Once due, a refresh held back by your work or another build is listed under Automatic as Refreshing stacks, waiting, and its builds join the line when it starts. An automatic build your build stopped starts again once your work has been quiet for 30 seconds. Automatic builds use the background share. See Stacks.

Scripts can start a settling refresh at once or drop it until the next change:

# Builds running first, then the line in order, then settling refreshes under "scheduled"
curl localhost:3000/api/stack-activity

# Start one within seconds, or skip it
curl -X POST localhost:3000/api/stack-activity/scheduled/run-now \
  -H "Content-Type: application/json" -d '{"database_id":"my-db","project_id":2}'
curl -X POST localhost:3000/api/stack-activity/scheduled/skip \
  -H "Content-Type: application/json" -d '{"database_id":"my-db","project_id":2}'

# Move a waiting build (0 is next) or take it out
curl -X POST localhost:3000/api/stack-activity/<job_id>/move \
  -H "Content-Type: application/json" -d '{"position":0}'
curl -X POST localhost:3000/api/stack-activity/<job_id>/cancel

Stop the server

A stop, from Ctrl+C, a service manager's SIGTERM or quitting the desktop app, starts nothing new and lets running work reach its next safe point before the server exits, so no file or catalog write is cut off:

Every five seconds the log lists the work still blocking shutdown.

In the desktop app, Restart server under Settings → Server waits for the old server to finish its work, so the job queue it saves is not lost. If that work still runs after two minutes, Settings and the log say what it waits for, and the old server is left to finish; restart the whole app to end it.

After a restart

The job queue survives a restart. PSF Guard keeps a journal beside the database registry (config.jobs.json next to config.json), rewritten a few seconds after the queue changes and once more when the server stops cleanly. On start it puts the queue back before the automatic scheduler starts anything:

A server started without a registry keeps no journal.

Desktop log files

The desktop app writes one log file a day and keeps a week of them. Open logs, at the foot of Settings, opens the folder:

PlatformLog folder
Windows%LOCALAPPDATA%\com.theatrus.psf-guard\logs
macOS~/Library/Logs/com.theatrus.psf-guard
Linux~/.local/share/com.theatrus.psf-guard/logs

The log records the server's console output: folder moves, what a stop waits for, the queue put back after a restart, and each frame a stack leaves out or rejects, and why. RUST_LOG sets the level; the default is info. A server run from the command line or in Docker logs to its console.

More projects from theatr.us