LeoFS Gateway

LeoFS Gateway configuration

  • Location of configuration file:
    • <leofs-home-dir>/package/leo_gateway/etc/leo_gateway.conf OR /usr/local/leofs/<version>/leo_gateway/etc/leo_gateway.conf
Property Default Value Description
LeoFS Manager
managers [manager_0@127.0.0.1, manager_1@127.0.0.1] Node name of LeoFS Manager master and slave nodes
LeoFS Gateway Basic Configuration
protocol s3 Gateway Protocol - [s3 | rest | embed | nfs]
HTTP
http.port 8080 Port number the Gateway uses for HTTP connections
http.num_of_acceptors 128 Numbers of processes listening for connections
http.max_keepalive 4096 Maximum number of requests allowed in a single keep-alive session
http.layer_of_dirs 12 Maximum number of virtual directories
http.ssl_port 8443 Port number the Gateway uses for HTTPS connections
http.ssl_certfile ./etc/server_cert.pem SSL Certificate file
http.ssl_keyfile ./etc/server_key.pem SSL key file
http.headers_config_file ./etc/http_custom_header.conf HTTP custom header configuration file path
http.timeout_for_header 5000 HTTP timeout for reading header (msec)
http.timeout_for_body 15000 HTTP timeout for reading body (msec)
Other
bucket_prop_sync_interval 300 Synchronized time of a bucket property (sec)
NFS-related configurations
nfs.mountd.port 22050 Mountd’s port number
nfs.mountd.acceptors 128 Mountd’s the number of acceptors
nfs.nfsd.port 2049 NFSd’s port number
nfs.nfsd.acceptors 128 NFSd’s the number of acceptors
Large-object processing configuration
large_object.max_chunked_objs 1000 Total number of chunked objects
large_object.chunked_obj_len 5242880 Length of a chunked object (Byte), This value must be >= large_object.reading_chunked_obj_len otherwise you may hit issue#531 (The last part of a large object can be broken with reading_chunked_obj_len > chunked_obj_len in leo_gateway.conf), With version >= 1.3.1, LeoFS check whether this constraint is violated or not when starting leo_gateway
large_object.threshold_of_chunk_len 5767168 Threshold of length of a chunked object (Byte)
large_object.reading_chunked_obj_len 5242880 Reading length of a chuncked object, This value must be <= large_object.chunked_obj_len otherwise you may hit issue#531 (The last part of a large object can be broken with reading_chunked_obj_len > chunked_obj_len in leo_gateway.conf), With version >= 1.3.1, LeoFS check whether this constraint is violated or not when starting leo_gateway
Cache configuration
cache.cache_workers 16 A number of cache workers at the cache-mechanism for load-balancing
cache.cache_ram_capacity 268435456

Memory cache capacity (Byte), Each cache-worker’s capacity for memory-cache is cache.cache_ram_capacity div cache.cache_workers , and needs to satisfy the following conditions:

  • (8 * 1024 * 1024) * ${cache.cache_workers} >= ${cache.cache_ram_capacity}
cache.cache_disc_capacity 524288000

Disk cache capacity (Byte), Each cache-worker’s capacity for disk-cache is cache.cache_disc_capacity div cache.cache_workers , and needs to satisfy the following conditions:

  • (8 * 1024 * 1024) * ${cache.cache_workers} >= ${cache.cache_disc_capacity}
