Forums

CPU usage history / trend

I was looking for the history of my sites CPU usage to make sure I have the right plan customizations in place. I know I can see usage for the current day but it doesn't appear there is history anywhere.

I found this thread from two years ago. Has anything changed by chance? https://www.pythonanywhere.com/forums/topic/7529/

Right now I am way below the limit but I'm about to make it more widely available so monitoring CPU usage trend would be really helpful!

Thanks, Chris

Hi Chris- no unfortunately we do not have cpu usage monitoring available to users yet.

Is there anything available via bash, python, etc. that we could capture as part of a scheduled task? Not sure it is worth it but good to know if there is an option.

Thanks!

No- what could possibly make sense would be if we create an api endpoint that lets you get your current cpu usage, and you could just hit it every 5min etc to monitor. We currently do not have that yet.

+1 for this. I was just about to post exactly the same question. It would be really good to be able to see a chart of CPU use. I've just made some changes that should reduce my CPU use - I was up to about 1988 seconds when my cycle restarted! It would be really handy to be able to see if the rate has dropped.

Cool. Noted and upvoted.

Thanks Conrad. Hopefully you guys will make some progress in this area. I love the service but having not access to this info beyond remembering to check at right point in the 24 cycle makes this aspect nearly impossible to manage.

+1 for api

+1 for api

Noted

+1

Upvoted :-)

+2

Downvoted ;-)

(Only kidding, one upvote added.)

please read this ball

+1 ball

Upvoted :-)

i used vectornator on ios to make that ball

Here it is:

/api/v0/user/{username}/cpu/

GET Returns information about cpu usage in json format:

{
    "daily_cpu_limit_seconds": <int>,
    "next_reset_time": <isoformat>,
    "daily_cpu_total_usage_seconds": <float>
}

see the new blog post.

Yay

Excellent, thanks for this! I wish there was a way to also get a history, but at least with the API I could create a scheduled task to capture it.

Yeah, I wanted this too. Look, here's my original forum posts: Forum posts I use it to use 50 percent of my CPU to calculate primes. Look at my website: https://smallbytes.pythonanywhere.com

Your website looks like it was made in the 1990s

Well, your website is so DULL

@smallbytes Yes, you have all the components to track and record CPU usage.

Well, your website is so DULL

Ouch

Yeah, sorry dull.

ValueErrors and stones can break my stones

But baseless opinions about my site never hurt me

Thank you for adding this API endpoint. I just googled to find this same info, to track CPU usage. Just letting you know I appreciate listening to the community requests.