Status Code | Status Message | Symbol |
---|---|---|
100 | Continue | :continue |
101 | Switching Protocols | :switching_protocols |
102 | Processing | :processing |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>PageView Grid</title> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script> | |
<script> | |
var Keen=Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0-min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})(); | |
Keen.configure({ | |
projectId: "<your-projectId>", |
after "deploy:update", "deploy:cleanup" | |
after "deploy:update", "foreman:export" | |
after "deploy:symlink", "update_haproxy_config_symlink" | |
namespace :deploy do | |
task :stop do | |
run "sudo stop goliath_app" | |
end | |
task :start do | |
run "sudo start goliath_app" |
unicorn.rb | |
----------------------------------- | |
application = "jarvis" | |
remote_user = "vagrant" | |
env = ENV["RAILS_ENV"] || "development" | |
RAILS_ROOT = File.join("/home", remote_user, application) | |
worker_processes 8 | |
timeout 30 |
Why not set backlog on Heroku?
First read this: https://mikecoutermarsh.com/adjusting-pumas-backlog-for-heroku/
Now we're on the same page. Heroku will re-route bounced requests from your dynos but it assumes when this happens that your entire app is saturated. https://devcenter.heroku.com/articles/http-routing#dyno-connection-behavior. Each connection gets delayed by 5 seconds, so you're automatically being docked 5 seconds per request.
If you're setting your backlog to a low value (i.e. if you'll ever actually ever hit backlog) then you'll be in for pain. When you get a spike of requests from slashdot/reddit/whatever you're telling your dynos that you would rather they failed then returned slow responses. So this does mean that some requests will be served, but all the others will fail.
If your app ever hits your backlog (no matter what value it is) it is an indicator you don't have enough throughput and you need to scale out to more dynos. If you set this to an arbitrarilly low value, that point comes
require 'eventmachine' | |
require 'socket' | |
require 'kgio' | |
server = Kgio::TCPServer.new('0.0.0.0', 4242) | |
module Dispatch | |
def notify_readable | |
io = @io.kgio_tryaccept or return | |
EventMachine.attach(io, Server) |
Ruby 1.9.3-p392 | |
=========================================================== | |
All memory used before 1st run - 7 MB | |
Memory consumed by 1st run of eat_up_memory - 445 MB | |
All memory used before 2nd run - 452 MB | |
Memory consumed by 2nd run of eat_up_memory - 20 MB | |
All memory used before 3rd run - 472 MB | |
Memory consumed by 3rd run of eat_up_memory - 5 MB | |
Memory used before explicit GC.start - 478 MB | |
Memory used after explicit GC.start - 284 MB |
This gist is no longer valid. Please see Compass-Rails for instructions on how to install.
require 'rubygems' | |
require 'bundler' | |
Bundler.require | |
require './application' | |
namespace :assets do | |
desc 'compile assets' | |
task :compile => [:compile_js, :compile_css] do | |
end |
package main | |
import ( | |
"unicode" | |
) | |
// ToSnake convert the given string to snake case following the Golang format: | |
// acronyms are converted to lower-case and preceded by an underscore. | |
func ToSnake(in string) string { | |
runes := []rune(in) |