Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Page Load Time Show Really High


im running PHP 5.2 on IIS 6 (Windows 2003 Server) and im getting a weird load time result when trying to display page load times on each page. e.g. Page generated in 1193387528.5501 seconds. this is my current code:
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<p>Page generated in '.$total_time.' seconds.</p>'."
"; ?>

but i've tried 4 others which are all simular. Any idea as to why it's showing a false result as it's loading in unde 1 second (Dual Xeon 2.8 HT server and connecting over 100mb pipe (college campus)).




View Complete Forum Thread with Replies

Related Forum Messages:
Need Help With PHP Causing High Load
I've redesigned my site. I went from a design that used SSI to include files for navigation and ads to PHP pages.

PHP is used in the pages for include files mostly. I also have a PHP image rotation script.

I'm on a dedicated server. Since I've switched over the load has gone off the charts-see the image.

How could PHP pages cause the load to do this??

Are there things I can tweak on the server?

You can see the PHP code here:

View Replies !
High Load Website
I have just been given a brief for a very large and hopefully very well used site.. The contractor is saying that hopefully it will have upward of 20,000 members with a large number of them browsing and chatting on the site at any one time. Within the database there will be everyones user / login info plus alot of other stuff, aswell as the full site being content managed.

whether my choice to use php and mysql to do this is a good one? and will it be able to handle it? If not are there any other options (I am not fully versed enough in .net and sql server to tackle the problem with this) that i could think about?

View Replies !
MySQL Causes High Cpu Usage And Load Average
I get high load average and high cpu usage from MySql and i thing its because of this query i recenty added (mostly the str replace) i already optimized it a bit ....

View Replies !
Set Time To Load A Page
I want to make a page which take time almost 60 seconds to load the contents....means a script in php which sleep for a 60 seconds and then execute the next part....

View Replies !
Page Load Time
I have a php/html page that is taking longer to load then i think it should is there a way to see what part of the page is hanging it up?

View Replies !
Load Time Of A Web Page
how to calculate the load time of a webpage using php?

View Replies !
Best Way To Structure A Continuous Running, High Load Process?
I have a web app that needs to continuously upload large amounts of data to a server. What to upload and when to upload it is stored in a database, but it needs to do this continuously, and needs to be pretty fault resistant.

I was thinking cron jobs, but it really needs to run all the time, not at regular intervals. Is there some way so I can make it so it runs constantly, processing it's queue? Also, could it use a new process to handle the queue items? So if there are three items in the queue, it will make three processes, but still keep processing?

View Replies !
Page Load Time + Iframe
There is any way to get the total load time of a page when you get an
"IFRAME" on it?
In all the tests, I got only the base page time without the "IFRAME"
time....

<?php
$bench = new phpCounter();
$bench->StartCouter();

$page = "<iframe class=......";
echo $page;

$bench->EndCounter();

echo $bench->GetCounter();
?>

Where:
// StartCounter() & EndCounter() call this function
function SetCounter ( ) // {{{
{

list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);

} // }}}

// Function to return the counter
function GetCounter ( ) // {{{
{

$output = ($this->end - $this->start);
return substr($output, 0, 5);

} // }}}

View Replies !
Bandwidth (time To Load A Page) And Protection
First I wanted to ask whether the size of the PHP code reflects on the time it takes to load a page? I suppose the only thing that matters is how fast the server will handle your request? I know PHP only returns html code to the client but, if the PHP file is (for an instance) 500KB it doesn't mean that it will load slow? The client only waits for the server to return html right? So... the time it takes to load a page is the time the server needs to handle your request and the time you download the hmtl from it?

I wanted to know this so that I could know whether it matters to make big scripts or try to optimize them.

Second question. It may sound dumb but, I wanted to hear this from professionals. Can someone see the content of you php file? (I'm pretty sure they don't buy I want to hear people say it  ). However if there is such a way, what should I do for protection against this.

