This document is about: SERVER 4
SWITCH TO

Photon Server設定ファイルの設定

Instance

Multiple instances are supported. Each instance has its own node in the config file.

SettingPhoton DefaultConfig DefaultDescription
ConfigNameOptional "ConfigName" value from config file; if present it will be logged.
ReportOnJobFALSECauses Photon to determine if it is running inside a Win32 job object and if so reports on the limits currently imposed.
LogFileLocationSets the path for logfiles. Default is the location where the server is started. Can be absolute or relative to PhotonSocketServer.exe.
EnablePerformanceCountersTRUEDetermines whether the server will enable its performance counters. The implementation creates a shared memory segment requiring suitable privileges. Set to "false" to run without those privileges.
MaxMessageSize512000Maximum number of bytes for a UDP, TCP or WebSockets message. If exceeded, the client will be disconnected. Can be overwritten in the appropriate listener.
ShutdownTimeout30000When a Photon shutdown has not finished after this timeout (in ms), the process is forcibly killed.
DisplayNameAn optional display name for this instance, shown in Photon Control.

TCP

SettingPhoton DefaultConfig DefaultDescription
TCPBufferSize4096The size of buffer used during TCP data transfer. Does not restrict message size. Ideal to have slightly more than the average message size.
TCPBufferAllocatorPoolSize500The number of buffers used for TCP data transfer kept in the pool for later reuse. Trade-off of speed vs resources.
StreamSocketAllocatorPoolSize250The number of TCP sockets kept in the pool for later reuse. Trade-off of speed vs resources.

UDP/ENet

SettingPhoton DefaultConfig DefaultDescription
DatagramSocketAllocatorPoolSize1000The number of datagram sockets kept in the pool for later reuse. Trade-off of speed vs resources.
PingIntervalMilliseconds1000How often a ping is sent from server to client when no data is flowing. A larger value leads to less server load. Defaults to the ENet standard value of 500ms.
DataSendingDelayMilliseconds55How long the server waits to accumulate more data before sending. Larger values = fewer datagrams but higher latency.
AckSendingDelayMilliseconds55How long the server waits before sending an ACK, allowing it to piggyback onto a data packet. Doesn't increase latency.
ENETBufferAllocatorPoolSize5000The number of buffers kept in the pool for later reuse. Trade-off of speed vs resources.
ValidateCRCifPresentFALSEIf enabled, incoming datagrams with an optional CRC value will have their checksum validated. Outbound datagrams to peers created with CRC will also include the CRC value.
MinimumTimeout50005000Minimum time before an ENet peer's lack of response causes a timeout disconnect. Actual time is determined dynamically per peer based on RTT history.
MaximumTimeout3000030000Maximum time before an ENet peer's lack of response causes a timeout disconnect. Actual time is determined dynamically per peer based on RTT history.
MinimumRetransmitTimeout200Sets a minimum retransmission time. Low-latency peers may be delayed. Reduces retransmission speed and server load.
MaximumRetransmitTimeout0Defines the maximum retransmission time. 0 = feature is turned off.
RTTACKAdjustmentTimeout0When set, the last retransmit-timeout is used (fast resend) instead of last retransmit-timeout×2 if the peer received any data during the period. 0 = feature is turned off.

UDP/ENet Throttling

SettingPhoton DefaultConfig DefaultDescription
PerPeerMaxReliableDataInTransit5120016384Maximum amount of reliable data (in bytes) a peer can have in-flight without ACK. Once reached, future reliable data is queued.
PerPeerTransmitRateLimitKBSec256256Maximum data (reliable + unreliable) that can be sent per second (in KB). When reached, reliable data is queued and unreliable data is dropped.
PerPeerTransmitRatePeriodMilliseconds200How often the transmit rate limit is checked. Smaller = smoother flow; larger = less server resources used.
MaxQueuedDataPerPeer512000163840Maximum amount of reliable data a peer can queue. Once exceeded, future reliable sends return an error code.

Debugging

SettingPhoton DefaultConfig DefaultDescription
ProduceDumpsTRUEEnable or disable creation of dump files in case of a crash. Dump files are essential to find issues in the Photon Core.
DumpTypeFullType of crash dumps: "Full", "Maxi", or "Mini". Less information from first to last but also less disk space.
MaxDumpsToProduce10Maximum number of dump files written. If files are moved or deleted, new ones can be written.

IOPool

Handles all I/O operations such as datagram sending/reception, TCP read completions, etc. Can also handle ENet protocol operations if ENetThreadPool\OnlyDispatchTimers is "true".

SettingPhoton DefaultConfig DefaultDescription
NumThreads2Number of threads for socket I/O. 4–8 tends to be good. If set to 0, uses 2× the number of CPU cores.

