Azu Posted September 2, 2007 Share Posted September 2, 2007 Hello I can benchmark the time between the startup and the shutdown, but how can I benchmark the time of the actual startup and shutdown themselves? Quote Link to comment Share on other sites More sharing options...
Wuhtzu Posted September 2, 2007 Share Posted September 2, 2007 Startup and shutdown (of what) ? Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 PHP Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 3, 2007 Share Posted September 3, 2007 get your stopwatch out.... Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 LOL, not really. the same way you would time a page loading, call a php script from php. <?PHP (start timer here) require(samp.php); (end timer here) ?> <?PHP ?> Now if your server doenst ignore the file altogether, this should give you the time it takes to parse and load an entire php file. (engine times). just devide by two and u have shutodnw and startup I guess... otherwise you can't. lol, rememerb to use a 14 digit floating point number, or you might get 0 as the time. Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 Thanks, but by the time it sees the include it has already started up, and it won't shutdown until after the include and after the timers.. Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 yes but it registers another engine (php.exe) or (php-cgi.exe) per request or page load. as far as my system works it seems to start a process PER include and require, os thats how I time mine.. I get outputs like this: 0.00000000000119 0.00000000000110 0.00000000000197 0.00000000000211 0.00000000000128 0.00000000000087 and so on. Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 Hmm.. so this will be accurate for measuring the differance in startup/shutdown times between differant extensions being used for? Because that is what I'm trying to use this for. Like to see if mysqli adds less to startup/shutdown time, or if mysql does, for example. Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 it should, hwy dont you try it out and tell me the output? remember to use micro time with a 14 digit floating point number Quote Link to comment Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 PHP and all its extensions are loaded when the server starts, not when your script comes across calls to a particular extension. Unless you are using dl to load extensions manually at runtime. Measuring execution times this way may help indicate which extensions process certain operations quicker, but its no indication of the extension startup/shutdown times. Quote Link to comment Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 Oh man. I'm having a shoker today. It would appear my description above only relates to the cgi and cli SAPI's. I'll just be quiet. Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 lol but if your php is a module, its modules load independantly per process (itsnot smart but hey, php did it, not me) Quote Link to comment Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 What exactly do you meen by module? There are no modules in php. Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 PHP and all its extensions are loaded when the server starts, not when your script comes across calls to a particular extension. Unless you are using dl to load extensions manually at runtime. Measuring execution times this way may help indicate which extensions process certain operations quicker, but its no indication of the extension startup/shutdown times. Thanks! I think maybe something is different in my PHP installation though. If, say, I move one of the extension DLLs away, then on PHP startup, PHP gives an error and crashes. If I start up my server without the DLL there, it starts fine. I put it back before opening a PHP page, and it works fine. So I'm pretty sure that the extensions are loaded by PHP on every page load for me for some reason.. Quote Link to comment Share on other sites More sharing options...
trq Posted September 3, 2007 Share Posted September 3, 2007 Sorry, read my last reply. You can get more detail about the startup process here. Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 Oh okay thanks. Well if anyone knows of like a third party program or something that can benchmark how long it takes for PHP to startup I'd really appreciate that ^^ I think maybe PHP can benchmark itself on this since it can't do anything until it has started up.. and can't measure itself as it is shutting down.. Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 3, 2007 Share Posted September 3, 2007 I eman if php is copiled as a module to the web server. as verse to the alternatice, cgi. Quote Link to comment Share on other sites More sharing options...
Azu Posted September 3, 2007 Author Share Posted September 3, 2007 I'm running PHP as CGI. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.