Jump to content

How long should the average PHP script take to run?


futurshox

Recommended Posts

Say you have a script which runs in cron to do a specific job, so it's not part of a web page. It has data going in and out, with a few database transactions on the way. It might have to do the same job with data coming from one to 60+ inputs at once, looping through each inputted data chunk in turn.

 

Yeah, that's as open-ended as anything, I realise, but I'm just looking for a ballpark idea of how long such a script should take to run. 50ms? 500ms?

 

Thanks!

On average, with a database, usually about 0.xxxx seconds somewhere around there. But it really depends on the processes You can look at the bottom of this site and see an average time:

 

"Page created in 0.113 seconds with 17 queries."

 

But you said it could haev 60+ inputs to do, that is 60 queries. So you could times that by 60 and get an average time your script will take to run. But with databases it never is that simple, it will probably take about 5-10 seconds+ to run 60 queries on 1 page.

 

If you can consolidate the queries that would speed up the processing time.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.