Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sElvZ-003WoG-Gj for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2024 08:23:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sElvZ-006Sfx-GT for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2024 08:23:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sE2iB-009apJ-Ns for pgsql-general@lists.postgresql.org; Mon, 03 Jun 2024 08:06:35 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sE2i6-003DmG-AY for pgsql-general@lists.postgresql.org; Mon, 03 Jun 2024 08:06:34 +0000 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3d1bcad2ceeso1758639b6e.0 for ; Mon, 03 Jun 2024 01:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fresho.com; s=google; t=1717401989; x=1718006789; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=90X6wbp+m8QgeBWDU/t6wZ5fVvyyXr2doIZ2NTFS8Ms=; b=XvCCTIQRW7RypPhtC/x+Y6cUWvt1Rzqghn6i3x3MM/vuVrr5JJ28MLAsPLd1FNRQUO HbdKRC40FDhx2nbKwBmJdvJQmZFLWzgGOXvMs+mS2crypZHzeOWgXD+zlgr+VRzTKDlc 2OLh3JyJ8fyEhsPoxDG8hR16MQduTax6HMbcc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717401989; x=1718006789; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=90X6wbp+m8QgeBWDU/t6wZ5fVvyyXr2doIZ2NTFS8Ms=; b=bCmPgNC/fNBxsSKUgfnpT3QYL3COobtlKg/R09chOPO74iGAVXpp4I/4RFWVn7gTls u781MlxZzgewwAZirq+f2y4QCeKbWW4kLd9/SsivXm6PogdFX5Hlg2ozSIw1p3ou4xqV 2Fje6ut2WSbLbxPrDCandgJQo03ml/I1bDT9qC44X2kqsU4AvrAODCwMdbpkq5ARe1bS m8gVrH3MMxmOH6h0XIMIF+6tQn6W0veA3gTfmIsH40aOZbEVRqXwME4RxBDAOslCRMTJ 0X1D28kL27gI6MC/aR5JOTNML2U+kKuyl5kVpCfFmzcub16NoSWQUvdMNhDTM3538sw2 BQqw== X-Gm-Message-State: AOJu0YzfM2QRDdC2n7xe+1noJARJdtRrRLyXuYG3s8V8YxRszbcCw+UI 04bUqRCkLDey5AVveeOyYhtcE7DVEorvVfQWtSAKYzqAQpwFvacIQeQhDyFgedA/CtSS8BG8zyj dJw3P2HHNAz8YelAqsVVLBiZPBXG8uQdeIRYC4nVh73arZgfa X-Google-Smtp-Source: AGHT+IGanhfAX57RRDXe+NxQmrZuZFwTgOGoZqHfiQiHZZ9cy042Rc/qzfSvEh6UgusF8BLyHvXoNl7xfJmX3cNtlOw= X-Received: by 2002:a05:6808:1a1c:b0:3d1:e457:bb55 with SMTP id 5614622812f47-3d1e457cb6emr3252251b6e.11.1717401989197; Mon, 03 Jun 2024 01:06:29 -0700 (PDT) MIME-Version: 1.0 From: Sam Kidman Date: Mon, 3 Jun 2024 18:06:18 +1000 Message-ID: Subject: Poor performance after restoring database from snapshot on AWS RDS To: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk We keep the staging environment of our application up to date with respect to production data by creating a new RDS instance for the staging environment and restoring the most recent production snapshot into it. We get very poor performance in the staging environment after this restore takes place - after some usage it seems to get better perhaps because of caching. The staging RDS instance is a smaller size than production (it has 32GB ram and 8 vCPU vs production's 128GB ram and 32 vCPU) but the performance seems to much worse than this decrease in resources would account for. I have seen some advice that vacuum analyze should be run after the snapshot restore but I thought this was supposed to happen automatically. If we did run it manually how would that help? Are there any other tools in postgres we can use to figure out why it might be so much slower? Best -- Sam Kidman Web Developer Melbourne