Photon Command Line Manual

Most of the Photon server operations can be done using PhotonControl application. However, if you prefer command-line tools Photon already has what you need.

"PhotonSocketServer.exe" contains the commands necessary related to Photon server. It can be found in any of the "deploy\bin_*" folders inside the Photon server SDK.

You can list all the commands and arguments possible using the /help argument.

PhotonSocketServer help
PhotonSocketServer's list of arguments

All the commands support a silent mode using /noMessage argument. This mode disables the creation of pop up dialogs in case of error. It is useful for automation purposes.

Manual

Photon As A Windows Service

To install Photon server as a Windows service:

Then you can use the Windows sc command to start and stop the Photon service.

To uninstall the Photon Windows service you can use:

Photon As A Process

To start a Photon instance for debugging, the most simple command is:

Depending on the configuration, one Photon server instance may contain more than one Photon server application. But each Photon server instance requires a PhotonSocketServer process.

To stop all running Photon server instances at once:

To stop a specific Photon server instance:

Using Configuration Files

By default, Photon uses configuration file "PhotonServer.config" in the working directory (same folder as "PhotonSocketServer.exe").

If you want to use a custom filename, for instance when you have multiple configurations, you can use:

If you want to explicitly specify a configuration file by path, you can use:

Photon server will not start if the configuration file could not be found.

Photon Performance Counters

To install Windows performance counters for Photon:

If you want to remove them you can use:

Workflow Example

In this complete workflow example we will demonstrate how to install Photon server on a production machine. The Windows service configuration, as well as the use of logman are just suggestions.

  1. Download, unblock and then unpack the content of the Photon server SDK to "C:\Photon"
  2. From Windows command line, go to the binary folder of your choice:

  3. (OPTIONAL) To setup counters and counter logging (using logman):

  4. Install Photon as service:

  5. (OPTIONAL) Configure the service:

On Azure VMs, we made Photon start depended on TermService. To supress issues due to starting Photon before the network is properly configured: sc.exe config 'Photon Socket Server: LoadBalancing' depend=iphlpsvc/TermService start=delayed-auto

Starting and Stopping the service:

From cmd:

From PowerShell:

Clean Up

To remove the counters and the service:

 To Document Top