Minimizing CPU Utilization of audisp Plugin
Osama Elnaggar
oelnaggar04 at gmail.com
Fri Oct 5 13:11:28 UTC 2018
Hi,
I'm currently working on a Python audisp plugin. My main routine looks
like this:
if __name__ == '__main__':
try:
...
aup = auparse.AuParser(auparse.AUSOURCE_FEED)
aup.add_callback(process_event, None)
while True:
for _ in fileinput.input():
aup.feed(_)
except:
...
While profiling my plugin, I noticed that 95% + of the CPU time used by my
plugin is used in fileinput.input(), waiting/reading from input
Is there any way to lower this or preferred way to poll/read?
Thanks
--
Osama Elnaggar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-audit/attachments/20181005/8a9bc9cb/attachment.htm>
More information about the Linux-audit
mailing list