From owner-freebsd-questions@FreeBSD.ORG Tue May 5 10:13:14 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6161498D for ; Tue, 5 May 2015 10:13:14 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0A7E1B34 for ; Tue, 5 May 2015 10:13:13 +0000 (UTC) Received: by wizk4 with SMTP id k4so153986167wiz.1 for ; Tue, 05 May 2015 03:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=AlDUrrNXzGvp1zqWmkJbwBmMoIBXOJnAqEtcFn11bhg=; b=wNz44OhkbDVwNuPzUubSp0qDXDh5CPWfyrt/JT/J7S8mTHzQVDksbr6zu7JXmPgJp8 2Vwu0ZYMykt+JCYZutXmZVitLdsKVW6obySbQTorsRGI7gGRgdSIB4ybLTshshMwlYOY TdbuEn7tUkt6/W4OTDzvaQe4FtOb8HSkeb+a7zHc9GFGguttu87R2nS7Ny0bzmsXKBZ5 d+jaociXENXaSFIspqa6S9siG+G1VVxr8UM7NdoUJnW5KSeEc6ovMdACkFt5X8F21t/N HgoGJ6YD95IGyrBgDQs+00ZkkiTda/qhzjXWcQ/qhO1Zxf2sV+mr3FQWulor3DYF23kX Nvqw== MIME-Version: 1.0 X-Received: by 10.180.77.170 with SMTP id t10mr2555098wiw.5.1430820792380; Tue, 05 May 2015 03:13:12 -0700 (PDT) Sender: fluca1978@gmail.com Received: by 10.194.80.163 with HTTP; Tue, 5 May 2015 03:13:12 -0700 (PDT) In-Reply-To: <20150502201813.91B9E42420@smtp.hushmail.com> References: <20150502201813.91B9E42420@smtp.hushmail.com> Date: Tue, 5 May 2015 12:13:12 +0200 X-Google-Sender-Auth: K_rEA5Pjisvy49cHAZ_ua-GhZVo Message-ID: Subject: Re: Rails app slow after PostgreSQL inactivity From: Luca Ferrari To: opendaddy@hushmail.com Cc: freebsd-questions Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 10:13:14 -0000 Ciao, On Sat, May 2, 2015 at 10:18 PM, wrote: > Could this be related to FreeBSD (DigitalOcean)? Are my PostgreSQL workers are going dormant? Do I need a cron script to act as a little ping pong ball bouncing back and forth making sure everybody's awake? > Checking on the PostgreSQL side I would try enabling log_min_duration_statement to see if there is a problematic query that is causing some issue, as well as a few other log_ options (see http://www.postgresql.org/docs/current/static/runtime-config-logging.html). Have you tried to reproduce the query yourself to see (maybe with explain) what is going on? Are there processes running on the background that can slow down the system (e.g., autovacuum)? Hope this helps. Luca