Queries are very slow or do not complete (same queries in pgAdmin 4 are fast)

Answered

DataGrip 2017.1.4

Connecting to a remote PostgreSQL DB server with the latest version of the supplied driver.

 

I'll get a couple of queries to complete in the expected time then they start to perform very slow or not complete at al.

At the same time, and from the same system, I can connect and run queries in the expected time from pgAdmin 4.

 

I'm evaluating DG and prefer the feature set over pgAdmin but I have to be able to have queries complete in the expected time frame.

14 comments
Comment actions Permalink

Hi,

Could you provide any example and overtime value?

Thank you.

 

0
Comment actions Permalink

Pretty much anything: select * from table

select * from <any_table>;

283ms on pgAdmin.

> 15 minutes on DataGrip.

 

It's not consistent. DG will occasionally return results in the same time frame as pgAdmin but the majority of the time the queries are that slow.

0
Comment actions Permalink

@Dkennedy Hi,

Could it be network latency?

Are there any errors in IDE logs?

Could you capture packets with Wireshark?

Thank you.

0
Comment actions Permalink

I checked the log dir. I see two things there.

 

1. In the idea.log are WARNs and an error related to the bash shell a failure to run something from my ~/.bashrc :

2017-06-05 09:24:23,049 [ 20205] WARN - .intellij.util.EnvironmentUtil - shell env loader is timed out
2017-06-05 09:24:24,136 [ 21292] WARN - .intellij.util.EnvironmentUtil - failed to terminate shell env loader process gracefully, terminating forcibly
2017-06-05 09:24:24,264 [ 21420] WARN - .intellij.util.EnvironmentUtil - can't get shell environment
java.util.concurrent.ExecutionException: java.lang.Exception: rv:137 text:0 out:bash: no job control in this shell

 

2. Many threadDumps-freeze log directories with mutiple thread dump files in each.

I copied the first one from today here:

https://pastebin.com/axLQUcut

 

 

While DG is showing the spinner in the results window I can start the same query in pgAdmin and it will complete in < 1s.

0
Comment actions Permalink

Oops! The idea.log error:

 

2017-06-05 09:24:23,049 [ 20205] WARN - .intellij.util.EnvironmentUtil - shell env loader is timed out
2017-06-05 09:24:24,136 [ 21292] WARN - .intellij.util.EnvironmentUtil - failed to terminate shell env loader process gracefully, terminating forcibly
2017-06-05 09:24:24,264 [ 21420] WARN - .intellij.util.EnvironmentUtil - can't get shell environment java.util.concurrent.ExecutionException: java.lang.Exception: rv:137 text:0 out:bash: no job control in this shell

(Fails executing docker-machine to start a docker container that is already running.)

0
Comment actions Permalink

Do the thread dumps indicate a problem?

There are other people in the same organization running DataGrip without the problems I am seeing.

0
Comment actions Permalink

@Dkennedy Hi,
Logs and thread dump is not connected to your problem.
Do you run Postgres in docker?

Could you capture packets with Wireshark?

Thank you

 

0
Comment actions Permalink

Hi Vasily,

The Postrges server is remote production database server. I believe it is running in a container.

I haven't used Wireshark before. I did install it and it looks simple to have it capture a trace, but I have no idea whether to filter anything or any other settings needed.

 

Thanks

-D

0
Comment actions Permalink

I started up a Postgres docker on localhost and have no problems with DG queries to that instance.

0
Comment actions Permalink

Having the same problem a year later (and I'm not really surprised you haven't received an answer).

1
Comment actions Permalink

I have the same problem, connecting to AWS Postgres...

0
Comment actions Permalink

Felipe Drequeceler Pinto,

Could it be network latency?

Are there any errors in IDE logs?

Could you capture packets with Wireshark?

0
Comment actions Permalink

vasily chernov,

Could it be network latency?

I don't think it's related to network latency, I've been using pgadmin4 for months, without errors. When I try Datagrip, it occurs in 1 out of 5 consultations.

Are there any errors in the IDE logs?

There is no error in the IDE logs, neither in interface or the output and the logs show that the query is still running. It only stop if I cancel the query by clicking in stop button.

Using pgadmin, I've checked that the Datagrip query was still running. I realized it started and ended but looking at the Datagrip interface the query was still running.

Could you capture packets with Wireshark?

I installed and I am currently trying to filter it correctly, is there any tip to do so?

1
Comment actions Permalink

Felipe Drequeceler Pinto,

As for running queries there is an issue https://youtrack.jetbrains.com/issue/DBE-7328

As for wireshark - just record activity for the db port. It'd be enough.

UPD:
Also, I've created an issue https://youtrack.jetbrains.com/issue/DBE-12077 - feel free to post comments there

 

0

Please sign in to leave a comment.