pgspider / jdbc_fdw

JDBC Foreign Data Wrapper for PostgreSQL
Other
70 stars 23 forks source link

How to reduce JVM instances to reduce memory usage for high concurrency scenario? #10

Open wangshisan opened 2 years ago

wangshisan commented 2 years ago

PG would fork a new process for each connection. So If I understand correctly, it would launch a new JVM instance for each connection in JDBC_FDW. I am concerned about the memory usage in high concurrency scenarios. Do you have any suggestion?

khieuvm commented 1 year ago

Hello @wangshisan,

Each connection (1 application) in JDBC_FDW will create a new JVM and work on it. And this JVM can not be shared between multi-applications: https://en.wikipedia.org/wiki/Application_Isolation_API.

By the way, if JVM can be shared between multi-applications, it is so hard to manage it. Example below:

Application 1 created a new JVM Application 2 uses JVM's App1 Application 3 uses JVM's App1

If Application 1 crashed or ended by user and Application 2, 3 is running --> Application 2, 3??

So could you give me your opinion about it?