Skip to content

Postgres using full CPU and database+teslamate indicating issues on a query #3948

Answered by matmly24
matmly24 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
If anybody else get the same issue, this is a description of what I performed to correct it.

For information, I have more than 9M of rows in the positions table (60 000 km driving on 2 years) and run Teslamate on a Raspberry Pi 2 Model B with 1 GB RAM (and quadcore 900 MHz) rolled out in 02/2015 (quite old now).

With the "top" and "iotop" utilities, I saw the heavy CPU load and IO usage (15 to 20 MB permanent).

Using SELECT * FROM pg_stat_activity WHERE datname='teslamate' AND STATE='active';
I see that the following query executed by teslamate take a very long time exceeding the 60 s database timeout of Teslamate.

SELECT p0."id", p0."date", p0."latitude", p0."longitude", p0."elevatio…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by matmly24
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants