Portal Home > Knowledgebase > Articles Database > 0.2 secs - is this an ok script exec time?


0.2 secs - is this an ok script exec time?




Posted by Red Squirrel, 11-13-2008, 10:00 PM
0.2 secs - is this an ok script exec time? I'm working on the web client for my control panel and noticed my script execution times are around 0.2 secs. I'm more used to seeing like 0.01 sec on that server. (home server - so its low resource usage). Keeping in mind this web client communicates to the server via tcp packets, does this sound like an ok execution time or is that really bad on the server? This is getting exciting though, as I'm starting to get to the point where I get some output out of my application. Soon I will be able to add functionability. The past few months have been pure back end/engine. __________________http://www.uovalor.com/ :: UO serverhttp://www.serverweave.com/ :: Server Control Panel - In Progress...

Posted by dawei, 11-14-2008, 12:25 AM
This would really depend on what the script is doing during those 0.2 seconds and how well the performance would scale up as you increase the system load, especially if you are bound by I/O or database bottlenecks. It may be a good idea to setup a test environment to hammer the script with requests to see how well it holds up to abuse right now.

Posted by vpsville, 11-14-2008, 05:49 AM
It depends on how often that script runs. If it runs more often than 5 times a second, you'll get a backlog of unprocessed scripts and the machine will bog down. __________________VPSVilleToronto Canada and London UK www.vpsville.ca www.vpsville.co.uk

Posted by user_204207, 11-14-2008, 06:53 AM
If it was something like the login script for a forum, that'd be a problem, but if it's rarely ran then it should be okay. I've got a script that takes over 4 minutes to exec __________________ I love to make websites. I love to program. I'm hosted by downtownhost and they're brilliant!

Posted by etogre, 11-14-2008, 03:22 PM
Well, 0.2 sounds like you have a bottleneck SOMEWHERE. Tracking it down could be tough, use lots of benchmarks. However, 1/5 of a second is still pretty instantaneous to the human eye, but it is starting to push it.

Posted by (Stephen), 11-14-2008, 03:40 PM
Quote: Originally Posted by etogre Well, 0.2 sounds like you have a bottleneck SOMEWHERE. Tracking it down could be tough, use lots of benchmarks. However, 1/5 of a second is still pretty instantaneous to the human eye, but it is starting to push it. Not really, it fully depends on the code, I have some scripts that may run for 20+ hours doing IO intensive work. __________________Jodohost Operations Manager

Posted by Unquantifiable, 11-14-2008, 05:49 PM
To find out if it's the TCP ACKS that are inflating your execution time do the following test: append all output to a variable instead of printing directly and then echoing it to the browser right after the 2nd time function that you are using to time the script.

Posted by Red Squirrel, 11-14-2008, 06:42 PM
That's the thing, it runs whenever you click a link in the control panel. So if a user decides to be "smart" and hold down his enter key and run it non stop, he'd bog down the server right? mind you I could add throttling to it and temp ban IPs if it actually became an issue. In general this is what the script does each time it is executed assuming user is logged in and authenticated: - loads authkey from cookie - opens tcp socket to server, sends auth key - waits for server response to see if it's valid or not - if valid, server waits for client (php script) to send a command - php script receives result of command, and data then displays it appropriately - tcp connection/script ends The tcp communication seems to be the bottleneck. But even with lot of data to display (ex: a list of all the customers' email accounts) I can't see it increase very much. In a normal usage cycle I doubt it will get ran more then once a minute in average. __________________http://www.uovalor.com/ :: UO serverhttp://www.serverweave.com/ :: Server Control Panel - In Progress...

Posted by Red Squirrel, 11-14-2008, 10:42 PM
Hmm I was wrong, 1.7 secs when I display a table with 100 cells. Though if I run the back end compiled with -O3 optimized mode it brings it down to around .2. Guess once this is in production if it becomes an issue I could run the client strictly on a single server instead of on each server. __________________http://www.uovalor.com/ :: UO serverhttp://www.serverweave.com/ :: Server Control Panel - In Progress...

Posted by Tevion, 11-16-2008, 03:28 PM
Depends on what the script does, I also have a script that runs for 24h+, actually it should run an infinite time, but some errors get it down daily



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
secered perl plz (Views: 697)
E3Server ReSeller ? (Views: 704)
Problem KVM and SWAP (Views: 747)
Alabanza Host Listing (Views: 699)