ThreadPool

The "Business Logic" thread pool used for all CLR operations.

SettingPhoton DefaultConfig DefaultDescription
InitialThreads4Number of threads the thread pool starts with.
MinThreads4Minimum number of threads in the pool.
MaxThreads4Maximum number of threads. If Initial, Min, and Max are the same, the pool is static (more efficient). Dynamic pools grow and shrink as demand changes.
MaxDormantThreads4Maximum number of dormant (idle) threads. Excess threads will be shut down.
PoolMaintPeriod5000How often (in ms) the pool is maintained to check on and shut down dormant threads.
DispatchTimeout100If a work item is dispatched and this many milliseconds pass before a worker picks it up, a new thread may be started.

ENetThreadPool

Used for all ENet protocol operations: deblocking inbound datagrams, ACK handling, retransmission, and ping generation.

SettingPhoton DefaultConfig DefaultDescription
InitialThreads2See ThreadPool.
MinThreads2See ThreadPool.
MaxThreads2See ThreadPool.
MaxDormantThreads5See ThreadPool.
PoolMaintPeriod5000See ThreadPool.
DispatchTimeout100See ThreadPool.
OnlyDispatchTimersFALSEIf true, only ENet timer operations use this pool. If false, all ENet protocol operations are dispatched to this pool.

Runtime

Defines the Photon Runtime behavior.

SettingPhoton DefaultConfig DefaultDescription
AssemblyPhotonHostRuntime, Culture=neutralThe Photon Runtime assembly to use. MUST be signed by the Exit Games Photon Runtime key. PublicKeyToken must NOT be specified.
CLRVersionBy default, the latest .NET runtime is used. Per instance, allows loading a specific version (e.g. "v4.0" or "v2.0").
EnableMDAFALSEEnables managed debugging assistants. Configure with a PhotonSocketServer.exe.mda.config file.
TypePhotonHostRuntime.PhotonDomainManagerThe type used as the domain manager. MUST derive from IPhotonDomainManager.
UnhandledExceptionPolicyIgnoreIgnoreOptions: Ignore, ReloadAppDomain, TerminateProcess.

Applications

SettingPhoton DefaultConfig DefaultDescription
DefaultA default application to use if no application is specified.
PassUnknownAppsToDefaultAppTRUEIf true, unknown application names use the default app. If false, it's a fatal error terminating the connection.

Application

SettingPhoton DefaultConfig DefaultDescription
NameArbitrary name for the application, used for dispatch.
SharedDirectory"Shared"Contains shared assemblies. Located under the Base Directory.
BaseDirectoryShould contain a "bin" folder with all assemblies, config files, etc.
AssemblyDetails of the assembly to use. Can contain a complete assembly specification string including PublicKeyToken.
TypeThe type loaded as the application. MUST derive from IPhotonApplication.
EnableShadowCopyFALSEIf enabled, the CLR creates copies of assembly files in a private directory, allowing originals to be overwritten for updates.
EnableAutoRestartFALSEIf enabled, the app restarts automatically on file changes. Existing connections continue until all disconnect, then the old app domain is unloaded.
ForceAutoRestartTRUEFALSEImplies EnableAutoRestart but aborts all existing connections rather than waiting for them to disconnect.
RestartDelayMilliseconds1000File-change restarts can be delayed with this setting.
WatchFiles""No entry means watch everything. Example: WatchFiles="dll;config;Lite.XML"
ExcludeFiles""No entry means exclude nothing. Example: ExcludeFiles="log4net.config"
StartTimeoutMilliseconds0Photon shuts down if the app doesn't start in time. 0 = no timeout.
StopTimeoutMilliseconds0Photon shuts down if the app doesn't stop in time. 0 = no timeout.

TCPListener

