Re: [PHP] Scripts are fast locally, but slow on remote server

2008-01-16 Thread Richard Lynch
Are you relying on autoload or anything of that nature to load in
class files, perhaps?

On Wed, January 16, 2008 1:02 am, Dave M G wrote:
 PHP list,

 I have a set of PHP scripts that seem to be efficient and quick enough
 both on my home testing environment, and a few different web-hosting
 services I use.

 However, on one particular web-hosting service, there is often a very
 painful 10 second (!) lag when first loading up the scripts. This long
 lag time can sometimes be manifest not just on the first page loaded,
 but the second and maybe third as well.

 But then after the first initial pages are loaded, the site seems to
 speed up to what I would consider normal download pages for times.

 There are some pages on the site that are not driven by these PHP
 scripts, and they load up very quickly, indicating that only my PHP
 scripts are affected.

 So the problem seems to be, as far as I can tell, that something about
 my PHP scripts is combining with some setting of this one web-hosting
 server to create some kind of slowdown.

 Is there any way I can diagnose a situation like this to get to the
 root
 of the problem? Perhaps there are common discrepancies between server
 settings that I can look out for?

 Any advice would be much appreciated.

 Thank you.

 --
 Dave M G
 Articlass - open source CMS
 http://articlass.org

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Scripts are fast locally, but slow on remote server

2008-01-16 Thread Richard Lynch


On Wed, January 16, 2008 1:29 am, Dave M G wrote:
 Per Jessen,

 Thank you for responding.

 Might this be a name-server issue?

 Maybe, but I don't think so. The reason I suspect that is not the case
 is because I can go first to a .html page on the server, and it loads
 up
 quickly. Then I go to one of my .php pages, and the slowdown occurs.

 If it were a name server issue, I would expect the slowdown to happen
 regardless of which page I load first.

 So, I guess to be more specific, the slowdown happens the first time I
 load one of my PHP scripts on this site, not the first time I access
 the
 site.

Try it with just this in a .php file:
?php phpinfo();?

Is *that* slow the first time?

Also try it with:
?php echo Hello World!?
Is that slow the first time?

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Scripts are fast locally, but slow on remote server

2008-01-16 Thread Jochem Maas

Richard Lynch schreef:

Are you relying on autoload or anything of that nature to load in
class files, perhaps?


garanteed that it's not an autoload related problem.
and Im willing to bet it's a dns related issue - I remember similar
problems reported on the list and it always came down to dns.



On Wed, January 16, 2008 1:02 am, Dave M G wrote:

PHP list,

I have a set of PHP scripts that seem to be efficient and quick enough
both on my home testing environment, and a few different web-hosting
services I use.

However, on one particular web-hosting service, there is often a very
painful 10 second (!) lag when first loading up the scripts. This long
lag time can sometimes be manifest not just on the first page loaded,
but the second and maybe third as well.

But then after the first initial pages are loaded, the site seems to
speed up to what I would consider normal download pages for times.

There are some pages on the site that are not driven by these PHP
scripts, and they load up very quickly, indicating that only my PHP
scripts are affected.

So the problem seems to be, as far as I can tell, that something about
my PHP scripts is combining with some setting of this one web-hosting
server to create some kind of slowdown.

Is there any way I can diagnose a situation like this to get to the
root
of the problem? Perhaps there are common discrepancies between server
settings that I can look out for?

Any advice would be much appreciated.

Thank you.

--
Dave M G
Articlass - open source CMS
http://articlass.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Scripts are fast locally, but slow on remote server

2008-01-16 Thread Bastien Koert

memory limitation in the php ini?
 
bastien
 Date: Wed, 16 Jan 2008 16:29:53 +0900 From: [EMAIL PROTECTED] To: [EMAIL 
 PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] Scripts are 
 fast locally, but slow on remote server  Per Jessen,  Thank you for 
 responding.   Might this be a name-server issue?   Maybe, but I don't 
 think so. The reason I suspect that is not the case  is because I can go 
 first to a .html page on the server, and it loads up  quickly. Then I go to 
 one of my .php pages, and the slowdown occurs.  If it were a name server 
 issue, I would expect the slowdown to happen  regardless of which page I 
 load first.  So, I guess to be more specific, the slowdown happens the 
 first time I  load one of my PHP scripts on this site, not the first time I 
 access the  site.  --  Dave M G  --  PHP General Mailing List 
 (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php 
_



Re: [PHP] Scripts are fast locally, but slow on remote server

2008-01-15 Thread Per Jessen
Dave M G wrote:

 PHP list,
 
 I have a set of PHP scripts that seem to be efficient and quick enough
 both on my home testing environment, and a few different web-hosting
 services I use.
 
 However, on one particular web-hosting service, there is often a very
 painful 10 second (!) lag when first loading up the scripts. This long
 lag time can sometimes be manifest not just on the first page loaded,
 but the second and maybe third as well.
 
 But then after the first initial pages are loaded, the site seems to
 speed up to what I would consider normal download pages for times.

Might this be a name-server issue?  For whatever reason the first
invocation waits for a time-out, which could take a while, but the
second gets an near-immediate response as the negative answer is now
cached. 


/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Scripts are fast locally, but slow on remote server

2008-01-15 Thread Dave M G

Per Jessen,

Thank you for responding.

Might this be a name-server issue? 


Maybe, but I don't think so. The reason I suspect that is not the case 
is because I can go first to a .html page on the server, and it loads up 
quickly. Then I go to one of my .php pages, and the slowdown occurs.


If it were a name server issue, I would expect the slowdown to happen 
regardless of which page I load first.


So, I guess to be more specific, the slowdown happens the first time I 
load one of my PHP scripts on this site, not the first time I access the 
site.


--
Dave M G

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Scripts are fast locally, but slow on remote server

2008-01-15 Thread Chris

Dave M G wrote:

Per Jessen,

Thank you for responding.

Might this be a name-server issue? 


Maybe, but I don't think so. The reason I suspect that is not the case 
is because I can go first to a .html page on the server, and it loads up 
quickly. Then I go to one of my .php pages, and the slowdown occurs.


If it were a name server issue, I would expect the slowdown to happen 
regardless of which page I load first.


So, I guess to be more specific, the slowdown happens the first time I 
load one of my PHP scripts on this site, not the first time I access the 
site.


And what does the script do? Connect to a database? Ping a server? X? :)

If it's connect to a database, does it use the 'name' of the server or 
the ip address or is it localhost?


Does it do lots of queries?



--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Scripts are fast locally, but slow on remote server

2008-01-15 Thread Per Jessen
Dave M G wrote:

 Per Jessen,
 
 Thank you for responding.
 
 Might this be a name-server issue?
 
 Maybe, but I don't think so. The reason I suspect that is not the case
 is because I can go first to a .html page on the server, and it loads
 up quickly. Then I go to one of my .php pages, and the slowdown
 occurs.

And your script does not cause any dns lookups? 

 If it were a name server issue, I would expect the slowdown to happen
 regardless of which page I load first.

Not necessarily - it would depend on what is being looked up. 

 So, I guess to be more specific, the slowdown happens the first time I
 load one of my PHP scripts on this site, not the first time I access
 the site.

Have a look at which external services you use - database, nameserver,
ldap etc.  I'm assuming an initial loop is out of the question?  Also,
check memory status - if the server is very heavily loaded, and your
stuff isn't in memory, it could take time to page it in.  10 seconds is
a long time, but ...



/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php