loowaakaa
Posts: 7
Joined: Wed Jul 11, 2018 11:15 am

Crashing RPi when doing "heavy" stuff

Wed Jul 11, 2018 11:25 am

Hi all,

I have a newly bought Raspberry Pi 3 B+ running updated Raspbian. I'm using it as a Plex server.
Unfortunately it seems to crash sometimes when it runs some heavy tasks. It crashes when transcoding and unrar.
I think that is what triggers it but I'm not sure.

Then I cannot connect to the RPi either public nor local using SSH or orther services. Sometimes it take a couple of hours, then it is up again. Other times I have to reboot it unplugging the power. In the crash situation both lights (on the Pi) are flashing, so it doesn't look like it's dead.

I'm using the official Raspberry Pi power plug and Raspbian is running from a pre-installed NOOBS SD card which I think is also from Raspberry Pi. I bought the starter kit. It's connected via ethernet (same thing happens on WIFI) and running headless so I can't monitor what is going on when it actually happens.

Any idea what I should do to troubleshoot? Can I find some logs somewhere?

Thanks so much in advance!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20777
Joined: Sat Jul 30, 2011 7:41 pm

Re: Crashing RPi when doing "heavy" stuff

Wed Jul 11, 2018 11:38 am

So, do you have a USB attached HD drive, and presuming as its a server, the ethernet is pretty busy?

We have just found a bug in the ethernet driver which we have a fix for, which is going in to the next rpi-update. It tended to exhibit under these circumstances. Try rpi-update tomorrow and see if it fixes the problem.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

loowaakaa
Posts: 7
Joined: Wed Jul 11, 2018 11:15 am

Re: Crashing RPi when doing "heavy" stuff

Wed Jul 11, 2018 1:06 pm

jamesh wrote:
Wed Jul 11, 2018 11:38 am
So, do you have a USB attached HD drive, and presuming as its a server, the ethernet is pretty busy?

We have just found a bug in the ethernet driver which we have a fix for, which is going in to the next rpi-update. It tended to exhibit under these circumstances. Try rpi-update tomorrow and see if it fixes the problem.
Yes I have a HDD attached. It's powered by it's own PSU.

Ok yes, it seems that it's either when I'm streaming from the server or downloading something. But the problem also happens on WIFI.
I will try to rpi-update tomorrow.

Thanks for your reply!

loowaakaa
Posts: 7
Joined: Wed Jul 11, 2018 11:15 am

Re: Crashing RPi when doing "heavy" stuff

Thu Jul 12, 2018 5:25 pm

jamesh wrote:
Wed Jul 11, 2018 11:38 am
So, do you have a USB attached HD drive, and presuming as its a server, the ethernet is pretty busy?

We have just found a bug in the ethernet driver which we have a fix for, which is going in to the next rpi-update. It tended to exhibit under these circumstances. Try rpi-update tomorrow and see if it fixes the problem.
Alright. So I tried rpi-update and triggered the crash by running a python script converting a video file using ffmpeg.
I monitored the Pi on VNC and saw the CPU % increased to 100% before freezing. Weird thing is that the Pi has been running the script before without crashing. But the script itself is not the problem since other crashes aren't triggered by that script.

Tomorrow I will try with a clean installation of Raspbian and see

User avatar
Imperf3kt
Posts: 1387
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Crashing RPi when doing "heavy" stuff

Thu Jul 12, 2018 9:25 pm

Is the red LED on your Pi blinking at all?
Stop plugging your fan directly into the GPIO 5v
https://www.electronics-tutorials.ws/power/transient-suppression.html

loowaakaa
Posts: 7
Joined: Wed Jul 11, 2018 11:15 am

Re: Crashing RPi when doing "heavy" stuff

Fri Jul 13, 2018 11:58 pm

Imperf3kt wrote:
Thu Jul 12, 2018 9:25 pm
Is the red LED on your Pi blinking at all?
The red LED is constantly lighting red. No blinking.
The green is almost constantly lighting green with a little amount of blinking.

I haven't tried a fresh raspbian install yet. It keeps crashing running the script atm.

User avatar
HawaiianPi
Posts: 2920
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Crashing RPi when doing "heavy" stuff

Sat Jul 14, 2018 3:34 am

It sounds like you may be falling into swapping hell. Using too much memory, causing the system to swap large amounts of data between RAM and storage.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

klricks
Posts: 5899
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Crashing RPi when doing "heavy" stuff

Sat Jul 14, 2018 3:43 am

What is your memory split set to? Try a lower value. 16 will give CPU max memory.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

loowaakaa
Posts: 7
Joined: Wed Jul 11, 2018 11:15 am

Re: Crashing RPi when doing "heavy" stuff

Sat Jul 14, 2018 10:24 am

klricks wrote:
Sat Jul 14, 2018 3:43 am
What is your memory split set to? Try a lower value. 16 will give CPU max memory.
A fresh Raspbian Lite has the same results - unfortunately. I will try your suggestion! Thanks

loowaakaa
Posts: 7
Joined: Wed Jul 11, 2018 11:15 am

Re: Crashing RPi when doing "heavy" stuff

Sat Jul 14, 2018 10:25 am

HawaiianPi wrote:
Sat Jul 14, 2018 3:34 am
It sounds like you may be falling into swapping hell. Using too much memory, causing the system to swap large amounts of data between RAM and storage.
Oh... Anything I can do about it? Or does it fall under the same category as the suggestion from klricks?

jahboater
Posts: 3083
Joined: Wed Feb 04, 2015 6:38 pm

Re: Crashing RPi when doing "heavy" stuff

Sat Jul 14, 2018 11:17 am

loowaakaa wrote:
Sat Jul 14, 2018 10:25 am
HawaiianPi wrote:
Sat Jul 14, 2018 3:34 am
It sounds like you may be falling into swapping hell. Using too much memory, causing the system to swap large amounts of data between RAM and storage.
Oh... Anything I can do about it? Or does it fall under the same category as the suggestion from klricks?
The green is almost constantly lighting green with a little amount of blinking.
Constant disk I/O is another indicator.
Look at vmstat (try "vmstat 10 10" say)
Look at free -h
Look at top

If there is a lot of time in "wait io" and lots of disk traffic and no free memory, its probably swapping.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Crashing RPi when doing "heavy" stuff

Sun Jul 15, 2018 10:16 am

Nobody has mentioned the possibility that the workload is causing the PSU to glitch.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

loowaakaa
Posts: 7
Joined: Wed Jul 11, 2018 11:15 am

Re: Crashing RPi when doing "heavy" stuff

Sun Jul 15, 2018 11:40 am

Ok so I tried setting gpu_mem to 16. And so far so good. I put it under a lot of stress and it hasn't been crashing yet. I will keep doing that for a couple of days so be sure it's stable. Otherwise I will try your suggestions. Thank you so much guys!

User avatar
Imperf3kt
Posts: 1387
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Crashing RPi when doing "heavy" stuff

Sun Jul 15, 2018 7:33 pm

Z80 Refugee wrote:
Sun Jul 15, 2018 10:16 am
Nobody has mentioned the possibility that the workload is causing the PSU to glitch.
Thats why I asked if the red LED was flashing as it indicates an issue with the power supply.
Stop plugging your fan directly into the GPIO 5v
https://www.electronics-tutorials.ws/power/transient-suppression.html

Return to “Troubleshooting”