The CPU load is too high!

Topics about the Hardware of Revolution Pi
Post Reply
Elon Sha
Posts: 18
Joined: 17 Aug 2020, 11:40
Answers: 0

The CPU load is too high!

Post 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?
User avatar
dirk
KUNBUS
Posts: 1942
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: The CPU load is too high!

Post 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?
Elon Sha
Posts: 18
Joined: 17 Aug 2020, 11:40
Answers: 0

Re: The CPU load is too high!

Post 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.
Elon Sha
Posts: 18
Joined: 17 Aug 2020, 11:40
Answers: 0

Re: The CPU load is too high!

Post 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.
User avatar
dirk
KUNBUS
Posts: 1942
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: The CPU load is too high!

Post by dirk »

Elon, why is the assumption that RevPi platform is the problem and not the code?
Elon Sha
Posts: 18
Joined: 17 Aug 2020, 11:40
Answers: 0

Re: The CPU load is too high!

Post 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?
User avatar
dirk
KUNBUS
Posts: 1942
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: The CPU load is too high!

Post 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.
Post Reply