SettingPhoton DefaultConfig DefaultDescription
IPAddress0.0.0.0The IP address to listen on. 0.0.0.0 = all interfaces.
IPAddressIPv6::The IPv6 address to listen on. :: = all interfaces.
Port45304530The port to listen on.
ListenBacklog150Size of the listen backlog queue. Affects simultaneous connection establishment, not active concurrent connections.
RecvBufferSize0TCP recv buffer size (also determines TCP window size). 0 = use OS default.
SendBufferSize0TCP send buffer size. 0 = use OS default.
MaxPendingWrites50Flow control: max pending write buffers.
MaxQueuedBuffers200Flow control: max queued write buffers. More than pending writes reduces non-paged pool usage.
DisableNagleTRUETRUEIf true, Nagle is disabled and outbound TCP data is sent immediately. May improve latency at the expense of more datagrams.
InactivityTimeout50005000Time (ms) allowed between receiving data. Exceeded = connection aborted. 0 = disabled.
DisconnectTimeout120000Time (ms) allowed for the client to close the connection after being disconnected by the application.
OverrideApplicationOverride the application for this connector. Client-sent application selection is ignored.
DefaultApplicationDefault application for this listener if a client connects to an unloaded app. Overrides the global Default.
PolicyApplicationApplication used for policy requests sent to this listener.
MaxInboundMessageSizeMax bytes for an inbound message. Exceeding disconnects the client. Default is MaxMessageSize.
MaxOutboundMessageSizeMax bytes for an outbound message. Exceeding disconnects the client. Default is MaxMessageSize.
CustomConnectMessageIsRequiredFALSEIf true, a custom prefix/suffix is required on each Connect message.
CustomConnectMessagePrefixString ignored if sent as a prefix of a client's connect message.
CustomConnectMessageSuffixString ignored if sent as a suffix of a client's connect message.

UDPListener

SettingPhoton DefaultConfig DefaultDescription
IPAddress0.0.0.0The IP address to listen on. 0.0.0.0 = all interfaces.
IPAddressIPv6::The IPv6 address to listen on. :: = all interfaces.
Port50555055The port to listen on.
ListenBacklog500See TCPListener.
RecvBufferSizeSee TCPListener.
SendBufferSizeSee TCPListener.
OverrideApplicationSee TCPListener.
DefaultApplicationSee TCPListener.
MaxInboundMessageSizeSee TCPListener.
MaxOutboundMessageSizeSee TCPListener.

WebSocketListener

SettingPhoton DefaultConfig DefaultDescription
IPAddress0.0.0.0The IP address to listen on. 0.0.0.0 = all interfaces.
IPAddressIPv6::The IPv6 address to listen on. :: = all interfaces.
Port9091The port to listen on.
ListenBacklogSee TCPListener.
RecvBufferSizeSee TCPListener.
SendBufferSizeSee TCPListener.
DisableNagleTRUETRUESee TCPListener.
InactivityTimeout1000010000See TCPListener.
OverrideApplicationSee TCPListener.
DefaultApplicationSee TCPListener.
MaxInboundMessageSizeSee TCPListener.
MaxOutboundMessageSizeSee TCPListener.
MaxPendingWritesSee TCPListener.
MaxQueuedBuffersSee TCPListener.
DisconnectTimeoutSee TCPListener.

SSL

SettingPhoton DefaultConfig DefaultDescription
SecureFALSESet to true to secure a listener with SSL.
StoreNameMYName of the certificate store.
CertificateNamePhotonName of the certificate to use.
UseMachineStoreFALSEDefines if the machine store should be used.

TCPPolicyListener

Note: TCPFlashListener is deprecated — use TCPPolicyListener instead.

SettingPhoton DefaultConfig DefaultDescription
AddressThe IP address to listen on. 0.0.0.0 = all interfaces.
Port943The port to listen on.
ApplicationDefines the application for this listener.
ListenBacklogSee TCPListener.
InactivityTimeout1000See TCPListener.

ConfigServer

If present, configures a listener presenting a text menu interface to telnet clients for managing apps and server shutdown.

SettingPhoton DefaultConfig DefaultDescription
IPAddressThe IP address to listen on. 0.0.0.0 = all interfaces.
PortThe port to listen on.
ListenBacklogSee TCPListener.

S2S

SettingPhoton DefaultConfig DefaultDescription
PingFrequency2500How often a ping is sent out when no data is flowing.
MaxInboundMessageSizeSee TCPListener.
MaxOutboundMessageSizeSee TCPListener.
RecvBufferSizeSee TCPListener.
SendBufferSizeSee TCPListener.
MaxPendingWritesSee TCPListener.
MaxQueuedBuffersSee TCPListener.
MaxPendingWritesMUXSame as MaxPendingWrites but for MUX connections. Only applies if TuneFlowControlForMUX is not set.
MaxQueuedBuffersMUXSame as MaxQueuedBuffers but for MUX connections. Only applies if TuneFlowControlForMUX is not set.
TuneFlowControlForMUXMUX connections are configured with X × MaxPendingWrites and X × MaxQueuedBuffers.
DisableNagleTRUESee TCPListener.

OutboundENet

SettingPhoton DefaultConfig DefaultDescription
GenerateOutboundCRCFALSEIf enabled, a 32-bit CRC value is appended to each UDP header.
MaxInboundMessageSizeSee TCPListener.
MaxOutboundMessageSizeSee TCPListener.
MTU1200Maximum transmission unit at UDP level. Defaults to 1200, same as client SDKs.
MaxChannels255Maximum number of channels the peer should support.
Back to top