View Replies !
Show The Current Time At The Resort On His Home Page.
I have a client who owns a resort in the Philippines. This client wants to show the current time at the resort on his home page. How would this be done with PHP? Is it some calculation based upon GMT? I think (I'll have to check) that the Philippines is +8 GMT...so is that what you'd have to do: create a snippet that grabs the current GMT and add "8" to it?

View Replies !
Write A Simple Script Which Will Show Different Content On A Page Depending On The Week And Time
I am trying to write a simple script which will show different content on a page depending on the week and time (it needs to change at 5pm on Friday over the weekend) and I came up with this: Code:

View Replies !
High Performance And High Avalaibility Platform On Linux/Php/Apache/mySql
i'm setting up a website with a forecast traffic of 70.000 sessions and
1.000.000 pageviews a day.
I'm in trouble about the short budget I have (about 10K $) and the big
traffic and so the best architecture I can set up.
Any Idea about I can do?


View Replies !
Show Time / Date To Reflect Eastern Standard Time
my web host is located on the west coast i live on the east coast so if my page shows the date:

$day = date(d);
$mth = date(m);
$yr = date(y);
echo $day . "-" . $mth . "-" . $yr;

i shows the date as of west coast time. so the time now is 1:40am april 6, 2007 my page will still show april 5, since west coast is 3 hours back. (10:40pm apr 5) how do i compensate for this time zone difference? i want my time / date to always reflect eastern standard time.

View Replies !
Load A Button 7 Seconds After Page Load?
I was wondering if there was a way to make an input button appear on a page after an X amount of seconds?

View Replies !
Show Time In Local Time
I tried searching for the answer, but didn't really get anything back. Maybe it's the terminology I was using.

Can anyone help me in a direction for how to change what time zone a time is displayed for? My timestamps default to California and would like to show them as EST.

Or even show the time in whatever time zone the person viewing the time is in. Does that sentence make sense?

View Replies !
Load Time
I have a fairly simple php Load Time script that makes use of microtime(), but I was wondering how to make it more acurate.  The load time is thousandths of a second, when the actual page isn't visible for 5 or 10 more seconds.  Are there any other php options for doing this? I was thinking perhaps buffers, but I don't even know if that would work.

View Replies !
Session Var Is Setting ONLY AFTER I Reload Page, Form Var Displays First Page Load
Page1 has a form that calls Page2. The beginning of Page2:
<? php session_start();
$s=$_POST['sSelected'];
session_register("s"); ?>

in the middle of Page2 I have a form varaible:
<?php echo $_POST['stateSelected']; ?>
<?php echo $_SESSION['s']; ?>

The form var displays the first time the page loads. The session var
displays only after reloading the page2.

View Replies !
Show Time
in my php file i want to show the time. (preferably time and date) how do i write it? i tryed something like this: "$time= NOW();"

View Replies !
Time Show
I got a database with a time saved it in like this

Date Time Title
2004-04-28(DATE) 14:30(TIME) Something(char(250))
this is how I saved the data in the database
put then I pull out the data it shows up like this
date Time Title
2004-04-28 14:30:00 SOmething

I need a way to auto remove the last :00 then I take out the dates it would be a dam lot of work to change everything I have done so far, about 4 weeks of work.

View Replies !
Avoiding Load Time?
I have a script that takes quite a long time to load since the PHP is processing quite a lot of info. Is there any way I can initiate the script, then have it move on to another page right away so I don't have to wait for the PHP to finish processing? (having ignore_user_abort(); on so it will continue to process in the "background" - if my thinking is correct...)

View Replies !
.PDF Files Take Time To Load
my .pdf filesize is about 1.76 MB, & it takes too much time to load.

i created a link for users to click & view the file, but it only loads on a _blank page.

View Replies !
Script Load Time
I have a report that takes a while to generate so the page times out. How can I change increase the time within php so it won't time out? Is it "max_execution_time"? I would really like to increase the time within the code for the report and then set it back to the default time. Is this possible?

View Replies !
User Load Time
any way to get the users load time for the page for it to finish loading?

View Replies !
Time Again To Show Plus (+) 6 Hours
I want this to show plus (+) 6 hours:

$ftanggal=date("d M Y - H:i", (date("U")));

How?

View Replies !
Show Time In Different Timezone
My webserver is hosted in England and I'm in the US.  So all the time is showing up a couple hours ahead of my timezone.  I can't edit the php.ini file or none of that so I was wondering how would I go about changing the php scripts on my pages to display the time and date as EST. 

At 11 PM my time Saturday may 19 it said it was "Sunday May 20, 4:00 am"  So I can't just do something that changes that hour, I need it to display the correct date aswell.

View Replies !
Load Time Displayed Question
I was looking at a couple of pages yesterday that were coded in PHP, and at the bottom was a "Page loaded in ______" blurb at the bottom. Good example is at www.digitaljedi.com. How could I go about creating a script that would initialize that function. Could it be as simple as doing something like this PHP Code:

View Replies !
Maximum Load Time Exeeded..
I know exactly the problem... Basically I changed my method from displaying tutorials per 1000 characters, to adding a function in my bbcode to manually make a "new page". Code:

View Replies !
Load Time Scripts Error
I want to add a load time display at the bottom of my page and I found many scripts that do just what I want. However, I can't seem to get them to work?

They display a result like:
1248763428.12 seconds

It probably has something to do with the layout of my pages:

include top (Where beginning of load time scrpt is)
the page itself
include bottom (Where end of load time script is)

So, i include the pages where the script is in...

ANy ideas?

View Replies !
How To Show Local Time To Viewers
The version of PHP on the server is 4.1

Now only time at server is displayed

I am searching everywhere but still stuck

is there some way to get the timezone form the client browser
without user interaction ?

View Replies !
Cookie - Page Load Or Page Refresh
this is supposed to show file1.txt, then file2.txt and so on on page load or page refresh. But it only shows the first 2 txt files. Can someone help me find out why?
I would think that as long as the cookie is still the same if (isset($_COOKIE['e'])) {
setcookie("e", $a++, time()+60*60*24*30);} that it would go to the next text file but its not. Please let me know, thank you very much.

<?php
$max_files = 12;
$a = 0;
if($a == 0) {setcookie("e", $a, time()+60*60*24*30);} /* expire 30 days*/
if (isset($_COOKIE['e'])) {
setcookie("e", $a++, time()+60*60*24*30);}
if ($a == $max_files)
$a;
$include_file = "file" . $a . ".txt";
include ($include_file);
?>

View Replies !
Javascript That Takes A Really Long Time To Load (several Seconds).
I have some javascript that takes a really long time to load (several seconds). Can i have a loading page for this? And if so, how?

View Replies !
If Value =1 Direct To Page Otherwise Show Data On Page
In the member account area there is a button saying (list) when the member clicks this they are redirected to add.php here i am wanting to check if a members account is limited, if it is direct them to a page saying you must pay your bill. if its not display the info on the page.

in the database there is a field called limited which is tiny in if its not limited the value of the field would be 0 if it is limited the value would be 1.

View Replies !
PEAR::Cache - Save Visitors Time And Balance The Load
Caching is a major process of speeding up your application. By caching
the output of a potentially large scale operation and displaying that
output later from that cache saves a lot of time. First if you have
cached output of a large scale operation, just check whether the cache
is out-of-date or not. If it succeeds all the parameters, display the
cache which saves that time consuming procedures. These large scale
operation may include fetching content from an remote source using
CURL or any stream wrapper, or a database operation, or even a time
consuming graph/chart generation.

There are several types of caching, like opcode caching, output
caching etc. Compiler level caching are out of scope in this article.
We are simply talking about the output caching. In this step
PEAR::Cache or PEAR::Cache_Lite may save really a great amount of
time. Lets take a look how.

In the following example we are using PEAR::Cache. You can also use
Cache_Lite which functions great by sacrificing a bit performance.

<?
include("Cache/Output.php");
$cache = new Cache_Output("file");
if (!$cache->start($cacheid, "samplegroup"))
{
//perform large scale operation
echo "Hello";
$cache->end();
}
else
{
echo "Printing from Cache";
}
//display the cached content
echo $cache->get($cacheid);
?>

First time, the output is generated as usually. But from next time the
output is displayed from cached bypassing the large scale operation.

You can flush content of any cached group by accessing it's flush()
method which looks like below

$cache->flush( "samplegroup");

View Replies !
Delimiting Timestamp Queries To Show Only Date, No Time
I can't find anything on google or even searching the forums that comes remotely close to being understandable by me. I have a MySQL timestamp(current timestamp) I'm using to date every entry. HOWEVER, I can't figure out how to get rid of the time portion and only display the date.

View Replies !
How To Show The Estimated Time Left For A File Download
I want users to be able to download a file. Its all working. When the user clicks the link the windows "File download" box pops up asking if the user wants to save/open etc.

Press save and the file will save. However, the estimated time left says "Not known 1.4Mb downloaded" etc. How do I get it to show the estimated time left - i guess its something to do with fetching the actual file size from the server? Code:

View Replies !
Using PHP To Load Another Page Or Html Page
Ive got a PHP script, which if it ends correctly, i want load another
PHP file or an HTML page automatically, ie without user intervention.
The new page shoud replace the current page on the browser. Is there a
PHP command or function which does this?

View Replies !
If Page = 'about' Show The About.html Page?
I wanted to do some kind of PHP script so that if the current page the viewer is trying to view is called index.php?page=about then it will use the php script to embed with an i-frame the about.html file into a cell in my web page's table. Basically, so that the whole page stays the same other than one cell of the table which is dynamic depending on the status of the index.php?page=whatever. Code:

View Replies !
Page Load For IP
Is there any way only a certian IP address on our network can see a
particular Table on the page? or if a certian ip Adress goes to our intranet page load a certain page depending on that IP address.

View Replies !
How To Load CSV Onto PHP Page
is there a way to load CSV file into a PHP page? if ever, how and what is the code?

View Replies !
XML Page Cannot Load
I have very special case, i tried fopen, fsockopen, in php, then wget , get, on linux, but never had success, i want to download content of external xml file, it's not just stored xml file, it's php file that outputs xml page , i need to tell that php script 2 arguments, thats it. i can't see why i everytime i try to grab it, get binary data, i can see it in my IE ok, but when try any php script it gets as binary code. can anyone tell me what i'm doing wrong?

View Replies !
On Page Load
I am fairly new to PHP and have the following problem: I need some help with the coding for PHP includes. I am trying to get a simple include: <?php require("nav.php") ?> to load after the page itself has been completely loaded. Do I have to use the sleep() function for that? If yes, how exactly would my coding have to look in order to work. The reason I would want to have a delay in a PHP include, is because I would like to have the basic page load first, so the visitor can start reading, etc. and then have some larger files load while the visitor is reading. I assuming, this would decrease page load time by having larger items load while the basic page has already been loaded.

View Replies !
Page Has To Load From This Url
I have a page that is supposed to be secure, but I need a way to make it so if the page is accessed without https, it will reload with https.

<?
if(substr($_SERVER['SCRIPT_URI'],0,5)!="https")
header("Location: https://url");
?>

someone gave me this code to try but when I do so, the page just tries to load indefinitely.

View Replies !
Incrementing On Page Load
I have one form that I want to send email. Instead of using multiple pages, I have condensed it to one. However, I don't know how to increment a value, say "display", each time the submit button is clicked.

For instance - I have $display = "1". I want 1 to increment to 2, 3, and so on once the user clicks submit once, twice, etc. But I only want the "validation fields" to show after the user has clicked submit.

View Replies !
Page Load Frequency
I need a function to prevent a page from being loaded too often too
fast.
So say, one is only allowed to refresh a single page 5 times in 10
seconds, or 10 times in 5 seconds (or whatever ... ).
If the load frequency exceeds that, the site calls exit(); And a
message is displayed. Just like Expression Engine does ...

This way i want to protect the DB from being queried rediculously
often, and maybe even protect it from DDOS attacks.

I hope it's clear. I don't know where to start ..

View Replies !
Redirect If Page Does Not Load
I have a form that will not submit if certain data cannot be found in Mysql or it will take very long to submit. Is there a way i can have the form go to an error page if it does not submit or load results in 5 seconds.

If it does take long i need the following:
$msg[] = $error10;
header("Location: quote_error.php?");

View Replies !
Never Ending Page Load
When I run this script, it tries to load but after aout 10 minutes the whole browser locks up because it can't do it. I have a hunch it is because the while loop doesn't ever stop, but I don't know how to prevent it. Code:

View Replies !
FORCE Page To Load
On my main server, I have an html page (begins with <html> and ends with </html>. After the last </html> part, I have a short bit of PHP code which connects to a mysql database on another server. Yesterday, that other server was, "down," for a while (i.e. mysql wouldn't work). During the downtime, my main page wouldn't load! Visitors would see a blank page. because my php code at the bottom was trying to connect to the down site.

I have tried everything I could think of. I even tried "Set_time_out()" ... but that won't work because my shared server's host has safe mode on. My php mysql code starts with:

$link = mysql_connect etc.
if (!$link) { die(); }

...but that doesn't work either.

how do I "force" my html page to appear to my visitors regardless of whether php is having any luck w/ the mysql connection?

View Replies !
Php Page Wont Load
I uploaded it to a server and what the goal for this basic class is to have the form submit to the php page. once i click submit on the form page (<form name="form0" method="post" action="formpost.php"> ) Code:

View Replies !
Load A Php-page With Javascript
how can i load a .php page with javascript.

(I need this to be able to include a .php file in a .htm page.
So the javascript should include the .php file) !

View Replies !
Load Custom Page
I have two pages named index.htm and page.htm. Page.htm has an iframe. I want to open page.htm from index.htm with a specific page in the iframe for each link. How can I do that?

View Replies !
Load Page Then Read
Is there a way to completely load the page of its HTML elements then read all those elements into a string? For example, I have a PHP page that get its HTML content from the database. I want that page to completely loads, ie., get the content from the database, then write all of that page's text and html elements into a string so I can modify it (ie. remove all the links) to display it in another page.

View Replies !
Load / Save Page
Im looking for some information if its possible, maybe a link or two. Im wanting to show the user a page that lets them know that their data is saving or their data is loading, while php runs its functions. Then when the information is processed then redirect them. As it works now it just takes a few seconds where is looks like the page is frozen then redirects as it should. Im not even sure that this would be done in php, but i figured yall could shove me in the right direction.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved