Why is ekeyd consuming so much power?

Paul Martin pm at simtec.co.uk
Mon May 7 14:00:55 BST 2012


On Mon, May 07, 2012 at 02:18:27PM +0200, Jan-Piet Mens wrote:
> This is going to sound silly, but ekeyd consumes about 6W of power :)

> I note that `strace' on a running ekeyd shows a (very?) large number of
> system calls:
> 
>         read(6, "* E!43oCQfXPyP+r0Vr2JBYu5qdxdD/a"..., 64) = 64
>         poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6,
>                 events=POLLIN}], 3, -1) = 1 ([{fd=6, revents=POLLIN}])
> 
> with the following totals in about 10 seconds:
> 
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  89.97    0.001866           5       389           poll
>  10.03    0.000208           1       390           read
>   0.00    0.000000           0         1           brk
>   0.00    0.000000           0         1           restart_syscall
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.002074                   781           total
> 
> Is that a normal operation?

Yes, but that's not a huge number of calls in 10 seconds. Most of the
time a poll() will cause the kernel's scheduler to suspend that
process, assuming your kernel can do so.

The ekey sends out entropy data at approximately 4kbyte per second,
split into chunks of 36 bytes, PEM encoded into 48 characters, and
then framed into a 64 character packet.

So, on average we're expecting about 114 packets per second from the
ekey, which would mean about three times as many system calls as
you're seeing.

ekeyd then has to decrypt that data before feeding it into the kernel
(or offering it via EGD protocol). That will use a little CPU too
(about 1% on a 1GHz CPU).

-- 
Paul Martin <pm at simtec.co.uk>
Simtec Electronics         Tel: +44 1772 978010
http://www.simtec.co.uk/   Fax: +44 1772 816426



More information about the EntropyKey-users mailing list