Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: guest_info table

  1. #1
    Join Date
    Mar 2008
    Posts
    9

    Default guest_info table

    I was having huge problems with the script the last few weeks due to mysql bottlenecks. I found the error after some research the problem was the guest_info table, it had over 1 million records. Is it supposed to keep a hold of all the guest infos visits? I dont see much point or need in it, anyway to turn it off? Im having to flush the tables every day now which isnt the most ideal solution

  2. #2
    Join Date
    Feb 2008
    Location
    Greece
    Posts
    235

    Default Re: guest_info table

    Yes i wnat to turn it off too . How to do that admin???

  3. #3
    Join Date
    Mar 2008
    Posts
    9

    Default Re: guest_info table

    I know its nor a permanent solution but im running the following every 30 mins via cron...

    Code:
    <?php 
    
    ## CUSTOMIZE SETTINGS FOR YOUR SITE ##
    $db_host = "localhost"; // Change this if your MySQL database host is different.
    $db_name = "db name"; // Change this to the name of your database.
    $db_user = "db user"; // Change this to your database username.
    $db_pw = "pass"; // Change this to your database password.
    $datecut = $_SERVER['REQUEST_TIME'] - (30*24*60*60);
    #######################################
    
    // Connecting to your database
    mysql_connect($db_host, $db_user, $db_pw) 
    OR die ("Cannot connect to your database"); 
    mysql_select_db($db_name) OR die("Cannot connect to your database"); 
    
    mysql_query("TRUNCATE TABLE `guest_info`");
    
    # mysql_query("TRUNCATE TABLE `playlist`"); // un comment if you also don't want to track peoples entire playlists.
    
    
    ?>

    Could should work ok, im no php expert so if there are errors I apologize but its working fine for me and speeded up the site a whole lot :D

  4. #4
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: guest_info table

    I found that this works on any of my sites (without having to configure each one for each site). My sites aren't horribly busy so I set this in cron to run every night at midnight.

    Code:
        
        <?php
        include("include/config.php");
        $db=mysql_connect ($db_host,$db_user,$db_pass) or die ('I cannot connect to the database because: ' . mysql_error());
        mysql_select_db ($db_name);
        mysql_query("TRUNCATE TABLE `guest_info`");
        #mysql_query("TRUNCATE TABLE `playlist`"); // uncomment if you also don't want to track peoples entire playlists.
        mysql_close($db);
    	print "Your guests and their play lists have been cleared from the database.\n";
       ?>
    If it's not fun, stop doing it!

  5. #5
    Join Date
    Sep 2008
    Posts
    1,019

    Default Re: guest_info table

    You can actually streamline your code by removing the "datecut" line as it is not being executed for your statements.

    There is actually another way to accomplish this on the mySQL side. It's a bit more complicated, but the end result would be that the entry is removed immediately after it is written. I'll have to write out a procedure and post it.
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  6. #6
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: guest_info table

    Sweet! I'll modify the original to remove the time thingie. Thanks for bringing this to our attention and posting about it BTW.
    If it's not fun, stop doing it!

  7. #7
    Join Date
    Sep 2008
    Posts
    1,019

    Default Re: guest_info table

    One other thing that I would change to your code is to add a mysql close statement. This way, you close out the connection that you open when you run the truncate (so as to free up resources). For your code, simply execute at the end:
    Code:
    mysql_close($db);
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  8. #8
    Join Date
    Mar 2008
    Posts
    9

    Default Re: guest_info table

    Awesome this code is a little better then mine, thank you :D

  9. #9

    Default Re: guest_info table

    So that's why my mysql is running at 130% CPU at times. Thanks for this. Luv it!

    ==============================================
    http://www.TopFreaks.com - Black Amateur Porn
    TopFreaks.com/index.php - Free Black Porn

    BootyCallFriends.com - 100% Free Booty Call Friends Finder

  10. #10
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: guest_info table

    mysql_close($db); added to the bottom. Thanks.
    If it's not fun, stop doing it!

Page 1 of 3 123 LastLast

Similar Threads

  1. Disable Guest_Info logging for Bandwidth (DB issues)
    By icxxx in forum Installation Support
    Replies: 1
    Last Post: 02-09-2009, 08:35 PM
  2. Problem with SQL speed bc guest_info table
    By RAMMSTEIN in forum General Discussions
    Replies: 0
    Last Post: 05-10-2008, 11:00 PM
  3. guest_info table is making larger database
    By RAMMSTEIN in forum Fixed Bugs
    Replies: 0
    Last Post: 03-29-2008, 09:16 AM
  4. guest_info table is making larger database
    By RAMMSTEIN in forum Fixed Bugs
    Replies: 0
    Last Post: 03-29-2008, 09:16 AM
  5. css for table containing bg1 image...
    By kingdomar in forum Template Modifications
    Replies: 1
    Last Post: 02-27-2008, 10:58 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
  •