Photon and Azure or EC2

Options
calbert
edited April 2011 in DotNet
Anyone successfully hosted the Photon server in the cloud, either Windows Azure or Amazon EC2?

Comments

  • Tobias
    Options
    Yes, we did try EC2. Getting a public / static IP is also easy with this.
    We currently work on a floating license mechanism so we don't bind those to IPs or Hardware IDs anymore. This makes hosting in a cloud much easier.
    If you test Azure, let us know how you liked it. EC2 is pretty nice.
  • I have played around with Azure, just not with Photon in Azure, not sure if it is possible to run an executable in the cloud. I will have to give it a try and let you know what I find.
  • Tobias wrote:
    Yes, we did try EC2. Getting a public / static IP is also easy with this.
    We currently work on a floating license mechanism so we don't bind those to IPs or Hardware IDs anymore. This makes hosting in a cloud much easier.
    If you test Azure, let us know how you liked it. EC2 is pretty nice.


    I'm running Photon on EC2 but can't access my game (Unity Island Demo) from outside, because I have to specify IP address... and I can't even ping amazon "elastic ip". I've lost whole week discovering how to fix this. Please could you give me some instructions how to access photon server on EC2? I've tried to open ICMP protocol, but can't open it for port 5055. Thanks in advance for any help,

    Milan
  • dreamora
    Options
    icmp is not opened for ports but in general

    5055 would be the UDP port to open to connect to it
  • Thanks for quick reply!
    There is ip_address:port_number inside Settings.cs in UnityDemo example (ie: const string ServerAddress = "79.125.117.165:5055";). 79.125.117.165 is my EC2 Elastic IP. I can't ping that IP and also can't access photon server from my game. I've opened udp port 5055 for all IP's (0.0.0.0/0) in ec2 management console and I don't know what to do more.
    Milan
  • dreamora
    Options
    unsure about how EC2s work so just to be sure: is the windows firewall disabled on the machine?
  • Tobias
    Options
    Having a static IP is optional. You can use EC2 with any IP which is assigned when you start an instance OR request an "Elastic IP" and use that. If no instance is running, Elastic IPs will costa small fee.

    How to get your EC2 IP
    When you started an instance you get a remote desktop host address which looks like this:
    ec2-79-125-108-110.eu-west-1.compute.amazonaws.com
    The part "79-125-108-110" should match the instance's assigned IP (independent of Elastic IP or not). I think it's possible to visit http://www.whatismyip.com from the remote desktop to get the assigned IP.
    This IP is the one you want to use in your clients.

    Security Setup Part 1
    In the AWS Management Console (web) you can setup Security Groups. One of those needs to open Photon's ports to all IPs. There are:
    UDP port: 5055
    TCP port: 5055 or 4530, 843 and 943 (the latter two are for Flash and Unity3 Web clients which use policy files)
    Don't remove the RDP protocol setup, or you will exclude yourself from remote desktop.
    Assign your Security Group to the instance you created (or on creation).

    Security Setup Part 2
    On the remote desktop, you possibly need to setup "Windows Firewall with Advanced Security". This is relatively new: the OS won't allow connections even though they go though the Security Groups. To fix this, you need to setup "incoming" rules for TCP and UDP. I attached two pics that show the important part of the settings. Additionally, under "General" select "Allow the connection" and don't limit the remote IPs connecting.

    Photon Settings
    After starting an instance, it gets a random public IP or you assigned it a Elastic IP. If you change the IP while Photon is running (by assigning or removing an Elastic IP), you need to restart Photon. The IP that is assigned locally to the machine's hardware might have changed.


    This should be it. You are not able to ping your system but you should be able to connect to Photon running on it.
    Let me know if you could fix your setup.
  • It works!!! Thanks for quick and efficient help. Great support!!!

    Best regards,
    Milan
  • gnoblin
    Options
    Hello!

    Amazon is offering a free micro instance for new clients - will it be enough for normal Photon usage? :)

    thanks,
    Slav
  • Tobias
    Options
    Test it. We're not new clients there ;)
  • Boris
    Options
    gnoblin wrote:
    Hello!

    Amazon is offering a free micro instance for new clients - will it be enough for normal Photon usage? :)

    thanks,
    Slav
    define "normal".
    It will usually be not enough. Just logging in with a remote desktop bumps the CPU to 100%, no more room for photon. If you are talking 10 connections, and you don't care if they drop.. sure!
  • gnoblin
    Options
    Ok, thanks for the info!
  • Boris
    Options
    calbert wrote:
    I have played around with Azure, just not with Photon in Azure, not sure if it is possible to run an executable in the cloud. I will have to give it a try and let you know what I find.
    From what I heard Azure won't support UDP connections but TCP should work.
    We haven't tested it though.
  • Tobias
    Options
    We are prototyping with Azure but there are several hurdles. Last but not least: Photon is not stateless. Azure would have a single public IP and their load balancing might relay requests of one client to any of the machines in the cloud. This won't work (yet) with Photon.
  • gnoblin wrote:
    Amazon is offering a free micro instance for new clients - will it be enough for normal Photon usage? :)

    I tried out Micro and it was inconsistent. If I recall they said it could boost upto 2 amazon compute units, but only for small periods of time. They seem to get the CPU bandwidth that just happens to be left over. So they will run well for a few minutes, then lag like a monster for the next few minutes.
  • dreamora
    Options
    also the lower 2-3 Amazon instance types have had major problems with bandwidth and latency for a long time.
    Developped a photon based game on the big instances hosted in Ireland last year and even there I got latencies from 80ms to 450ms changing all the time, which is totally inacceptable for game usage

    I ended up using my homeserver running on a 1mbit upstream VSDL connection cause it offered consistent 100ms latency and was enough for the scale of the test in that phase.
  • astk
    Options
    Free tier doesn't apply to Windows instance. :)
  • 82apps
    Options
    Tobias said:


    Security Setup Part 1

    In the AWS Management Console (web) you can setup Security Groups. One of those needs to open Photon's ports to all IPs. There are:

    UDP port: 5055

    TCP port: 5055 or 4530, 843 and 943 (the latter two are for Flash and Unity3 Web clients which use policy files)

    Using this configuration, I kept having troubles connecting to a loadbalancing game server (was able to connect to the master server, but not create or join a room) and the solution was to change my security group rule for UDP to specify the port range 5055-5057.

    Does this make sense? Should this quoted comment be updated to include this information?