GlobalConfig (Global Configuration)

August 16, 2024 · View on GitHub

The global configuration defines the globally shared configurations, mainly including container and environment-related configurations.

Configuration Details

Configuration DomainConfiguration NameConfiguration TypeDefault ValueDeprecatedConfiguration Explanation
globalnamespacestringNoneNoEnvironment type, divided into formal (Production) and informal (Development) types, supporting customizations
globalenv_namestringNoneNoEnvironment name, the name of multiple environments in an informal environment
globalcontainer_namestringNoneNoContainer name
globalenable_setstringNoneNoWhether to enable set-based routing, not enabled by default, Y to enable
globalfull_set_namestringNoneNoSet name
globalextmapNoneNoGlobal extended parameters

ServerConfig (Server Configuration)

The server configuration defines the server-related configurations, management configurations ( AdminConfig), and service mapping list configurations (ServiceConfig). The service mapping configuration (ServiceConfig) also includes service exposure list configurations (ProviderConfig).

ServerConfig (Server Configuration)

The server configuration defines server-related configurations, management configurations ( AdminConfig), and service mapping list configurations (ServiceConfig). Service mapping configuration (ServiceConfig) also includes service exposure list configurations (ProviderConfig).

Configuration Details

Configuration DomainConfiguration NameConfiguration TypeDefault ValueDeprecatedConfiguration Explanation
serverappstringNoneNoApplication name of the business
serverserverstringNoneNoService name of the business
serverlocal_ipstring127.0.0.1NoLocal IP address
servernicstringNoneNoLocal network card (e.g., eth1), used to obtain local IP, generally configured with IP
serverserver_listenerstring listNoneNoRegister server-side general Listener, class implementing the ServerListener interface, configure the full path of the implementation class
serverclose_timeoutint30000msNoShutdown timeout for server thread pool
serverwait_timeoutint5000msNoAfter unregistering the service, wait time
serverrequest_timeoutint2147483647 msNoRequest timeout (server-side global)
serverworker_poolstringtrpc_provider_biz_defNoName of the worker thread pool, default value
serverfiltersstring listNoneNoFilter list configuration
serverenable_link_timeoutbooleanfalseNoWhether to enable full link timeout, not enabled by default
serverconfig_centerstringNoneNoConfiguration center used [nacos]
serveradminmapNoneNoAdmin management background configuration
serverservicemapNoneNoExposed service configuration
server.adminadmin_ipstringNoneNoManagement background IP
server.adminadmin_portintNoneNoManagement background port
server.servicenamestringNoneNoUsed for name service addressing
server.serviceversionstringv1.0.0NoService version number
server.servicegroupstringnormalNoService group
server.serviceimplslistNoneNoList of exposed service implementations, find the interface according to the implementation
server.service.implsimplstringNoneNoService implementation
server.service.implsworker_poolstringNoneNoThread pool name
server.service.implsrequest_timeoutstringNoneNoTimeout
server.service.implsfiltersstringNoneNoFilter list
server.service.implsenable_link_timeoutstringNoneNoFull link timeout
server.serviceipstringNoneNoLocal IP
server.servicenicstringNoneNoUsed to obtain local IP, generally configured with IP
server.serviceportintNoneNoPort
server.servicenetworkstringtcpNoNetwork connection protocol, [tcp, udp]
server.serviceprotocolstringtrpcNoCommunication protocol, [trpc, http, rest]
server.servicebase_pathstringtrpcNoBase path, prefix path
server.serviceserializationstringpbNoSerialization protocol, [pb, json, jpb (Java pb)]
server.servicecompressorstringnoneNoCompression method, [none, gzip, snappy]
server.servicecompress_min_bytesint65535NoMinimum number of bytes for compression, default 64KB, even if compression is enabled, if the body is smaller than this byte, it will not be compressed
server.servicetransporterstringnettyNoTransporter server side, [netty, jetty], jetty needs to be used with protocol=http
server.servicecharsetstringutf8NoCharacter set
server.servicekeep_alivebooleantrueNoWhether to keep the connection alive
server.servicemax_connsint1024 * 20NoMaximum number of connections
server.servicebacklogint1024NoBacklog size, corresponding to Netty's so_backlog
server.servicesend_bufferint16384NoSend buffer
server.servicereceive_bufferint16384NoReceive buffer
server.servicepayloadint10485760(10M)NoPackage size limit
server.serviceidle_timeoutint180000msNoIdle time
server.servicerequest_timeoutint2147483647 msNoRequest timeout
server.servicelazyinitbooleanfalseNoWhether to delay initialization
server.serviceio_modestringepollNoIO mode [epoll]
server.serviceio_thread_group_sharebooleantrueNoWhether the IO thread is shared
server.serviceio_threadsintcpus * 2NoNumber of IO threads
server.serviceboss_threadsint1NoNumber of boss threads, the default number of threads accepting requests is 1, which is the optimal solution, and can also be set according to the actual scenario
server.serviceext_mapmapNoneNoExtended configuration
server.serviceworker_poolstringtrpc_provider_biz_defNoThread pool name
server.serviceregistrysmapNoneNoMulti-registry configuration
server.servicefiltersstring listNoneNoFilter list configuration
server.serviceenable_link_timeoutbooleanfalseNoWhether to enable full link timeout, not enabled by default
server.servicereuse_portbooleanfalseNoWhether to enable the reusePort option
server.serviceis_batch_decoderbooleantrueNoWhether to enable batch decoding
server.serviceexplicit_flush_after_flushesint2048NoHigh throughput flush

