Page 1 of 1

The CPU load is too high!

Posted: 04 Nov 2020, 09:23
by Elon Sha
I use RevPi Core 3+ in a project. I use python to write my program file. However, when I execute the program, Python's CPU usage rate is close to 70% and the CPU load rate is as high as 6. The RevPi Core 3+ has a quad-core CPU. So if the cpu load average is less than 4, it is acceptable. But six is too high and the program crashes quickly. The cost of rewriting code in C or C++ is high. Besides, 8MB of data is exchanged in the processes per second. Is there any good solutions?

Re: The CPU load is too high!

Posted: 04 Nov 2020, 17:09
by dirk
Hi Elon, well if you can post your program then maybe we are able to run it and maybe to provide further information.
What did you expect from your program?

Re: The CPU load is too high!

Posted: 05 Nov 2020, 02:40
by Elon Sha
This is a project of our customer, so it is not convenient to show the source code. Because the programs they wrote took up too much CPU, the system quickly crashed. We also asked customers to optimize the program, but it didn't bring much change. In addition to optimizing the program, are there other ways to help solve this problem?

If this project can be successfully implemented on RevPi, they will have more demand for RevPi in the future. If not, they may consider other options. I will continue to communicate and hope to get more information.

Re: The CPU load is too high!

Posted: 05 Nov 2020, 09:04
by Elon Sha
Customers are reluctant to provide source code because it is a trade secret. However, their project using RevPi is a handling robot for smart storage.

Re: The CPU load is too high!

Posted: 05 Nov 2020, 15:10
by dirk
Elon, why is the assumption that RevPi platform is the problem and not the code?

Re: The CPU load is too high!

Posted: 05 Nov 2020, 15:29
by Elon Sha
I'm sorry to bring you such a misunderstanding. Maybe I didn't express it clearly before. I'm not suspecting that there is a problem with the RevPi platform. The high CPU usage is indeed caused by the code. I just want to know if there is another way to solve this problem besides optimizing the code. Is optimizing the code the only solution?

Re: The CPU load is too high!

Posted: 17 Nov 2020, 10:10
by dirk
Hi Elon, well try debugging. Maybe you should work from the other side - what do you want to solve in which time? You can analyze your requirement i.e. run function every 1ms instead of 1us as you don't need it. So you may speed-up factor 1000. And so on.