Running my own server

174 views
Skip to first unread message

Pinky2012

unread,
Nov 17, 2012, 9:29:22 AM11/17/12
to moga...@googlegroups.com
Well I managed to get Mogade running on my development machine (Ubuntu 12.04). There where some small problems getting there:
  • the config/settings.yml (sample) contained an error: it says development where it should say defaults
  • the config/settings.yml (sample) was missing some entries (notifier, aws bucket)
  • the server needed an newrelic account. I just removed newrelic from the Gemfile and that seems to solve that problem.

Now for reversing the no-new-accounts and no-new-leaderboards changes.... even on my own server Mogade is not accepting new developers ;-)

Still a few questions someone might have the answer to:
  • what are the notifier settings (site and url) used for ?
  • what is AWS used for in combination with Mogade? Do I really need it or can I do without?

Pinky2012

unread,
Nov 17, 2012, 10:17:42 AM11/17/12
to moga...@googlegroups.com
Reverted the changes and have registered a game with simple leaderboards and achievement in MyMogade. Now to figure out where and how I can access the API from my game...

Pinky2012

unread,
Nov 17, 2012, 10:19:26 AM11/17/12
to moga...@googlegroups.com
Duh... should have included the port number of course (in my case it defaults to 3000).


Op zaterdag 17 november 2012 16:17:42 UTC+1 schreef Pinky2012 het volgende:

Karl Seguin

unread,
Nov 17, 2012, 6:49:38 PM11/17/12
to moga...@googlegroups.com
AWS is used for file storage alone..pretty sure everything will work even without it.

The notifier callback simply posts all errors that mogade.com receives. It's a custom service. You can simply not define it and it'll be ok. You could use another service, like the expensive New Relic or http://www.exceptional.io/ or anything else (or nothing at all).

It hasn't used New Relic in ages...removing any reference is safe.

Karl

Pinky2012

unread,
Nov 18, 2012, 3:31:43 AM11/18/12
to moga...@googlegroups.com
Got it working thanks!  Just a question on performance. What is your experience with memory usage of MongoDB/Redis/RoR?  Is there any indication of memory leaking (do I need to schedule an automated reboot nightly)?

I'm currently hosting the server on a VPS with 1024MB RAM, 100GB storage and 2 cpu cores on Ubuntu 12.04LTS. That server is also used for providing multiplayer through a private XMPP (ejabber) service (currently the server serves 100 users but as soon as I introduce the service to the iPhone/iPad version of the App this amount is to grow up to about 20.000, with an expected concurrent user count of max. 1.000). 

Current memory usage (with 100 registered XMPP users, 2 online users and Mogade up-and-running for 2 games) is already 350MB.


Karl Seguin

unread,
Nov 18, 2012, 7:27:06 AM11/18/12
to moga...@googlegroups.com
I think passenger has some proces management system that'll take care of making sure things are kept clean/recycled on the ruby/rails front. I haven't had to reboot the machine since setting it up.

I do run a number of nightly jobs. They do various things (but mostly deal with cleaning up stale data):

10 4 * * * /opt/ruby/bin/ruby /opt/jobs/mogade/runner.rb clean_stats
15 4 * * * /opt/ruby/bin/ruby /opt/jobs/mogade/runner.rb clean_ranks
20 4 * * * /opt/ruby/bin/ruby /opt/jobs/mogade/runner.rb clean_scores
25 4 * * * /opt/ruby/bin/ruby /opt/jobs/mogade/runner.rb destroy_games
30 4 * * * /opt/ruby/bin/ruby /opt/jobs/mogade/runner.rb destroy_leaderboards
35 4 * * * /opt/ruby/bin/ruby /opt/jobs/mogade/runner.rb shrink_ranks
40 4 * * * /opt/ruby/bin/ruby /opt/jobs/mogade/runner.rb destroy_profile_images

I can tell you that the Redis and Mongo are currently using 1.3 and 2.0 gb of memory respectively..which is everything (4 million scores...hundreds of thousands of stat keys...)

Karl

Pinky2012

unread,
Nov 18, 2012, 10:50:53 AM11/18/12
to moga...@googlegroups.com
Seems that I do not have to worry any time soon that I will be running into performance problems (I do not expect anything near 4 million scores). I'll dive into the nightly jobs to see what exactly they are doing and make sure I have them scheduled as well. 

Robin


