Raspberry does not use all the CPU

1.3k Views Asked by At

I have a raspberry 2 (with raspbian), I installed Iceweasel and I added the addons iMacros. I created a script in js, is really very slow, however, is only used 25% of CPU and less than 50% of ram. Why it can not use all the resources? and complete the task in less time?

3

There are 3 best solutions below

0
abto On BEST ANSWER

You are processing a single task on your raspberry pi.

The raspberry has a quad core processor (product page).

Because a single task can only run on one core the same time, only 25% of the cores are fully used.

0
rkosegi On

You didn't count I/O. When OS runs from SD-card it can be much slower then you expect.

Try this :

time /path/to/your/command args

It will post something like this: real 0m1.096s user 0m0.220s sys 0m0.060s

This will give you more info where is which portion of time is spent.

It is also possible to use

strace -f -t /path/to/your/command args

This will give you verbose output of system calls with timestamps

0
Michael Mairegger On

That is because the Raspberry PI 2 has a quad-core processor. Because JavaScipt doesn't allow multithreading you are limited by doing the work on one core. Therefore if one core is loaded 100% the whole processor is 25%.