Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2008
    Posts
    19
    Plugin Contributions
    0

    Default Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    I installed Zen Cart for the first time last week and everything worked fine, but it was very slow, even with no products in it. I have been working with someone else to try to figure out if it's my Zen Cart installation or if it's my server, and we're still not sure. What I need is to figure out if it's a problem with my Apache, PHP, MySQL, Zen Cart.

    I wrote the code below to perform 64million iterations of nothing (it takes about 9 seconds to finish). If I compare my times to others who have similar servers and mine are close, then I know that PHP and Apache are not the issue, which means that it's probably my MySQL or Zen Cart. Or if my times are much longer than others' times, then I know the problem is either PHP or Apache and it has nothing to do with Zen Cart or MySQL.

    So if anyone is reading this and has an extra 60 seconds to spare, could you please save a .PHP file on your server with the following code in it and run it a few times and post some of your times, or at least the High, Low and Average after of a few runs. And don't for get to add your server's specs like Apache Version, PHP Version, Server CPU & RAM and anything else you think is relevant!

    Code:
    <html>
    <body>
    <?
      $Multiplier = 400;
      $time_start = microtime(true);
      for ($i=0; $i<$Multiplier; $i++) {
        for ($j=0; $j<$Multiplier; $j++) {
          for ($k=0; $k<$Multiplier; $k++) {
          }
        }
      }
      $time_end = microtime(true);
      $time = $time_end - $time_start;
      echo 'Test took ' . $time . ' seconds';
    ?>
    </body>
    </html>
    A HUGE thank you to anyone who takes the time to do this for me. It only takes a minute or two of your time and it helps me out GREATLY!

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    Simpler if you go to the Zen Cart Admin > config > logging > Display The Page Parse Time > set to true and see what times the mysql queries take and the combined time to parse a page are....should be on the order of

    Parse Time: 0.316 - Number of Queries: 740 - Query Time: 0.107440592072

    From a demo install with the demo products installed
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2008
    Posts
    19
    Plugin Contributions
    0

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    Quote Originally Posted by kobra View Post
    Simpler if you go to the Zen Cart Admin > config > logging > Display The Page Parse Time > set to true and see what times the mysql queries take and the combined time to parse a page are

    Kobra, thanks for the advice, but I'm well beyond that. With a bare install and only 1 product listed on my store I'm getting times like these
    Parse Time: 2.150 - Number of Queries: 112 - Query Time: 0.10440410185242

    You can see how slow it is here
    http://www.mypcwerks.com/store2/

    The problem is that I don't know if my issue is with Apache, PHP, MySQL or Zen Cart. I run my own server on a Windows XP Pro box. The whole reason why I posted this thread is because if I can get some people to run this script for me on their own servers, and tell me what versions of Apache & PHP they're using, and their Server Specs, I'll narrow down where the problem is.

    If my time running this script is close to others here who have really low Parse/Query times in Zen Cart, then I know that the problem is not my Apache or PHP setup, so I probably have a problem with my MySQL Server or my Zen Cart. But if my times are way off from other users here, then I know there's a problem with my Apache or my PHP setup, right?

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    Your script is basically a CPU speed test as it is only iterative and not real world.

    I only work in the 'nix world and can not advise on IIS with AMP
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    This really isn't a Zen Cart problem - your server set up is borked somehow - Have you tried a hosting/webmaster forum?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  6. #6
    Join Date
    Jan 2008
    Posts
    19
    Plugin Contributions
    0

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    Quote Originally Posted by kobra View Post
    I only work in the 'nix world and can not advise on IIS with AMP
    I'm using windows but I am not using IIS, I am using Apache


    Quote Originally Posted by Kim View Post
    This really isn't a Zen Cart problem - your server set up is borked somehow - Have you tried a hosting/webmaster forum?
    That's why I am asking people to run this script. If my speeds are the same as everyone else's, then the problem has to be MySQL or my Zen Cart installation. But if my speeds are NOT the same as others here, then the problem would be with my apache or my php setup, right?

    I'm just trying to get a little help from anyone here, more of just pointing me in the right direction. My Server is a 3.2Ghz with 2GB of RAM. Nothing else on the server gets the CPU usage to 100%, but every page load with Zen Cart does. My osCommerce sites never put the CPU usage that high, and neither do the dozens of other sites that I'm hosting. I'm trying to figure out why zen cart does. It's either Apache, PHP, MySQL or Zen Cart, right? The whole point of my posting this thread was to get a little help from other zen cart users. The results of others running this same test would at least point me in one direction or the other. If the problem turns out to be PHP or Apache, I don't want to spend hours or days trying to diagnose problems with MySQL or Zen Cart. Or vice versa!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    A couple tests on busy servers:

    Linux host:
    Apache/1.3.39 (Unix)
    PHP 5.2.4
    4x Xeon 2.8GHz
    2 GB RAM
    PHP Mem Limit: 64M Server Load Averages 2.97 2.74 2.18
    Test took 9.41580104828 seconds
    Test took 10.0421600342 seconds
    Test took 10.0688459873 seconds
    Test took 10.8970160484 seconds
    Test took 10.1099340916 seconds
    Test took 9.34473609924 seconds



    ------------------
    Windows XP:
    3 GHz CPU, 2 GB RAM
    Apache 2.2.6, PHP 5.2.4
    PHP Mem Limit: 32M
    Test took 9.95220589638 seconds
    Test took 8.46086001396 seconds
    Test took 9.08085203171 seconds
    Test took 8.83003401756 seconds
    Test took 9.12042379379 seconds
    Test took 9.04777884483 seconds
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jan 2008
    Posts
    19
    Plugin Contributions
    0

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    Quote Originally Posted by DrByte View Post
    Windows XP:
    3 GHz CPU, 2 GB RAM
    Apache 2.2.6, PHP 5.2.4
    PHP Mem Limit: 32M
    Test took 9.95220589638 seconds
    Test took 8.46086001396 seconds
    Test took 9.08085203171 seconds
    Test took 8.83003401756 seconds
    Test took 9.12042379379 seconds
    Test took 9.04777884483 seconds
    DrByte, thank you very much for taking the time to test it for me. Here are my stats
    Windows XP Pro, 3.2Ghz CPU, 2GB RAM, Apache 2.2.4, PHP 5.2.5, PHP Memory Limit: 128M
    9.3784730434418
    9.0101289749146
    9.0374789237976
    9.0045189857483
    9.0511751174927
    My machine is almost identical to yours, and my times on that test seem to be pretty close as well. This means that the problem is not my Apache or PHP setup, right? That leaves the MySQL server or Zen Cart, right? And if everyone else's Zen Cart is working fine, that means that it's probably the MySQL server, right?

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    Quote Originally Posted by pcwerks View Post
    That leaves the MySQL server or Zen Cart, right? And if everyone else's Zen Cart is working fine, that means that it's probably the MySQL server, right?
    Theoretically, yes.
    I posted some thoughts to your other thread.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jan 2008
    Posts
    19
    Plugin Contributions
    0

    Default Re: Please Run This Tiny Script to Help Me Diagnose My Speed Problem!

    Quote Originally Posted by DrByte View Post
    Theoretically, yes.
    Ok, here's a little test to verify that (I think).


    First I created a new table named "test" in my database, it only has 1 field, a varchar(32). Then I inserted one value with the value of "Test". You can duplicate it with these two SQL statements...

    Code:
    CREATE TABLE IF NOT EXISTS `test` (`Test` varchar(32) NOT NULL, PRIMARY KEY (`Test`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    INSERT INTO `test` (`Test`) VALUES ('Test');
    Then I ran this script a few times.

    Code:
    <html>
    <body>
    <?
    
    // Set these variables
    $server = 'localhost';
    $username = 'username';
    $password = 'password';
    $database = 'database';
    
    echo "Starting Benchmark<br>\n";
    mysql_connect($server, $username, $password);
    mysql_select_db($database);
    $time_start = microtime(true);
    for ($i=0; $i<30000; $i++) {
      $SQL = mysql_query('SELECT * FROM test');
    }
    $time_end = microtime(true);
    echo "<br>\nIt took " . ($time_end - $time_start) . " seconds.";
    ?>
    </body>
    </html>
    My times were...
    7.9812059402466
    7.815819978714
    7.6032540798187
    7.7292428016663
    7.6379249095917

    If you (or Anyone else!) get a chance, could you add this tiny table to any of your databases and then run this script a few times to compare to my times. The only thing you need to change in the script is the 3 variables for the database connection.

    If you run this script and your times are way less than mine, then I have a MySQL performance issue, which I should be able to fix by fine-tuning my settings, right? And if your numbers are really close to mine, then maybe it's not my MySQL Server? So what else would be left that could be the problem?

    Or is this just not a good way of testing my MySQL Server speed against someone else's? Is there a better way, like using a table that's huge? Or doing UPDATEs or INSERTs instead of SELECTs?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Some help implementing this tradetracker script please
    By Dramacydril in forum General Questions
    Replies: 0
    Last Post: 4 Jan 2013, 11:20 PM
  2. How to run a script upon purchase?
    By djex in forum General Questions
    Replies: 2
    Last Post: 6 Feb 2009, 05:26 PM
  3. Script help please!!!!
    By dscott1966 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Oct 2008, 11:08 PM
  4. Please Help me with this redirection php script
    By nguyenkhv in forum General Questions
    Replies: 0
    Last Post: 29 Feb 2008, 08:40 AM
  5. Please help please!Premature end of script headers: index.php (null)
    By fangzhouws in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 11 Aug 2006, 06:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR