MFA Servers#

MFA database servers#

By default, MFA starts or creates a PostgreSQL servers when a command is invoked, and stops the server at the end of processing. The goal here is to have as unobtrusive of a database server as possible, however there are use cases that you may require more control. To turn off the automatic management of PostgreSQL servers, run mfa configure --disable_auto_server.

You can have multiple PostgreSQL servers by using the --profile flag, if necessary. By default the “global” profile is used. The profile flags are used in Global configuration, as the default options set with configure are done on a per-profile basis.

PostgreSQL configuration#

MFA overrides some default configuration values for its PostgreSQL servers when they are initialized.

log_min_duration_statement = 5000
enable_partitionwise_join = on
enable_partitionwise_aggregate = on
unix_socket_directories = '/path/to/current/profile/socket_directory'
listen_addresses = ''

maintenance_work_mem = 1GB
work_mem = 128MB
shared_buffers = 256MB
max_connections = 1000

The goal for MFA is to run on local desktops at reasonable performance on moderate sized corpora (<3k hours). Depending on your use case, you may need to tune the postgres.conf file further to suit your set up and corpus (see PostgreSQL’s documentation and postgresqltuner utility script. Additionally, note that any port listening is turned off by default and connections are handled via socket directories.

Warning

MFA PostgreSQL databases are meant to be on the expendable side. Though they can persist across use cases, it’s not really recommended. Use of --clean drops all data in the database to ensure a fresh start state, as various commands perform destructive commands. As an example Segment transcribed files (mfa segment) deletes and recreates Utterance objects, so the original text transcripts are absent in the database following its run.

Managing MFA database servers#

MFA PostgreSQL servers can be managed via the subcommands in mfa server, allowing you to initialize new servers, and start, stop, and delete existing servers.

mfa server#

Start, stop, and delete MFA database servers

mfa server [OPTIONS] COMMAND [ARGS]...

Options

-h, --help#

Show this message and exit.

delete#

Delete the MFA database server

mfa server delete [OPTIONS]

Options

-p, --profile <profile>#

Configuration profile to use, defaults to “global”

-h, --help#

Show this message and exit.

-p, --profile <profile>#

Configuration profile to use, defaults to “global”

-t, --temporary_directory <temporary_directory>#

Set the default temporary directory, default is /home/docs/Documents/MFA

-j, --num_jobs <num_jobs>#

Set the number of processes to use by default, defaults to 3

--clean, --no_clean#

Remove files from previous runs, default is False

-v, --verbose, -nv, --no_verbose#

Output debug messages, default is False

-q, --quiet, -nq, --no_quiet#

Suppress all output messages (overrides verbose), default is False

--overwrite, --no_overwrite#

Overwrite output files when they exist, default is False

--use_mp, --no_use_mp#

Turn on/off multiprocessing. Multiprocessing is recommended will allow for faster executions.

--use_threading, --no_use_threading#

Use threading library rather than multiprocessing library. Multiprocessing is recommended will allow for faster executions.

-d, --debug, -nd, --no_debug#

Run extra steps for debugging issues, default is False

--use_postgres, --no_use_postgres#

Use postgres instead of sqlite for extra functionality, default is False

--single_speaker#

Single speaker mode creates multiprocessing splits based on utterances rather than speakers. This mode also disables speaker adaptation equivalent to --uses_speaker_adaptation false.

--textgrid_cleanup, --cleanup_textgrids, --no_textgrid_cleanup, --no_cleanup_textgrids#

Turn on/off post-processing of TextGrids that cleans up silences and recombines compound words and clitics.

init#

Initialize the MFA database server

mfa server init [OPTIONS]

Options

-p, --profile <profile>#

Configuration profile to use, defaults to “global”

-h, --help#

Show this message and exit.

-p, --profile <profile>#

Configuration profile to use, defaults to “global”

-t, --temporary_directory <temporary_directory>#

Set the default temporary directory, default is /home/docs/Documents/MFA

-j, --num_jobs <num_jobs>#

Set the number of processes to use by default, defaults to 3

--clean, --no_clean#

Remove files from previous runs, default is False

-v, --verbose, -nv, --no_verbose#

Output debug messages, default is False

-q, --quiet, -nq, --no_quiet#

Suppress all output messages (overrides verbose), default is False

--overwrite, --no_overwrite#

Overwrite output files when they exist, default is False

--use_mp, --no_use_mp#

Turn on/off multiprocessing. Multiprocessing is recommended will allow for faster executions.

--use_threading, --no_use_threading#

Use threading library rather than multiprocessing library. Multiprocessing is recommended will allow for faster executions.

-d, --debug, -nd, --no_debug#

Run extra steps for debugging issues, default is False

--use_postgres, --no_use_postgres#

Use postgres instead of sqlite for extra functionality, default is False

--single_speaker#

Single speaker mode creates multiprocessing splits based on utterances rather than speakers. This mode also disables speaker adaptation equivalent to --uses_speaker_adaptation false.

--textgrid_cleanup, --cleanup_textgrids, --no_textgrid_cleanup, --no_cleanup_textgrids#

Turn on/off post-processing of TextGrids that cleans up silences and recombines compound words and clitics.

start#

Start the MFA database server

mfa server start [OPTIONS]

Options

-p, --profile <profile>#

Configuration profile to use, defaults to “global”

-h, --help#

Show this message and exit.

-p, --profile <profile>#

Configuration profile to use, defaults to “global”

-t, --temporary_directory <temporary_directory>#

Set the default temporary directory, default is /home/docs/Documents/MFA

-j, --num_jobs <num_jobs>#

Set the number of processes to use by default, defaults to 3

--clean, --no_clean#

Remove files from previous runs, default is False

-v, --verbose, -nv, --no_verbose#

Output debug messages, default is False

-q, --quiet, -nq, --no_quiet#

Suppress all output messages (overrides verbose), default is False

--overwrite, --no_overwrite#

Overwrite output files when they exist, default is False

--use_mp, --no_use_mp#

Turn on/off multiprocessing. Multiprocessing is recommended will allow for faster executions.

--use_threading, --no_use_threading#

Use threading library rather than multiprocessing library. Multiprocessing is recommended will allow for faster executions.

-d, --debug, -nd, --no_debug#

Run extra steps for debugging issues, default is False

--use_postgres, --no_use_postgres#

Use postgres instead of sqlite for extra functionality, default is False

--single_speaker#

Single speaker mode creates multiprocessing splits based on utterances rather than speakers. This mode also disables speaker adaptation equivalent to --uses_speaker_adaptation false.

--textgrid_cleanup, --cleanup_textgrids, --no_textgrid_cleanup, --no_cleanup_textgrids#

Turn on/off post-processing of TextGrids that cleans up silences and recombines compound words and clitics.

stop#

Stop the MFA database server

mfa server stop [OPTIONS]

Options

-p, --profile <profile>#

Configuration profile to use, defaults to “global”

-m, --mode <mode>#

Mode flag to be passed to pg_ctl

Options:

fast | immediate | smart

-h, --help#

Show this message and exit.

-p, --profile <profile>#

Configuration profile to use, defaults to “global”

-t, --temporary_directory <temporary_directory>#

Set the default temporary directory, default is /home/docs/Documents/MFA

-j, --num_jobs <num_jobs>#

Set the number of processes to use by default, defaults to 3

--clean, --no_clean#

Remove files from previous runs, default is False

-v, --verbose, -nv, --no_verbose#

Output debug messages, default is False

-q, --quiet, -nq, --no_quiet#

Suppress all output messages (overrides verbose), default is False

--overwrite, --no_overwrite#

Overwrite output files when they exist, default is False

--use_mp, --no_use_mp#

Turn on/off multiprocessing. Multiprocessing is recommended will allow for faster executions.

--use_threading, --no_use_threading#

Use threading library rather than multiprocessing library. Multiprocessing is recommended will allow for faster executions.

-d, --debug, -nd, --no_debug#

Run extra steps for debugging issues, default is False

--use_postgres, --no_use_postgres#

Use postgres instead of sqlite for extra functionality, default is False

--single_speaker#

Single speaker mode creates multiprocessing splits based on utterances rather than speakers. This mode also disables speaker adaptation equivalent to --uses_speaker_adaptation false.

--textgrid_cleanup, --cleanup_textgrids, --no_textgrid_cleanup, --no_cleanup_textgrids#

Turn on/off post-processing of TextGrids that cleans up silences and recombines compound words and clitics.

API reference#