Op zondag 18 november 2012 13:27:06 UTC+1 schreef Karl Seguin het volgende:

javadude

unread,
Dec 10, 2012, 6:51:52 PM12/10/12
to moga...@googlegroups.com
Hi Pinky,
  I'm also trying to setup the mogade server to run in my server (Centos 6.3).  I'm tried to follow your posted comments about the missing buckets and notifiers.  Attached is my settings.yml, can you provide some tips on if anything is misconfigured?

  I'm more of a Java person than Ruby on Rails.  this is my first time playing with RoR.

This is the error i"m getting, about some missing "notifier" method. 
mogade-server-master/lib/settings.rb:5:in `method_missing': notifier is not in the config file (Settings::MissingConfigOptionError)
    from /home/javadude/Software/mogade-server-master/config/initializers/error_notifier.rb:1:in `<top (required)>'
    from /home/javadude/Temp/Gems/ruby/1.9.1/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `load'
    from /home/javadude/Temp/Gems/ruby/1.9.1/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `block in load'
    from /home/javadude/Temp/Gems/ruby/1.9.1/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/javadude/Temp/Gems/ruby/1.9.1/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `load'


Thanks alot for your help.

javadude

unread,
Dec 10, 2012, 6:54:59 PM12/10/12
to moga...@googlegroups.com
Below  is my settings.yml file

defaults: &defaults
  admin_email: mog...@mogade.com
  max_image_length: 25600
  twitter:
    key: consumer_key
    secret: consumer_secret

development:
  <<: *defaults
  cdn_url: http://0.0.0.0:3000
  ssl_cdn_url: http://0.0.0.0:3000
  postmark_key: postmark_api_key
  aws:
    key: aws_key
    secret: aws_secret
    bucket: name_of_bucket_name
  mongo:
    host: localhost
    port: 27017
    name: mogade2_dev
  redis:
    host: localhost
    port: 6379
    database: 0

test:
  <<: *development
  mongo:
    host: localhost
    port: 27017
    name: mogade2
  redis:
    host: localhost
    port: 6379
    database: 1

production:
  <<: *defaults
  cdn_url: http://0.0.0.0:3000
  ssl_cdn_url: http://0.0.0.0:3000
  ruby_inline_directory: '/home/blah/tmp' #where rubyinline should load its tmp files
  postmark_key: postmark_api_key
  aws:
    key: aws_key
    secret: aws_secret
    bucket: name_of_bucket_name
  mongo:
    host: localhost
    port: 27017
    name: mogade2
  redis:
    host: localhost
    port: 6379
    database: 0

Henry Tran

unread,
Dec 11, 2012, 9:10:56 PM12/11/12
to moga...@googlegroups.com
I got the mogade server up and running.  Here's the settings.yml if anyone needs it.  It's just good enough to get the server running, but you may want to customize it further. 

defaults: &defaults
  admin_email: mog...@mogade.com
  max_image_length: 25600
  twitter:
    key: consumer_key
    secret: consumer_secret
  notifier:
    url: http://www.google.com
    site: http://www.google.com


development:
  <<: *defaults
  cdn_url: http://0.0.0.0:3000
  ssl_cdn_url: http://0.0.0.0:3000
  postmark_key: postmark_api_key
  aws:
    key: aws_key
    secret: aws_secret
    bucket: name_of_bucket_name
  mongo:
    host: 127.0.0.1
--
Sincerely,


Henry Tran

Pinky2012

unread,
Dec 12, 2012, 1:46:14 AM12/12/12
to moga...@googlegroups.com
The settings file of Henry should work. In your settings.yml  (which is better if you distinguish between production and development environments) you coud just add the notifier and twitter entry (under defaults) and fix the typo (marked in yellow). 

You shoud also register for a postmark account so you can register on your own server and receive the confirmation mail. Registration is free and you get 1000 free mails (the should be enough for a private server ;-)) 

Rgds.


Op dinsdag 11 december 2012 00:54:59 UTC+1 schreef javadude het volgende:
  <<: *development  <= change developments to defaults 

Steve. Warren

unread,
Feb 2, 2014, 5:10:19 PM2/2/14
to moga...@googlegroups.com
I know I am late to the game, but if anyone else is trying to get things going you can fix the issues with "reversing the no-new-accounts and no-new-leaderboards" by reverting the last changes to the views i the /app/views/manage directory.
Reply all
Reply to author
Forward
0 new messages