Sebastien Fieux wrote:
I had to count the number of connections to the
database needed by XWiki to
set the appropriate number in the DB configuration.
I saw (
http://jira.xwiki.org/jira/browse/XWIKI-2332 ) that there is one
session factory for every Hibernate Store. After a quick look on the web I
understood that a session factory provides one session at a time (basically:
if the session is open, then re-use the same session), and the session owns
the connexions pool, set to 1 by hibernate.cfg.xml. So I assume I should
have one opened connexion for every Hibernate store.
That is true if there are no parallel requests. If there are two or more
requests at the same time, they cannot share the same connection, so
they will block until the connection becomes available.
It is better to use more connections than the minimum; the right number
of connections depends a lot on the server load, the available memory,
the performance of the DBMS, and a sysadmin should be able to decide
what is the best value here.
According to the initXWiki method from the
com.xpn.xwiki.XWiki class, there
is 7 stores :
- Main store
- Attachments store
- Versioning store
- Attachment versioning store
- Recycle bin store
- Attachments recycle bin store
- Migration store (updating the database after XWiki update).
So my question is : Am I right ? Are 7 connexions really enough ? It seems
to work, although I didn't tested everything more than seeing pages. Any
answer from someone having a better knowledge of XWiki's internal
functionment and/or Hibernate would be welcome.
All that waiting for the 1.5 version which should allow a shared factory
between every store...
--
Sergiu Dumitriu
http://purl.org/net/sergiu/