what's the current cronjob interval ? do you run it every 1m ? 1h ?
What's your current DB/table size (is it over few million of records) ?
If you are using big DB's with over millions of records, the queries can hog some high cpu if db structure not properly configured (specific lack of index / key fields)
Also, i see in your script you are fetching data off a 3rd-party website. Depands on internet traffic/connectivity to your hosting, should operation can take few seconds to perform, it might peak the cpu during it as well.
In general, if possible, try to reduce number of times this cronjob runs.
|