Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ToJZs-0001C6-NR for pgsql-performance@arkaria.postgresql.org; Thu, 27 Dec 2012 19:57:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1ToJZr-0002tt-VA for pgsql-performance@arkaria.postgresql.org; Thu, 27 Dec 2012 19:57:16 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ToJZq-0002td-Hl for pgsql-performance@postgresql.org; Thu, 27 Dec 2012 19:57:14 +0000 Received: from smtp2.peak6.com ([38.98.137.9]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ToJZo-0000ma-GH for pgsql-performance@postgresql.org; Thu, 27 Dec 2012 19:57:13 +0000 X-AuditID: 0a02cb20-b7f1a6d00000797a-3a-50dca81751b4 Received: from sswchi5pcas2.peak6.net (sswchi5pcas2.peak6.net [10.100.13.24]) by smtp2.peak6.com (Symantec Messaging Gateway) with SMTP id E6.CB.31098.718ACD05; Thu, 27 Dec 2012 13:57:11 -0600 (CST) Received: from [10.10.201.64] (10.10.201.64) by sswchi5pcas2.peak6.net (10.100.13.25) with Microsoft SMTP Server (TLS) id 14.2.247.3; Thu, 27 Dec 2012 13:57:10 -0600 Message-ID: <50DCA815.9070302@optionshouse.com> Date: Thu, 27 Dec 2012 13:57:09 -0600 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" Subject: sched_migration_cost for high-connection counts Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.201.64] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsXClcIroSu+4k6AwdzzwhbXZ55jdmD0uLBv GnsAY1QDo01iXl5+SWJJqkJKanGyrZJ/QUlmfl6xR35pcaqCS2Zxck5iZm5qkZJCZoqtkrGS QkFOYnJqbmpeia1SYkFBal6Kkh2XAgawASrLzFNIzUvOT8nMS7dV8gz217WwMLXUNVSyi0cG CZ0sGY9ndbIWLOWu+NXwmLmBcQFnFyMnh4SAicSy96vZIWwxiQv31rOB2EICJxgl3qy07mLk ArJXMkr8er0QLMEroC8x5+whFhCbRUBV4nP/K0YQm01AV2JS/wqoZhWJvrM3mEBsfgFhiX0f mphBbFGBAInFS86xQ8wRlDg58wnYHBEBT4nZ+7eB2cICFhLnZj0Eq2cWsJW4MOc6C4QtL7H9 7RxmiPmqEiuaJ7JBHK0g8f/KO6YJjIKzkIydhaR9FpL2BYzMqxjFi8sSkzMyzQqKc0sKjPQK UhOzzfTyUks2MYLikem0wg7GzT1WhxgFOBiVeHgX9NwJEGJNLCuuzD3EKMHBrCTC+z0eKMSb klhZlVqUH19UmpNafIjRBxgeE5mlRJPzgakiryTe0NjUwNTS1NDU3NTQCIewkjhvaOiiACGB dGDSyE5NLUgtghnHxMEp1cDId0ckrWYp24fvkYJxtmeyRW3fzijcESw/ebOhxtLae0t7TTZe 8jSImP/niqnzhasZLFzL9idOnLHyP7PWzFfH44XW/1vpr7NjewSTwLGctBK3NpWlZq6RUY2P nY8tnsLHvCt21sM3VroP7G4yGMh19kkVSuX2r/u06L75mwMxHt6VyryTlR4rsRRnJBpqMRcV JwIAGVBidvQCAAA= X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hey guys, I recently stumbled over a Linux scheduler setting that has outright shocked me. So, after reading through this: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html it became readily apparent we were hitting the same wall. I could do a pgbench and increase the connection count by 100 every iteration, and eventually performance just fell off a proverbial cliff and never recovered. For our particular systems, this barrier is somewhere around 800 processes. Select-only performance on a 3600-scale pgbench database in cache falls from about 70k TPS to about 12k TPS after crossing that line. Worse, sar shows over 70% CPU dedicated to system overhead. After some fiddling around, I changed sched_migration_cost from its default of 500000 to 5000000 and performance returned to linear scaling immediately. It's literally night and day. Setting it back to 500000 reverts to the terrible performance. In addition, setting the migration cost to a higher value does not negatively affect any other performance metric I've checked. This is on an Ubuntu 12.04 system, and I'd love if someone out there could independently verify this, because frankly, I find it difficult to believe. If legit, high-connection systems would benefit greatly. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604 312-444-8534 sthomas@optionshouse.com ______________________________________________ See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance