Since 1.6.7 (at 2012.12.03) site moved to

Afanasy Configuration

General Configuration:

Afanasy configuration stored in XML files. It reads them on launch.

Default configuration:
Configuration overrides:
Per user turning:
Last values, which overrides even users values and which initialization will not be echoed by afcmd (for passwords):
It reads them in specified sequence, each time overriding previous variables value.

You can copy cgru/afanasy/config_default.xml file in cgru/afanasy/config.xml and remove elements which default values you want to keep. You need at least to override servername (if you want other computers to find it). Generate keys using afcmd passwd command for your own passwords and put them into cgru/afanasy/config_shadow.xml.

Configuration Elements:


  • timeformat = %a %d %b %H:%M.%S
    Time format for afanasy logs. See C library strftime function for time format documentation.

  • filenamesizemax = 250
    Afanasy generates some file names automatically, to store task output for example. If filename length for some reasons will be grater this value, it will be truncated to maximum.
    ( tasks outputs storing filename generating policy prevents same filenames, truncating will never produce the same file name )

  • cmdprefix = ""
    Tasks commands prefix. Set it to './' to launch 'myrender' not from path but from current task directory where 'myrender' can be reconfigured individually for the asset.

  • priority = 99
    Default priority for users and jobs. User with no administrative rights can't set priority greater than this value.

  • maxhosts = -1
    Default maximum hosts number for users and jobs. Value '-1' means no hosts number limit.

  • hostsmask = ""
    Default hosts mask number for users and jobs. Empty means that users and jobs can run on any host. Afanasy uses QT Regular Expressions (they are Perl-like).

Client & Server:

  • servername = localhost
    Afanasy server name to lookup or IP address.

  • serveripmask = *.* 192.168.* *:* 0:0:0:0:0:0:0:1 FC00:* FD00:*
    Acceptable connections IP addresses mask. Connections form addresses not matching this masks will be ignored by server. Mask should have at least one '.' for IPv4 or one ':' for IPv6. There are some useful examples in the default value.

  • magic_number = 1
    Magic number. Server will not react on message with another magic number. If client receives a message with invalid magic number it will exit. You can use it to filter clients and any connections. For example, on some internal tools changes, you can ensure that all clients are updated. Value '0' is reserved and means magic number mismatch.

  • serverport = 51000
    Port to listen to server.

  • clientport = 51001
    First port to listen to clients. Next client launched on the host will listen the next port.

  • srv_so_rcvtimeo_sec = 2
    Set socket maximum time to wait for an input operation to complete (see man setsockopt).

  • srv_so_sndtimeo_sec = 2
    Set socket maximum time to wait for an output operation to complete (see man setsockopt).

  • tempdirectory = /var/tmp/afanasy/
    Directory for sever to store logs and tasks outputs.


  • task_default_capacity = 1000
    Default tasks capacity value, if not set manually on job creation or running job GUI.

  • task_update_timeout = 300 (seconds)
    If task status or percentage has not been updated for this period it's considered as an error.

  • job_logs_rotate = 10
    Server store logs of a jobs with the same name by renaming old. It adds a number to the end of old file name (logs rotating).


  • errors_avoid_host = 3
    Errors Avoid Host parameter for new user.

  • task_error_retries = 3
    Error Retries parameter for new user.

  • task_error_same_host = 3
    Errors Task Same Host parameter for new user.

  • user_zombietime = 2 (seconds)
    Time to temporary (not registered) user to have no jobs and to be deleted from server.

  • user_logs_linesmax = 100
    Server truncates log above this limit.

  • user_logs_rotate = 10
    Server store logs of users with the same name by renaming old. It adds a number to the end of old file name (logs rotating).


  • db_conninfo = host=localhost dbname=afanasy user=afadmin password=AfPassword
    It is a database connection options, string to pass to PQconnectdb function.

  • db_stringquotes = $$
    String quotes in statements. With default quotes ( " or ' ) you can't operate strings which contains such characters. Check whether your database supports it.

  • db_stringnamelen = 512
    Names length limit. It is a name of job, block, task, user, host e.t.c.

  • db_stringexprlen = 4096
    Expressions length limit. It is an expression of hosts mask, depend mask and command, working directory.

You can check database connection by afcmd db_check command.

When server looses connection with database it tries to reconnect. Each reconnection try it refreshes connection settings from configuration, so you can reconfigure database connection settings "on-the-fly". When server looses connection it stops to execute queries queue, so they will not be lost but they store in memory. To prevent RAM usage growth server will no accept any new jobs until successful reconnect.

If server fails to connect to database for the first time on start, it will ignore database at all. It will work normally but will loose all data on restart.

Since 1.6.7 (at 2012.12.03) site moved to Project


Libre Graphics World