Skip to content

Persistent Libvirt Connections#388

Merged
retspen merged 4 commits intoretspen:masterfrom
myvision-de:connection-pooling-pr
Aug 27, 2014
Merged

Persistent Libvirt Connections#388
retspen merged 4 commits intoretspen:masterfrom
myvision-de:connection-pooling-pr

Conversation

@Phist0ne
Copy link
Copy Markdown
Contributor

Implements connection pooling. Only one connection per vm-host per webserver-process is created and managed by a new class "wvmConnectionManager".
Outside of the vrtManager.connection module the old behaviour is preserved.
This is tested with apache2 using mod_wsgi and the Django development server. Nginx was not tested.
The branch https://github.com/myvision-de/webvirtmgr/tree/connection-pooling-debug may be useful when testing this PR with another server.

Commit c8f0293 is optional. It prohibits some further log spamming in auth.log. It may be more practical to evaluate the error code from libvirt to determine if authentication fails or the server is just down.

  * connections are shared among threads (not processes)
  * settings LIBVIRT_KEEPALIVE_INTERVAL and LIBVIRT_KEEPALIVE_COUNT added to control the clientside keepalive protocol
  * one connection per host will be created and used as long as it is alive
….log (at least for ssh connections). Connection error messages should be enough to determine what went wrong.

In the future it may also be possible to set "connection failed" based on the last error code returned by libvirt.
@Phist0ne Phist0ne force-pushed the connection-pooling-pr branch from 02fd284 to 9aaca9e Compare August 25, 2014 13:15
@Phist0ne Phist0ne changed the title Connection pooling pr Persistent Libvirt Connections Aug 25, 2014
@retspen
Copy link
Copy Markdown
Owner

retspen commented Aug 27, 2014

Great job. Thanks!

@retspen retspen merged commit 9aaca9e into retspen:master Aug 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants