This document is about: SERVER 4
SWITCH TO

Photon 서버 환경 설정

Instance

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

Setting Photon Default Config Default Description
ConfigName – – Optional "ConfigName" value from config file; if present it will be logged.
ReportOnJob – FALSE Causes Photon to determine if it is running inside a Win32 job object and if so reports on the limits currently imposed.
LogFileLocation – Sets the path for logfiles. Default is the location where the server is started. Can be absolute or relative to PhotonSocketServer.exe.
EnablePerformanceCounters – TRUE Determines 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.
MaxMessageSize – 512000 Maximum number of bytes for a UDP, TCP or WebSockets message. If exceeded, the client will be disconnected. Can be overwritten in the appropriate listener.
ShutdownTimeout – 30000 When a Photon shutdown has not finished after this timeout (in ms), the process is forcibly killed.
DisplayName – – An optional display name for this instance, shown in Photon Control.

TCP

Setting Photon Default Config Default Description
TCPBufferSize – 4096 The size of buffer used during TCP data transfer. Does not restrict message size. Ideal to have slightly more than the average message size.
TCPBufferAllocatorPoolSize – 500 The number of buffers used for TCP data transfer kept in the pool for later reuse. Trade-off of speed vs resources.
StreamSocketAllocatorPoolSize – 250 The number of TCP sockets kept in the pool for later reuse. Trade-off of speed vs resources.

UDP/ENet

Setting Photon Default Config Default Description
DatagramSocketAllocatorPoolSize – 1000 The number of datagram sockets kept in the pool for later reuse. Trade-off of speed vs resources.
PingIntervalMilliseconds – 1000 How 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.
DataSendingDelayMilliseconds 5 5 How long the server waits to accumulate more data before sending. Larger values = fewer datagrams but higher latency.
AckSendingDelayMilliseconds 5 5 How long the server waits before sending an ACK, allowing it to piggyback onto a data packet. Doesn't increase latency.
ENETBufferAllocatorPoolSize – 5000 The number of buffers kept in the pool for later reuse. Trade-off of speed vs resources.
ValidateCRCifPresent – FALSE If 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.
MinimumTimeout 5000 5000 Minimum time before an ENet peer's lack of response causes a timeout disconnect. Actual time is determined dynamically per peer based on RTT history.
MaximumTimeout 30000 30000 Maximum time before an ENet peer's lack of response causes a timeout disconnect. Actual time is determined dynamically per peer based on RTT history.
MinimumRetransmitTimeout 200 – Sets a minimum retransmission time. Low-latency peers may be delayed. Reduces retransmission speed and server load.
MaximumRetransmitTimeout 0 – Defines the maximum retransmission time. 0 = feature is turned off.
RTTACKAdjustmentTimeout 0 – When 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

Setting Photon Default Config Default Description
PerPeerMaxReliableDataInTransit 51200 16384 Maximum amount of reliable data (in bytes) a peer can have in-flight without ACK. Once reached, future reliable data is queued.
PerPeerTransmitRateLimitKBSec 256 256 Maximum data (reliable + unreliable) that can be sent per second (in KB). When reached, reliable data is queued and unreliable data is dropped.
PerPeerTransmitRatePeriodMilliseconds – 200 How often the transmit rate limit is checked. Smaller = smoother flow; larger = less server resources used.
MaxQueuedDataPerPeer 512000 163840 Maximum amount of reliable data a peer can queue. Once exceeded, future reliable sends return an error code.

Debugging

Setting Photon Default Config Default Description
ProduceDumps – TRUE Enable or disable creation of dump files in case of a crash. Dump files are essential to find issues in the Photon Core.
DumpType – Full Type of crash dumps: "Full", "Maxi", or "Mini". Less information from first to last but also less disk space.
MaxDumpsToProduce – 10 Maximum 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".

Setting Photon Default Config Default Description
NumThreads – 2 Number 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.

Setting Photon Default Config Default Description
InitialThreads – 4 Number of threads the thread pool starts with.
MinThreads – 4 Minimum number of threads in the pool.
MaxThreads – 4 Maximum 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.
MaxDormantThreads – 4 Maximum number of dormant (idle) threads. Excess threads will be shut down.
PoolMaintPeriod – 5000 How often (in ms) the pool is maintained to check on and shut down dormant threads.
DispatchTimeout – 100 If 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.

