Whenever I use 'ab' to benchmark a web server, it will freeze for a while after having sent lots of requests, only to continue after 20 seconds or so. Consider the following HTTP server simulator, written in Ruby: require 'socket' RESPONSE = "HTTP/1.1 200 OK\r\n" + "Connection: close\r\n" + "\r\n" + "\r\n" buffer = "" server = TCPServer.new("127.0.0.1", 3000) # Create TCP server at port 3000. serv
A recurring theme that's in my ansible playbooks is that I often must execute a command with sudo privileges (sudo: yes) because I'd like to do it for a certain user. Ideally I'd much rather use sudo to switch to that user and execute the commands normally. Because then I won't have to do my usual post commands clean up such as chowning directories. Here's a snippet from one of my playbooks: - nam
Should you still want to dive in and mess with this deep magic I was able to construct something together form the code I found here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/54013-hardware-volume-change-listener-callback.html You want to register a listen to the AudioProperties and catch any messages about 'kAudioSessionProperty_AudioRouteChange'. Using the 'reason' and the 'name'
I'm investigating migrating our current chef based configuration management to ansible. We build a lot of rails apps that have similar dependencies (ruby, unicorn, nginx, monit, MySQL etc). So at the moment we're using librarian-chef and private github repos to share our common recipes between the different projects. I'm new to ansible, the closest thing I've found is ansible galaxy but that seems
For those of you running Go backends in production: What is your stack / configuration for running a Go web application? I haven't seen much on this topic besides people using the standard library net/http package to keep a server running. I read using Nginx to pass requests to a Go server - nginx with Go This seems a little fragile to me. For instance, the server would not automatically restart i
I have recently stumbled upon the game 2048. You merge similar tiles by moving them in any of the four directions to make "bigger" tiles. After each move, a new tile appears at random empty position with a value of either 2 or 4. The game terminates when all the boxes are filled and there are no moves that can merge tiles, or you create a tile with a value of 2048. One, I need to follow a well-def
Using Rails 3.1.3 and I'm trying to figure out why our counter caches aren't being updated correctly when changing the parent record id via update_attributes. class ExhibitorRegistration < ActiveRecord::Base belongs_to :event, :counter_cache => true end class Event < ActiveRecord::Base has_many :exhibitor_registrations, :dependent => :destroy end describe ExhibitorRegistration do it 'correctly mai
There's a fair bit of confusion about these GC tuning parameters. REE (which is a fork of Ruby 1.8.7) introduced its own parameters first, and later Ruby (starting in 1.9.2) introduced its own (similar) parameters. Ruby 1.9.3 made them customizable via environment variables, and Ruby 2.1.0 added a lot more. This blog post goes into great detail about garbage collection in MRI and what all the tuni
The amount of workers you should use depends greatly on what your app itself is doing and how ofter it is doing those things. There really isn't a perfect ratio formula for it unfortunatly that will work in every single test case. This becomes even more true when you take into account the fact that you have a finite amount of RAM that you have to keep your server on. Many will suggest that CPU Cor
Automatic EXPLAIN on slow-running SQL queries. This feature has been removed from Rails 4. config.active_record.auto_explain_threshold_in_seconds = 0.5 We find it useful, in controlled circumstances. I came up short in searching for answers to the following questions. What was the underlying rationale for removing auto-EXPLAIN? (I'm sure the reasons are sound, but I can't find what they are.) Is t
I've been a bad kid and used the following syntax in my partial templates to set default values for local variables if a value wasn't explicitly defined in the :locals hash when rendering the partial -- <% foo = default_value unless (defined? foo) %> This seemed to work fine until recently, when (for no reason I could discern) non-passed variables started behaving as if they had been defined to ni
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く