Skip to content

Instantly share code, notes, and snippets.

@ehudros
ehudros / gist:906508
Created April 6, 2011 20:55
hash attributes are not saved to database
class User
include Mongoid::Document
field :game_stats, :type=>Hash
end
console commands to recreate:
ruby-1.9.2-p0 > u = User.create! :game_stats => {}
=> #<User _id: 4d9c9f038533c541ce000001, game_stats: {}>
ruby-1.9.2-p0 > u.game_stats['147'] = {}
=> {}
# set crontab jobs on master only
if ['app', 'app_master'].include?(node[:instance_role])
execute "reducing timeouts in haproxy.cfg" do
command "sed s/'timeout server 120000'/'timeout server 5000'/ /etc/haproxy.cfg > /etc/haproxy.cfg"
command "sed s/'timeout client 120000'/'timeout client 5000'/ /etc/haproxy.cfg > /etc/haproxy.cfg"
command "sed s/'timeout connect 120000'/'timeout connect 5000'/ /etc/haproxy.cfg > /etc/haproxy.cfg"
command "sed s/'maxconn 65535'/'maxconn 2000'/ /etc/haproxy.cfg > /etc/haproxy.cfg"
action :run
end
<ehudros> hi
<@adamholt> hey ehudros
<@adamholt> I've done a little bit of investigation on whats happening with unicorn right now, and i can see that it is actually queueing requests, so newrelic is reporting correctly
<@adamholt> https://gist.github.com/bbe4d031461ef6879424
<@adamholt> as you can see, every 3 seconds or so, all the workers are active and the queueing starts building
<@adamholt> that is polling the socket for stats every second
<ehudros> hmm
<ehudros> Do you think we're simply getting more requests than we can handle?
<@adamholt> i think that might be the case
* Disconnected
redis_version:2.4.2
redis_git_sha1:00000000
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
process_id:13003
uptime_in_seconds:7362
uptime_in_days:0
lru_clock:1242679
used_cpu_sys:26.43
daemonize yes
pidfile /var/run/redis_util.pid
port 6379
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 60
# Set server verbosity to 'debug'
# it can be one of:
# debug (a lot of information, useful for development/testing)
@ehudros
ehudros / gist:e29644cfe5e58b13c04a
Last active August 29, 2015 14:04
openfl html
<html lang="en"><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>babies</title>
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=0.6666666666666666, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
@ehudros
ehudros / gist:97de49ac139aa7e8683f
Last active August 29, 2015 14:04
Flambe html
<html style="height: 287px; width: 598px; overflow: visible;"><head>
<meta charset="utf-8">
<title>Your Game</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="icons/57x57.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="icons/72x72.png">
{
"planets": {
"Candy": {
"zones": {
"GoldProduction": {
"upgrades": [
{
"upgradeType": "GoldPerSecond",
"price": 1000,
"value": 1,
@ehudros
ehudros / file1.txt
Created November 14, 2016 18:21
the description for this gist
String file contents
2016-12-04 13:34:30,379 [10] DEBUG Photon.LoadBalancing.GameServer.GameApplication - CreatePeer for LoadBalancing
2016-12-04 13:34:30,467 [10] DEBUG Photon.LoadBalancing.GameServer.GameApplication - incoming game peer at 192.168.99.21:5056 from 192.168.99.13:62799
2016-12-04 13:34:30,558 [10] DEBUG Photon.LoadBalancing.GameServer.GameApplication - CreateGamePeer
2016-12-04 13:34:30,918 [16] DEBUG Photon.LoadBalancing.GameServer.GameClientPeer - OnOperationRequest: conId=2, opCode=230
2016-12-04 13:34:31,017 [16] DEBUG Photon.LoadBalancing.GameServer.GameClientPeer - Facebook UID found!
2016-12-04 13:34:31,116 [16] DEBUG Photon.LoadBalancing.GameServer.GameClientPeer - HandleAuthenticateRequest - Token Authentication done. Result: 0; msg=
2016-12-04 13:34:31,262 [9] DEBUG Photon.LoadBalancing.GameServer.GameClientPeer - OnOperationRequest: conId=2, opCode=227
2016-12-04 13:34:31,347 [9] DEBUG Photon.Hive.HivePeer - HandleCreateGameOperation Room:b73a2755-b1b8f543 LobbyType:2 LobbyName:SqlLobby
2016-12-04 13: