From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-1.6 required=3.0 tests=AWL,BAYES_00,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: unicorn-public@bogomips.org Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com [209.85.213.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 543A11F42F for ; Fri, 13 Nov 2015 14:37:41 +0000 (UTC) Received: by igvi2 with SMTP id i2so37104242igv.0 for ; Fri, 13 Nov 2015 06:37:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=firespring_com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type:content-transfer-encoding :content-disposition; bh=JLg4iJURzitCeoz//HuNgQFTxIGqYp9s9O+xboIhAE4=; b=YY2Zmg3vND92Mq9lERYg+s3wonR7clD1qr6pcrJ8kKYH8bC1DPrqGi3EQFo9zNMeI9 iYoCsbPkgcOeZZFZpCvLR3FVIDmAgyF+0RBZNuwrU/TOgq5OtUpLARpiaiB6Qk6q9Tnk ONGAstnn2FLxZQZtoyn9/kfKBPQwlckA9cmriqbFVVbW54HcrxXvDIrEBjpitFVMLB5k 9WgpJO7XDurP+u7q6MGmdFpXvmj38SBLyj0hoDr4pY+V/1KPMRO4A26EtT/qCoP2MMWj 0kfiQ3I+xiaCl3P+mdPQ+JLsxk04y60clJehI0PDuotXmQC2NCoC4Xj3JojpalA/C9Do b8Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version:content-type :content-transfer-encoding:content-disposition; bh=JLg4iJURzitCeoz//HuNgQFTxIGqYp9s9O+xboIhAE4=; b=g6ZuFnf/3h9zIxkLgQPWly4wvcr4Ziioi/F6pM1rd1S3jWFaf6kj/6ygXAM+avZVUF ld0utnfnXsU7Hnv1IgjLbJePVfRoFYmKzVWyrUUcmw5CUAd381U/5KH+nWJTcw3Oa2JT CNkHVMmgpCJcNsBHBFhX5T/cxbvkHrFPCnkpRpNDRJ35mpfVNUnc7SqxMQ3UJ4/44T0Q 1FCZTgc3w1RFUPos5UHSyenWVOSNMQCHKIgE/ni7/M+wH0NOTjaqDaPAqoxTnGmrnnif I67ab0MA2iN7x6nvHjf16Sb7pmUHs+ELgQMNqVnuls8QTbimap6q3SRqXshGymDb3aPT 8wRA== X-Gm-Message-State: ALoCoQk5qQNGt7rMmXcKcUtPJHpOpJEx2tltSvXNra+7nlAppd+tzgvJpemeNXzAeDdxKpaC+tcL X-Received: by 10.50.66.208 with SMTP id h16mr3823833igt.24.1447425460590; Fri, 13 Nov 2015 06:37:40 -0800 (PST) Received: from jharris.hq.firespring.com ([208.82.104.162]) by smtp.gmail.com with ESMTPSA id fs10sm1410835igb.18.2015.11.13.06.37.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Nov 2015 06:37:39 -0800 (PST) Date: Fri, 13 Nov 2015 08:37:40 -0600 From: Jeff Utter To: Michael Fischer Cc: unicorn-public Message-ID: In-Reply-To: References: Subject: Re: Shared Metrics Between Workers X-Mailer: Airmail (335) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline List-Id: On November 13, 2015 at 5:04:28 AM, Michael Fischer (mfischer@zendesk.com(mailto:mfischer@zendesk.com)) wrote: > On Fri, Nov 13, 2015 at 8:51 AM, Jeff Utter wrote: > > > I was wondering if anyone can offer any advice in handling stats > > collections between worker processes in forking servers (like unicorn). > > Specifically, I am attempting to work on a solution for the Prometheus ruby > > gem. Some details are in this issue here: > > https://github.com/prometheus/client_ruby/issues/9 > > We run a statsd server on our application servers, and our > applications invoke statsd operations against various counters and > gauges. The statsd protocol is UDP based and very fast. statsd > itself keeps all data in memory and flushes it to its backend every > few seconds. Yeah, this does seem simpler in the case of forking servers. Part of Prometheus' ethos, however, is that metrics are scraped. I suppose it might be possible to have each worker push (with statsd) to a locally running collector that then creates a scraping endpoint. This, however creates additional load on the server to handle all the incoming stats into the statsd server which would otherwise not be needed if the workers could just increment their own counts. For this specific project I may look into statsd instead of Prometheus, since it doesn't seem to play well with forking servers at the moment. However, I would really prefer to find a way to make it play well with forking servers.