Re: [PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Will Platnick
In New Relic, go back a half hour before the problem started so you can't see that this spike happened and send the same screenshot in. My guess is you have increased activity hitting the DB. Do you have pgbouncer or some kind of connection pooling sitting in front? 198 open server connections coul

Re: [PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Sergey Konoplev
On Mon, Mar 31, 2014 at 3:25 AM, Niels Kristian Schjødt wrote: > I'm running postgresql 9.3 on a production server. An hour ago, out of the > "blue", I ran into an issue I have never encountered before: my server > started to use CPU as crazy. The server is a standard ubuntu 12.04 LTE > install

Re: [PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Niels Kristian Schjødt
Thanks, I don’t think overheating is an issue, it’s a large dell server, and I have checked the historic CPU temperature in the servers control panel, and no overheating has shown. Zone_reclaim_mode is already set to 0 Den 31/03/2014 kl. 16.50 skrev Scott Marlowe : > On Mon, Mar 31, 2014 at 8

Re: [PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Niels Kristian Schjødt
Yes, I could install “perf”, though I’m not familiar with it. What would i do? :-) Niels Kristian SchjødtCo-founder & DeveloperE-Mail: nielskrist...@autouncle.comMobile: 0045 28 73 04 93www.autouncle.comFollow us: Facebook  |  Google+  |  LinkedIn  |  Twitter  Get app for: iPhone & iPad  |  Android

Re: [PERFORM] Slow Count-Distinct Query

2014-03-31 Thread Christopher Jackson
Tom and Shawn, Thanks for the feedback. This has been helpful. It's worth noting that I was spiking this out on my local box using default memory utilization settings. I'll revisit this once we get our production box set up. It's good to know what the best practices are around the enable

Re: [PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Scott Marlowe
On Mon, Mar 31, 2014 at 8:24 AM, Niels Kristian Schjødt wrote: > > Thanks, this seems to persist after a reboot of the server though, and I have > never in my server's 3 months life time experienced anything like it. Could it be overheating and therefore throttling the cores? Also another thing

Re: [PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Merlin Moncure
On Mon, Mar 31, 2014 at 9:24 AM, Niels Kristian Schjødt < nielskrist...@autouncle.com> wrote: > Thanks, this seems to persist after a reboot of the server though, and I > have never in my server's 3 months life time experienced anything like it. > huh. Any chance of getting 'perf' installed and

Re: [PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Niels Kristian Schjødt
Thanks, this seems to persist after a reboot of the server though, and I have never in my server’s 3 months life time experienced anything like it. Niels Kristian SchjødtCo-founder & DeveloperE-Mail: nielskrist...@autouncle.comMobile: 0045 28 73 04 93www.autouncle.comFollow us: Facebook  |  Google+

Re: [PERFORM] Slow Count-Distinct Query

2014-03-31 Thread Tom Lane
Christopher Jackson writes: > tl;dr - How can I speed up my count-distinct query? EXPLAIN doesn't provide a lot of visibility into what the Aggregate plan node is doing, but in this case what it's doing is an internal sort/uniq operation to implement the DISTINCT. You didn't say what value of

Re: [PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Merlin Moncure
On Mon, Mar 31, 2014 at 5:25 AM, Niels Kristian Schjødt wrote: > I'm running postgresql 9.3 on a production server. An hour ago, out of the > "blue", I ran into an issue I have never encountered before: my server > started to use CPU as crazy. The server is a standard ubuntu 12.04 LTE > install

Re: [PERFORM] Slow Count-Distinct Query

2014-03-31 Thread Shaun Thomas
>  tl;dr - How can I speed up my count-distinct query?   You can't. Doing a count(distinct x) is much different than a count(1), which can simply scan available indexes. To build a distinct, it has to construct an in-memory hash of every valid email, and count the distinct values therein. This

[PERFORM] Sudden crazy high CPU usage

2014-03-31 Thread Niels Kristian Schjødt
I'm running postgresql 9.3 on a production server. An hour ago, out of the "blue", I ran into an issue I have never encountered before: my server started to use CPU as crazy. The server is a standard ubuntu 12.04 LTE installation running only Postgres and Redis. The incident can be seen on the