ClientConfig (Client Configuration)

The server configuration defines client-related configurations (such as netty), and client mapping list configurations (BackendConfig).

Configuration Details

Configuration DomainConfiguration NameConfiguration TypeDefault ValueDeprecatedConfiguration Explanation
clientnamespacestringNoneNoEnvironment type, divided into formal (Production) and informal (Development) types, not configured when using global configuration
clientrequest_timeoutint1000msNoClient-side global request timeout
clientprotocolstringtrpcNo(Client-side global) Request communication protocol [trpc, http]
clientnetworkstringtcpNo(Client-side global) Request connection protocol [tcp, udp]
clientserializationstringPBNo(Client-side global) Serialization protocol [pb, json, jpb (Java pb)]
clientcompressorstringnoneNo(Client-side global) Compression method [none, gzip, snappy]
clientcompress_min_bytesint65535No(Client-side global) Minimum number of bytes for compression, default 64KB, even if compression is enabled, if the body is smaller than this byte, it will not be compressed
clientcharsetstringUTF-8No(Client-side global) Character set encoding format
clientsend_bufferint16384No(Client-side global) Send buffer size
clientreceive_bufferint16384No(Client-side global) Receive buffer size
clientkeep_alivebooleantrueNo(Client-side global) Whether to keep the connection alive
clientio_thread_group_sharebooleantrueNo(Client-side global) Whether the IO thread is shared
clientio_threadsintcpus * 2No(Client-side global) Number of IO threads
clienttransporterstringnettyNo(Client-side global) transporter
clientidle_timeoutint180000 msNo(Client-side global) Idle timeout
clientlazyinitbooleanfalseNo(Client-side global) Whether to delay initialization
clientconns_per_addrint2No(Client-side global) Number of connections per addr
clientconn_timeoutint1000msNo(Client-side global) Client connection timeout
clientworker_poolstringtrpc_consumer_biz_defNo(Client-side global) Thread pool ID
clientfiltersstring listNoneNo(Client-side global) Interceptor list
clientinterceptorsstring listNoneNo(Client-side global) ClusterInvoker interceptor, intercept before filters
clientcluster_config_mapmapNoneNoTRPC client cluster configuration, implemented in code
clientcaller_service_namestringNoneNo(Client-side global) Main service name for Polaris addressing
clientservicemapNoneNoTRPC client configuration
client.servicenamestring"@BackendConfig(" + nameGeneratorIndex.getAndAdd(1) + ")"NoBackend cluster name (used for lookup by TRpcProxy)
client.serviceversionstringv1.0.0NoService version number
client.servicegroupstringnormalNoService group
client.serviceinterfacestringNoneNoTRPC client-specific interface
client.servicenaming_urlstringNoneNoRoute discovery @Alias(target), Java recommends using .naming configuration, direct connection ip://ip:port, name service: polaris://trpc.TestApp.TestServer.Greeter?key=value&key=value l5://mid:cmid cmlb://id
client.servicenaming_mapmapNoneNoExtended parameters
client.servicenamespacestringNoneNoEnvironment type, divided into formal (Production) and informal (Development) types, not configured when using global configuration
client.servicecalleestringserviceNameNoMain call information
client.servicenetworkstringtcpNoNetwork connection protocol, [tcp, udp]
client.serviceprotocolstringtrpcNoCommunication protocol, [trpc, http]
client.serviceserializationstringpbNoSerialization protocol, [pb, json, jpb (Java pb)]
client.servicecompressorstringnoNoCompression method, [none, gzip, snappy]
client.servicecompress_min_bytesint65535NoMinimum number of bytes for compression, default 64KB, even if compression is enabled, if the body is smaller than this byte, it will not be compressed
client.servicetransporterstringnettyNoTransporter server side, [netty, jetty], jetty needs to be used with protocol=http
client.servicecharsetstringutf8NoCharacter set
client.servicekeep_alivebooleantrueNoWhether to keep the connection alive
client.servicemax_connsint1024 * 20NoMaximum number of client connections
client.servicesend_bufferint16384NoSend buffer
client.servicereceive_bufferint16384NoReceive buffer
client.servicepayloadint10485760(10M)NoPackage size limit
client.serviceidle_timeoutint180000msNoIdle time
client.servicerequest_timeoutint10000msNoRequest timeout
client.serviceconn_timeoutint1000msNoClient connection timeout
client.serviceconns_per_addrint2NoNumber of client connections
client.servicelazyinitbooleanfalseNoWhether to delay initialization
client.serviceio_thread_group_sharebooleantrueNoWhether the IO thread is shared
client.serviceio_threadsintcpus * 2NoNumber of IO threads
client.serviceext_mapmapNoneNoExtended configuration
client.servicenaming_mapmapNoneNoPolaris extended configuration
client.service.naming_mapmetadatamapNoneNoPolaris metadata configuration
client.servicemockbooleanfalseNoWhether to mock, default false
client.servicemock_classstringNoneNoMock class
client.serviceworker_poolstringtrpc_consumer_biz_defNoThread pool name
client.servicefiltersstring listNoneNoFilter list configuration
client.serviceis_batch_decoderbooleantrueNoWhether to enable batch decoding
client.serviceexplicit_flush_after_flushesint2048NoHigh throughput flush
client.servicecaller_service_namestringNoneNoMain service name for Polaris addressing

PluginConfig(Plugin Configuration)

Plugin configuration is responsible for loading all framework plugin configurations

Configuration Details

First, list the supported plugins, followed by the specific configuration parameters for the plugins.

Plugin List

Configuration DomainConfiguration NameConfiguration TypeDefault ValueDeprecatedConfiguration ExplanationImplemented
pluginsworker_poolmapNoneNoThread poolthread
pluginsconfigstringNoneNoRemote configurationnacos
pluginsfilterstringNoneNofilteropentelemetry
pluginsselectorstringNoneNoRoute selectorpolaris, ip, zookeeper
pluginsregistrystringNoneNoRegistrypolaris
pluginstelemetrystringNoneNoneLink trackingopentelemetry
pluginslimiterstringNoneNoneRate limitingsentinel

worker_pool (Thread Pool)

Configuration DomainConfiguration NameConfiguration TypeDefault ValueDeprecatedConfiguration Explanation
plugins.worker_pool'name'-Thread pool namemapNoneNoThread pool name and specific project configuration
plugins.worker_pool.name_typestringNoneNoFill in the name of the plugin to find the plugin, [default, thread, forkJoinPool], when this item is not configured, the name is used as the plugin name to find the plugin
plugins.worker_pool.namecore_pool_sizeint0NoNumber of core threads
plugins.worker_pool.namemaximum_pool_sizeintcore_pool_sizeNoMaximum number of threads
plugins.worker_pool.namekeep_alive_time_secondsint60sNoMaximum thread idle time
plugins.worker_pool.namequeue_sizeint0NoQueue size, 0 means unlimited
plugins.worker_pool.nameallow_core_thread_timeoutbooleantrueNoWhether to recycle core threads on timeout
plugins.worker_pool.namename_prefixstringNoneNoThread name prefix in thread pool
plugins.worker_pool.namedeamonbooleantrueNoWhether it is a daemon thread
plugins.worker_pool.nameclose_timeoutint10sNoTimeout
plugins.worker_pool.nameuse_fiberbooleanfalseWhether to use coroutines
plugins.worker_pool.namefiber_parallelintcpusThe scheduling thread pool parallelism level of the coroutine
plugins.worker_pool.nameshare_schedulebooleantrueWhether the coroutine pool shares the scheduler
plugins.worker_pool.forkJoinPoolparallelint2NoNumber of parallel threads
plugins.worker_pool.forkJoinPooltimeoutMsint2000NoThread pool shutdown timeout, in milliseconds