Setting Photon Default Config Default Description
InitialThreads – 2 See ThreadPool.
MinThreads – 2 See ThreadPool.
MaxThreads – 2 See ThreadPool.
MaxDormantThreads – 5 See ThreadPool.
PoolMaintPeriod – 5000 See ThreadPool.
DispatchTimeout – 100 See ThreadPool.
OnlyDispatchTimers – FALSE If 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.

Setting Photon Default Config Default Description
Assembly PhotonHostRuntime, Culture=neutral – The Photon Runtime assembly to use. MUST be signed by the Exit Games Photon Runtime key. PublicKeyToken must NOT be specified.
CLRVersion – – By default, the latest .NET runtime is used. Per instance, allows loading a specific version (e.g. "v4.0" or "v2.0").
EnableMDA – FALSE Enables managed debugging assistants. Configure with a PhotonSocketServer.exe.mda.config file.
Type PhotonHostRuntime.PhotonDomainManager The type used as the domain manager. MUST derive from IPhotonDomainManager.
UnhandledExceptionPolicy Ignore Ignore Options: Ignore, ReloadAppDomain, TerminateProcess.

Applications

Setting Photon Default Config Default Description
Default – – A default application to use if no application is specified.
PassUnknownAppsToDefaultApp – TRUE If true, unknown application names use the default app. If false, it's a fatal error terminating the connection.

Application

Setting Photon Default Config Default Description
Name – – Arbitrary name for the application, used for dispatch.
SharedDirectory – "Shared" Contains shared assemblies. Located under the Base Directory.
BaseDirectory – – Should contain a "bin" folder with all assemblies, config files, etc.
Assembly – – Details of the assembly to use. Can contain a complete assembly specification string including PublicKeyToken.
Type – – The type loaded as the application. MUST derive from IPhotonApplication.
EnableShadowCopy – FALSE If enabled, the CLR creates copies of assembly files in a private directory, allowing originals to be overwritten for updates.
EnableAutoRestart – FALSE If enabled, the app restarts automatically on file changes. Existing connections continue until all disconnect, then the old app domain is unloaded.
ForceAutoRestart TRUE FALSE Implies EnableAutoRestart but aborts all existing connections rather than waiting for them to disconnect.
RestartDelayMilliseconds – 1000 File-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"
StartTimeoutMilliseconds – 0 Photon shuts down if the app doesn't start in time. 0 = no timeout.
StopTimeoutMilliseconds – 0 Photon shuts down if the app doesn't stop in time. 0 = no timeout.

TCPListener

Setting Photon Default Config Default Description
IPAddress 0.0.0.0 – The IP address to listen on. 0.0.0.0 = all interfaces.
IPAddressIPv6 :: – The IPv6 address to listen on. :: = all interfaces.
Port 4530 4530 The port to listen on.
ListenBacklog – 150 Size of the listen backlog queue. Affects simultaneous connection establishment, not active concurrent connections.
RecvBufferSize – 0 TCP recv buffer size (also determines TCP window size). 0 = use OS default.
SendBufferSize – 0 TCP send buffer size. 0 = use OS default.
MaxPendingWrites – 50 Flow control: max pending write buffers.
MaxQueuedBuffers – 200 Flow control: max queued write buffers. More than pending writes reduces non-paged pool usage.
DisableNagle TRUE TRUE If true, Nagle is disabled and outbound TCP data is sent immediately. May improve latency at the expense of more datagrams.
InactivityTimeout 5000 5000 Time (ms) allowed between receiving data. Exceeded = connection aborted. 0 = disabled.
DisconnectTimeout – 120000 Time (ms) allowed for the client to close the connection after being disconnected by the application.
OverrideApplication – – Override the application for this connector. Client-sent application selection is ignored.
DefaultApplication – – Default application for this listener if a client connects to an unloaded app. Overrides the global Default.
PolicyApplication – – Application used for policy requests sent to this listener.
MaxInboundMessageSize – – Max bytes for an inbound message. Exceeding disconnects the client. Default is MaxMessageSize.
MaxOutboundMessageSize – – Max bytes for an outbound message. Exceeding disconnects the client. Default is MaxMessageSize.
CustomConnectMessageIsRequired – FALSE If true, a custom prefix/suffix is required on each Connect message.
CustomConnectMessagePrefix – – String ignored if sent as a prefix of a client's connect message.
CustomConnectMessageSuffix – – String ignored if sent as a suffix of a client's connect message.

