Univention Bugzilla – Attachment 5759 Details for
Bug 33458
Increasing CPU usage over time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Threded event loop UVMM performance problem v2
33458_uvmm-performance.py (text/plain), 1.20 KB, created by
Philipp Hahn
on 2014-01-28 22:45 CET
(
hide
)
Description:
Threded event loop UVMM performance problem v2
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2014-01-28 22:45 CET
Size:
1.20 KB
patch
obsolete
>#!/usr/bin/python >import os >os.environ["LIBVIRT_DEBUG"] = "1" >import libvirt >from time import sleep >from threading import Thread > >URLS = [ > "qemu://boksel.knut.univention.de/system", ># "qemu://isalla.knut.univention.de/system", ># "qemu://krus.knut.univention.de/system", ># "qemu://skepp.knut.univention.de/system", ># "qemu://utby.knut.univention.de/system", >] > > >def run(url): > print url, > try: > c = libvirt.open(url) > except libvirt.libvirtError as ex: > print ex > else: > print c > > >def runEventLoop(): > while True: > libvirt.virEventRunDefaultImpl() > > >def openFiles(): > for dirpath, dirnames, filenames in os.walk("/proc/self/fd"): > for filename in filenames: > filepath = os.path.join(dirpath, filename) > try: > link = os.readlink(filepath) > except OSError as ex: > link = ex > print "%s\t%s" % (filename, link) > > >def main(): > libvirt.virEventRegisterDefaultImpl() > loop = Thread(target=runEventLoop, name="libvirtEventLoop") > loop.setDaemon(True) > loop.start() > > while True: > threads = [Thread(target=run, name=url, args=(url,)) for url in URLS] > for thread in threads: > thread.start() > sleep(5) > openFiles() > for thread in threads: > thread.join(.1) > break > sleep(5) > >if __name__ == '__main__': > main()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 33458
:
5741
| 5759