Projects tigase _server server-core Issues #1149
Reduce startup time with a lot of database connections (#1149)
Andrzej Wójcik (Tigase) opened 5 years ago

If Tigase XMPP Server is being started with a lot of connections, it takes some time to connect and initialize prepared statements. It would be good to reduce startup time, ie. thanks to the parallel execution of that code.

Andrzej Wójcik (Tigase) commented 5 years ago

I've switched from sequential initialization of prepared statements on the connections to parallel initialization. That reduced startup time. I've also added code to reuse ForkJoinPool and keep it in memory for up tp 60s after the last prepared statement is initialized. That should allow it to be reused even if at some point we would decide to add new data sources at runtime (and it reduces load time as we do not need to created and destroy threads).

wojciech.kapcia@tigase.net commented 5 years ago

Time slashed by half:

pool=200 parallel: 141s serial: 338s

pool=default (32) parallel: 42s serial: 72s

issue 1 of 1
Type
Task
Priority
Normal
Assignee
Version
tigase-server-8.1.0
Spent time
4h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1149
Please wait...
Page is in error, reload to recover