-
|
I was asking in the MUC about configuring ejabberd to use a shared pool of DB connections among all the virtual hosts. I was told that I'd achieve that by setting I tried it but it didn't give me the result I expected. I'd like to have a fixed number of DB connections and have all hosts share those. The config I've been trying: This, with a list of three enabled hosts, gaves me 6 open connections to the DB: If I add another host and reload, the count rises to 8: Is this an expected behaviour? If I want to keep the amount of connections to PostgreSQL capped, should I resort to external solutions like pgBouncer? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Looking at the documentation site and to the source code, i think no. This is just a quick look at what I found in the source code:
The query for a vhost built in B) is sent over one of the processes related to that vhost in the pool started in A).
I don't remember such a thing being possible.
I don't see any mention in the documentation site of that possibility. Maybe there's some sentence that allowed to think that? If that's the case, it would be great to know what sentence is confusing, and clarify it. Or maybe add a clarification to the multihost section.
In summary, I think that is not implemented (unless I missed something). |
Beta Was this translation helpful? Give feedback.
Looking at the documentation site and to the source code, i think no.
This is just a quick look at what I found in the source code:
A) ejabberd_sql_sup:init/1 for each vhost, it reads its
sql_pool_sizeoption and starts the corresponding processes that will runejabberd_sql:start_linkfor that vhost. Each process starts a connection to the SQL server.B) On the other hand, the multihost schema option is used in ejabberd_sql_pt when preparing the SQL queries: instead of calling different databases for each vhost, it calls the same database for several hosts, and adds
"server_host="to the SQL queryTh…