cache.cache_disc_threshold_len 1048576 When the length of the object exceeds this value, stores the object on the local disk
cache.cache_disc_dir_data ./cache/data Directory for the disk cache data
cache.cache_disc_dir_journal ./cache/journal Directory for the disk cache journal
cache.cache_expire 300 Cache Expire in seconds
cache.cache_max_content_len 1048576 Cache Max Content Length in bytes
cache.cachable_content_type [] Cache Content Type(s)
cache.cachable_path_pattern [] Cache Path Pattern(s) (regular expression)
Watchdog
rex(rpc)
watchdog.rex.interval 5 Watch interval for the rex*(rpc)* process in order to execute force GC when reaching the threshold value
watchdog.rex.threshold_mem_capacity 33554432 Threshold memory capacity of binary for rex*(rpc)*
CPU
watchdog.cpu.is_enabled false Enabled or disabled CPU-watchdog [true|false]
watchdog.cpu.interval 5 Watch interval(sec) for CPU-watchdog
watchdog.cpu.raised_error_times 3 An error is raised to subscribers when a number of errors reached this configuration.
watchdog.cpu.threshold_cpu_load_avg 5.0 Threshold CPU load avg for 1min/5min
watchdog.cpu.threshold_cpu_util 100 Threshold CPU load util (%)
Erlang IO (Erlang’s VM Internal Traffic)
watchdog.io.is_enabled false Enabled or disabled io-watchdog [true|false]
watchdog.io.interval 1 Watch interval (sec) for Eralng-IO watchdog
watchdog.io.threshold_input_per_sec 134217728 Threshold input size/sec (byte)
watchdog.io.threshold_output_per_sec 134217728 Threshold output size/se (byte)
Timeout
timeout.level_1 5000 Timeout value when requesting put-operation to a storage (msec) - 0 to 65,535 bytes
timeout.level_2 7000 Timeout value when requesting put-operation to a storage (msec) - 65,535 to 131,071 bytes
timeout.level_3 10000 Timeout value when requesting put-operation to a storage (msec) - 131,072 to 524,287 bytes
timeout.level_4 20000 Timeout value when requesting put-operation to a storage (msec) - 524,288 to 1,048,576 bytes
timeout.level_5 30000 Timeout value when requesting put-operation to a storage (msec) - 1,048,576 bytes and over
timeout.get 30000 Timeout value when requesting get-operation to a storage (msec)
timeout.ls 30000 Timeout value when requesting a list-object to a storage (msec)
Log
log.log_level 1 Log level: [0:debug, 1:info, 2:warn, 3:error]
log.is_enable_access_log false Enable or disable access-log output [true, false]
log.erlang ./log/erlang Locatio of Erlang log-files
log.app ./log/app Locatio of Gateway’s log-files
log.member_dir ./log/ring Location of dump files of members of a storage cluster
log.ring_dir ./log/ring Location of RING’s dump files
Others*
queue_dir ./work/queue Directory of queue for monitoring “RING” and members of a storage cluster
snmp_agent ./snmp/snmpa_gateway_0/LEO-GATEWAY Directory of SNMP agent configuration

Erlang VM configuration

Property Default Value Description
nodename gateway_0@127.0.0.1 Node name of LeoFS Storage
distributed_cookie 401321b4 Cookie for distributed node communication
erlang.kernel_poll true Enable or disable kernel poll
erlang.async_threads 32 Number of async threads
erlang.max_ports 64000 Number of concurrent ports/sockets
erlang.crash_dump ./log/erl_crash.dump Location of crash dumps
erlang.max_ets_tables 256000 ETS table limit
erlang.smp enable Enable or disable SMP
erlang.schedulers.compaction_of_load true Erlang scheduler’s compaction of load
erlang.schedulers.utilization_balancing false Erlang scheduler’s balancing of load
erlang.distribution_buffer_size 32768 Sender-side network distribution buffer size (KB)
erlang.fullsweep_after 0 A non-negative integer which indicates how many times generational garbage collections can be done without forcing a fullsweep collection
erlang.secio false Enable or disable eager check I/O (Erlang 17.4/erts-6.3-, ref:OTP-12117)
process_limit 1048576 Default erlang process limit
snmp_conf ./snmp/snmpa_storage_0/leo_gateway_snmp SNMPA configuration files directory

See Also

Configuration of eager check I/O scheduling for Erlang’s VM

If you adopt LeoFS v1.2.7 later w/Erlang 17.5, we recommend you turn on erlang.secio. So you need to modify the configuration files and the schema files as follows.

  • Turn on erlang.secio at leo_gateway.conf
erlang.secio = true
  • Uncomment every rows of erlang.secio at leo_storage.schema
{mapping,
  "erlang.secio",
  "vm_args.+secio",
  [
    {default, false}
  ]}.

See Also