Jump to content


Photo

Long Parse times by PHP


  • Please log in to reply
2 replies to this topic

#1 phporcaffeine

phporcaffeine
  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 30 April 2006 - 03:25 AM

I know this is like shooting a fish in the Pacific Ocean from 100 yards away but ....

I have several scripts, and they don't do anything intense ( no arrays, no queries ... etc)

All they do is take some given information and perform some mathmatical calculations.

Now when you execute through a browser, sometimes PHP finishes in miliseconds, other times it takes almost 40-50 seconds (on any given execution it is processing the same data, the same way). There isn't any indentifiable pattern to when it executes quick or slow.

These scripts run on a Win XP box with Apache 2.0.55, PHP 5.1.2, MySQL 5.0.19

The Server has 2GB of Ram with a P4 3.8Ghz Processor

There is no user load - this is a dev. box.

In PHP.ini the garbage collection for session data is set as 1/100

I'm just looking for someone who can tell me some areas that I should "look at" to help explain this oddity.

I want to know whats happening before I goto a production box, and I see this as a BIG deal because when you multiply this oddity X 200+ users .... etc


TIA
Thanks,

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com

#2 Hooker

Hooker
  • Members
  • PipPipPip
  • Advanced Member
  • 193 posts
  • LocationWales, UK

Posted 30 April 2006 - 05:01 AM

hrm maybe you can show us the code so we can take a quick look through it?

#3 phporcaffeine

phporcaffeine
  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 30 April 2006 - 10:13 AM

[!--quoteo(post=370039:date=Apr 30 2006, 01:01 AM:name=Hooker)--][div class=\'quotetop\']QUOTE(Hooker @ Apr 30 2006, 01:01 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
hrm maybe you can show us the code so we can take a quick look through it?
[/quote]

Here is the script in question:
<?php

//GET STAMP

$savedstamp = trim($_POST['stamp']);

$seconds = $savedstamp%60;

$i = floor($savedstamp / 60);

?>

I honestly think this has something to do with php.in and/or httpd.conf. I probably have something set I shouldn't have or vicea versa.
Thanks,

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users