Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2008
    Location
    Victoria AU
    Posts
    48
    Plugin Contributions
    0

    Default Who's Online Performance Issue

    I believe our site was updated a week or so ago by the provider and I've since noticed a major slowdown on the "Who's Online" page. It now takes almost a minute for that to refresh. These are the details from the Server Info.

    Server OS: Linux 2.6.9-023stab033.6-enterprise
    Database: MySQL 5.0.67-community
    Server Date: 03/07/2009 22:11:30
    Database Date: 03/07/2009 22:11:30
    Server Up Time: 22:11:30 up 60 days, 21:03, 0 users, load average: 0.92, 0.95, 1.10 HTTP
    Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_jk/1.2.25
    PHP Version: 5.2.6 (Zend: 2.2.0)
    PHP Memory Limit: 32M PHP Safe Mode: Off
    PHP File Uploads: On
    Max Size: 32M POST Max Size: 8M
    Database Data Size: 1,978 kB
    Database Index Size: 722 kB

    Any ideas?

  2. #2
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Who's Online Performance Issue

    I would monitor the site for another week or so - just to make sure the download status of the site remains unchanged, and then ask some serious questions to my hosting company.

    If there is no plausible explanation then you may want to consider changing to another host.

    Frank

    www.zencart.frnt.org

  3. #3
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Who's Online Performance Issue

    The delay is likely due to ip-to-hostname lookup delays caused by poorly-configured server nameserver settings ... which only your hosting company can fix.
    .

    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.

  4. #4
    Join Date
    Mar 2008
    Location
    Victoria AU
    Posts
    48
    Plugin Contributions
    0

    Default Re: Who's Online Performance Issue

    We are still suffering from this issue. The reverse lookups appear OK because I've noticed more recently that if I hit the "Stop" button in IE immediately after entering the who's online page all the details are there. So the issue seems to be something to do with displaying the cart information.

    Is there a way to stop zc from displaying the cart info so I can isolate this issue?

  5. #5
    Join Date
    Mar 2008
    Location
    Victoria AU
    Posts
    48
    Plugin Contributions
    0

    Default Re: Who's Online Performance Issue

    I've isolated the problem area to the following code, can anyone give me pointers as to why the response from this section appears to be causing a timeout?

    PHP Code:
    <?php
      $heading 
    = array();
      
    $contents = array();
      if (
    $info) {
        
    $heading[] = array('text' => '<b>' TABLE_HEADING_SHOPPING_CART '</b>');

        if (
    STORE_SESSIONS == 'db') {
          
    $session_data $db->Execute("select value from " TABLE_SESSIONS "
                                        WHERE sesskey = '" 
    $info "'");

          
    $session_data trim($session_data->fields['value']);
        } else {
          if ( (
    file_exists(zen_session_save_path() . '/sess_' $info)) && (filesize(zen_session_save_path() . '/sess_' $info) > 0) ) {
            
    $session_data file(zen_session_save_path() . '/sess_' $info);
            
    $session_data trim(implode(''$session_data));
          }
        }

        if (
    $length strlen($session_data)) {
          if (
    PHP_VERSION 4) {
            
    $start_id strpos($session_data'customer_id[==]s');
            
    $start_cart strpos($session_data'cart[==]o');
            
    $start_currency strpos($session_data'currency[==]s');
            
    $start_country strpos($session_data'customer_country_id[==]s');
            
    $start_zone strpos($session_data'customer_zone_id[==]s');
          } else {
            
    $start_id strpos($session_data'customer_id|s');
            
    $start_cart strpos($session_data'cart|O');
            
    $start_currency strpos($session_data'currency|s');
            
    $start_country strpos($session_data'customer_country_id|s');
            
    $start_zone strpos($session_data'customer_zone_id|s');
          }

          for (
    $i=$start_cart$i<$length$i++) {
            if (
    $session_data[$i] == '{') {
              if (isset(
    $tag)) {
                
    $tag++;
              } else {
                
    $tag 1;
              }
            } elseif (
    $session_data[$i] == '}') {
              
    $tag--;
            } elseif ( (isset(
    $tag)) && ($tag 1) ) {
              break;
            }
          }

          
    $session_data_id substr($session_data$start_id, (strpos($session_data';'$start_id) - $start_id 1));
    // fix nnobo bug
          
    $session_data_cart substr($session_data$start_cart$i $start_cart);
          
    $session_data_currency substr($session_data$start_currency, (strpos($session_data';'$start_currency) - $start_currency 1));
          
    $session_data_country substr($session_data$start_country, (strpos($session_data';'$start_country) - $start_country 1));
          
    $session_data_zone substr($session_data$start_zone, (strpos($session_data';'$start_zone) - $start_zone 1));

          
    session_decode($session_data_id);
          
    session_decode($session_data_currency);
          
    session_decode($session_data_country);
          
    session_decode($session_data_zone);
          
    session_decode($session_data_cart);

          if (
    PHP_VERSION 4) {
            
    $broken_cart $cart;
            
    $cart = new shoppingCart;
            
    $cart->unserialize($broken_cart);
          }

          if (
    is_object($_SESSION['cart'])) {
            
    $contents[] = array('text' => $full_name ' - ' $ip_address '<br />' $info);
            
    $products $_SESSION['cart']->get_products();
            for (
    $i 0$n sizeof($products); $i $n$i++) {
              
    $contents[] = array('text' => $products[$i]['quantity'] . ' x ' '<a href="' zen_href_link(FILENAME_CATEGORIES'cPath=' zen_get_product_path($products[$i]['id']) . '&pID=' $products[$i]['id']) . '">' $products[$i]['name'] . '</a>');
    // cPath=23&pID=74
            
    }

            if (
    sizeof($products) > 0) {
              
    $contents[] = array('text' => zen_draw_separator('pixel_black.gif''100%''1'));
              
    $contents[] = array('align' => 'right''text'  => TEXT_SHOPPING_CART_SUBTOTAL ' ' $currencies->format($_SESSION['cart']->show_total(), true$_SESSION['currency']));
            } else {
              
    $contents[] = array('text' => TEXT_EMPTY_CART);
            }
          }
        }
      }

      if ( (
    zen_not_null($heading)) && (zen_not_null($contents)) ) {
        echo 
    '            <td width="25%" valign="top">' "\n";

        
    $box = new box;
        echo 
    $box->infoBox($heading$contents);

        echo 
    '            </td>' "\n";
      }
    ?>
    If I remove this section of code the who's online responds instantly with a list of users and their cart status. But I would like to be able to see what is in their carts as it provides useful info.
    Last edited by kanine; 26 Apr 2009 at 02:16 AM. Reason: More info...

  6. #6
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: Who's Online Performance Issue

    This should likely be increased, we find 90 to be a better match

    PHP Memory Limit: 32M PHP Safe Mode: Off
    Also, we have tweaked the SQL quite a bit on our servers. This tool is a great help...
    You can download it and run it by typing perl mysqltuner.pl

    http://mysqltuner.com/mysqltuner.pl

    Some of the settings we tweaked for the Zen Cart servers are below..

    tmp_table_size=128M
    max_heap_table_size=128M
    key_buffer_size=64M
    innodb_buffer_pool_size=128M

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  7. #7
    Join Date
    Apr 2009
    Posts
    10
    Plugin Contributions
    2

    Default Re: Who's Online Performance Issue

    I modified my who's online to refresh every 30 secs it works fine:

    <script type="text/javascript">
    <!--
    function init()
    {
    timedRefresh(30000);
    cssjsmenu('navbar');
    if (document.getElementById)
    {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
    }
    }
    // -->
    </script>
    <script type="text/JavaScript">
    <!--
    function timedRefresh(timeoutPeriod) {
    setTimeout("location.reload(true);",timeoutPeriod);
    }
    // -->
    </script>

    </head>


    <body onLoad="init()">

    peachgifts,
    diylearnwithme.com

    Zen Cart 1.3.8a
    File: whos_online.php
    Last edited by peachgifts; 26 Apr 2009 at 03:39 PM.

 

 

Similar Threads

  1. Who's Online sidebox a server load issue?
    By scrapgabbie in forum General Questions
    Replies: 3
    Last Post: 15 Sep 2009, 12:13 PM
  2. who's online issue
    By SQUAREGUM in forum General Questions
    Replies: 4
    Last Post: 19 Sep 2008, 04:50 PM
  3. who's online issue
    By robear in forum General Questions
    Replies: 0
    Last Post: 15 Jun 2008, 05:12 AM
  4. Who's Online - User gone, but Admin says online
    By johnd in forum General Questions
    Replies: 2
    Last Post: 23 Sep 2007, 01:57 AM
  5. Who is online...side admin vs online group pricing mod
    By csfound in forum General Questions
    Replies: 8
    Last Post: 18 Jul 2007, 04:27 AM

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