UDPListener

Setting Photon Default Config Default Description
IPAddress 0.0.0.0 – The IP address to listen on. 0.0.0.0 = all interfaces.
IPAddressIPv6 :: – The IPv6 address to listen on. :: = all interfaces.
Port 5055 5055 The port to listen on.
ListenBacklog – 500 See TCPListener.
RecvBufferSize – – See TCPListener.
SendBufferSize – – See TCPListener.
OverrideApplication – – See TCPListener.
DefaultApplication – – See TCPListener.
MaxInboundMessageSize – – See TCPListener.
MaxOutboundMessageSize – – See TCPListener.

WebSocketListener

Setting Photon Default Config Default Description
IPAddress 0.0.0.0 – The IP address to listen on. 0.0.0.0 = all interfaces.
IPAddressIPv6 :: – The IPv6 address to listen on. :: = all interfaces.
Port – 9091 The port to listen on.
ListenBacklog – – See TCPListener.
RecvBufferSize – – See TCPListener.
SendBufferSize – – See TCPListener.
DisableNagle TRUE TRUE See TCPListener.
InactivityTimeout 10000 10000 See TCPListener.
OverrideApplication – – See TCPListener.
DefaultApplication – – See TCPListener.
MaxInboundMessageSize – – See TCPListener.
MaxOutboundMessageSize – – See TCPListener.
MaxPendingWrites – – See TCPListener.
MaxQueuedBuffers – – See TCPListener.
DisconnectTimeout – – See TCPListener.

SSL

Setting Photon Default Config Default Description
Secure FALSE Set to true to secure a listener with SSL.
StoreName – MY Name of the certificate store.
CertificateName – Photon Name of the certificate to use.
UseMachineStore – FALSE Defines if the machine store should be used.

TCPPolicyListener

Note: TCPFlashListener is deprecated — use TCPPolicyListener instead.

Setting Photon Default Config Default Description
Address – – The IP address to listen on. 0.0.0.0 = all interfaces.
Port – 943 The port to listen on.
Application – – Defines the application for this listener.
ListenBacklog – – See TCPListener.
InactivityTimeout – 1000 See TCPListener.

ConfigServer

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

Setting Photon Default Config Default Description
IPAddress – – The IP address to listen on. 0.0.0.0 = all interfaces.
Port – – The port to listen on.
ListenBacklog – – See TCPListener.

S2S

Setting Photon Default Config Default Description
PingFrequency – 2500 How often a ping is sent out when no data is flowing.
MaxInboundMessageSize – – See TCPListener.
MaxOutboundMessageSize – – See TCPListener.
RecvBufferSize – – See TCPListener.
SendBufferSize – – See TCPListener.
MaxPendingWrites – – See TCPListener.
MaxQueuedBuffers – – See TCPListener.
MaxPendingWritesMUX – – Same as MaxPendingWrites but for MUX connections. Only applies if TuneFlowControlForMUX is not set.
MaxQueuedBuffersMUX – – Same as MaxQueuedBuffers but for MUX connections. Only applies if TuneFlowControlForMUX is not set.
TuneFlowControlForMUX – – MUX connections are configured with X × MaxPendingWrites and X × MaxQueuedBuffers.
DisableNagle – TRUE See TCPListener.

OutboundENet

Setting Photon Default Config Default Description
GenerateOutboundCRC – FALSE If enabled, a 32-bit CRC value is appended to each UDP header.
MaxInboundMessageSize – – See TCPListener.
MaxOutboundMessageSize – – See TCPListener.
MTU – 1200 Maximum transmission unit at UDP level. Defaults to 1200, same as client SDKs.
MaxChannels – 255 Maximum number of channels the peer should support.
Back to top