PugJr Posted February 11, 2010 Share Posted February 11, 2010 This is my method of checking how long it takes to load a page: $starttime = microtime(); $startarray = explode(" ", $starttime); $starttime = $startarray[1] + $startarray[0]; $variable = "(30 KB file here)"; echo $variable; $endtime = microtime(); $endarray = explode(" ", $endtime); $endtime = $endarray[1] + $endarray[0]; $totaltime = $endtime - $starttime; $totaltime = round($totaltime,5); echo "$totaltime"; Gets around to .2 seconds. That of course is not useful timing. I assume this is a problem with Apache as I can declare the text as a variable without any lag but once I echo it, thats when it lags. If I'm wrong, please do move this topic. Now if I was to reduce the size to 20KB it drops to .18 seconds and if I bring it to 10KB it drops to 0.00022 seconds. Clearly there is something wrong once I get to a higher display size as 0.00022 is perfectly acceptable but .18 seconds is awful just to display. Also, I looked up problems with apache and swapping/lack of memory is a problem so for your information: total used free shared buffers cached Mem: 1544152 1083376 460776 0 117748 620516 -/+ buffers/cache: 345112 1199040 Swap: 6152176 0 6152176 Nothing is swapped in this RAM usage and surely 460 MB of free RAM is enough to display 30 KB of text. So hopefully one of you guys know what could be the problem. Thanks. EDIT: Using Ubuntu 9.10 Server edition 32 bit. Quote Link to comment https://forums.phpfreaks.com/topic/191727-apache-slow-when-i-display-too-much-text/ 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.