Home > Software design >  My old laptop runs a Python script every 5 minutes. How long until it burns out?
My old laptop runs a Python script every 5 minutes. How long until it burns out?

Time:11-17

I have a Python script that checks my email via SMTP every 5 minutes. If it receives an email with a specific subject line it executes a more complicated Selenium script. That result might happen once a day, maybe once every other day. So for the most part my computer sits with the display off, but still awake, and every 5 minutes it checks my email, looking for a particular subject. I also set the computer to go to sleep every night at midnight and wake up at 5am and begin the process again.

I chose to run this repetitive task on my old laptop (2012), not my primary computer. I'm sure this is not great for the computer, but is it really that bad? To just sit there (awake) all day, and just check my email? It seems like a pretty light workload, but I'm also not letting it sleep and it only gets 5 hours of uninterrupted sleep every night.

I'd like to run the script every 5 minutes, if possible. Even when it succeeds the more complicated script, the whole process only takes like maybe 1 or 2 minutes. Should I somehow modify the script so it sleeps for 3 minutes after running? Would sleeping 3 out of 5 minutes over and over again help very much? Or would that be negligible?

I'm running a script over and over again on my computer and wondering if that's terrible for it.

CodePudding user response:

A laptop from 2012 is 10 years old now and can be expected to break any moment. But I wouldn't be surprised if it continues to run for another 5-10 year neither.

There's no point in worrying about the load. Being turned on and doing nothing and running an app that checks the mail makes no difference at all. The only risky load is rebooting or anything that generates heat. As long as you keep CPU below 35% it should be fine.

CodePudding user response:

running a script continuously is wear and tear on the CPU. Given how many RPIs you're running through, your laptop could be severely damaged. Please reference this article from Mozilla developer documentation: https://developer.mozilla.org/en-US/docs/Learn/Accessibility/Mobile

  • Related