• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 3.x Series
    • Bug
    • MySQL server has gone away

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: MySQL server has gone away

    • Issue Tools
      • View Changes
    1. issueid=1952 August 27, 2010 5:03 AM
      Jaxel Jaxel is offline
      Junior Member
      MySQL server has gone away

      Code:
      Database error in vBulletin 4.0.6:
      
      MySQL Error   : MySQL server has gone away
      Error Number  : 2006
      Request Date  : Friday, August 27th 2010 @ 04:57:25 AM
      Error Date    : Friday, August 27th 2010 @ 04:58:32 AM
      Script        : http://www.8wayrun.com/wiki_ajax.php?do=autolink&t=4924
      Referrer      : http://www.8wayrun.com/wiki/Yoshimitsu
      I get this error A LOT on my forum, and its only with the Wiki, and 95% of the time, its because of the autolinking timing out the MySQL server. So I have disabled all autolinking to articles, and yet I am still getting these errors.
    Issue Details
    Issue Number 1952
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Templates
    Status Fixed
    Priority 2 - Fatal / Database Errors
    Affected Version 3.0.3
    Fixed Version 3.0.4
    Milestone VaultWiki 3.0.5
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. August 27, 2010 9:09 AM
      pegasus pegasus is offline
      VaultWiki Team
      Is this a new error recently, or have you been getting these for months? If they've been occurring for a long time, when would you say they began (around what version)? Does your MySQL error log contain entries of slow queries? It would help to get a list of these.

      Disabling autolinking doesn't actually affect the script reporting the error. You want to disable AJAX Previews under VaultWiki: General Settings.

      But the issue is really just that the following page takes a very long time to load:
      Code:
      http://www.8wayrun.com/wiki/Yoshimitsu_-_Soulcalibur_IV_-_Frame_Data
      It may be an issue with the code that tries to determine where the first paragraph ends without breaking any open BB-Codes. Since the article contains a lot of line breaks (as per the TABLE code), it may be confusing to the parser. I will revisit and see if this can be improved.
      Reply Reply  
    2. August 27, 2010 2:49 PM
      Jaxel Jaxel is offline
      Junior Member
      It has started since I upgraded to VB4, and the VB4 version of VaultWiki. If I ever got the error before hand, it was maybe once a week. Now its close to 50 times a day.
      Reply Reply  
    3. August 27, 2010 2:51 PM
      Jaxel Jaxel is offline
      Junior Member
      My ENTIRE wiki is built on templates...
      Reply Reply  
    4. August 27, 2010 6:37 PM
      pegasus pegasus is offline
      VaultWiki Team
      It seems that the only reason this article takes so long is the sheer number of templates. Each template has to call the parser recursively, should they contain noparsed text, code blocks, or nested templates. This particular page calls over 300 templates. While I see that some code takes more time than others to run, it's unlikely we will be able to make a significant impact in the load time in a build very soon.

      It's documented that templates are slow and should be used economically: http://www.vaultwiki.org/books/Intro...t=economically

      You may want to consider breaking long pages like this into multiple pages.
      Reply Reply  
    5. August 27, 2010 7:02 PM
      pegasus pegasus is offline
      VaultWiki Team
      I have added a cache mechanism for the next build that remembers the locations and default values of parameters in templates should they be reused in the same article. This eliminates the need to look-up the parameter positions each time the template is invoked.

      In the article currently under discussion, this change reduces the time taken to parse templates by about 40%.
      Reply Reply  
    6. August 27, 2010 7:08 PM
      pegasus pegasus is offline
      VaultWiki Team
      In vault/class/template.php, find:
      Code:
      			$template_text = $this->process_template_params($template_text, $args);
      Replace with:
      Code:
      			$template_text = $this->process_template_params($title, $template_text, $args);
      Find:
      Code:
      	function process_template_params($text, $vars)
      	{
      		preg_match_all('#\{\{\{([^\{\}]*)(\|([^\{\}]*)?)?\}\}\}#sU', $text, $matches);
      
      		if (empty($matches[1]))
      		{
      			($hook = vBulletinHook::fetch_hook('vault_templatecode_complete')) ? eval($hook) : false;
      
      			return $text;
      		}
      
      		$acceptable = array();
      
      		foreach ($matches[1] AS $i => $name)
      		{
      			$acceptable["$name"][] = $i;
      		}
      
      		if (empty($acceptable))
      		{
      			($hook = vBulletinHook::fetch_hook('vault_templatecode_complete')) ? eval($hook) : false;
      
      			return $text;
      		}
      Replace with:
      Code:
      	function process_template_params($key, $text, $vars)
      	{
      		static $varcache;
      
      		if ($varcache["$key"] === null)
      		{
      			$buffer = $text;
      			preg_match_all('#\{\{\{([^\{\}]*)(\|([^\{\}]*)?)?\}\}\}#sU', $text, $matches);
      			$varcache["$key"] = array();
      
      			if (empty($matches[1]))
      			{
      				($hook = vBulletinHook::fetch_hook('vault_templatecode_complete')) ? eval($hook) : false;
      
      				return $text;
      			}
      
      			while (!empty($matches[1]))
      			{
      				foreach ($matches[1] AS $i => $name)
      				{
      					$varcache["$key"]["$name"][] = array(
      						'find' => $matches[0]["$i"],
      						'default' => $matches[3]["$i"]
      					);
      				}
      
      				$buffer = str_replace($matches[0], '', $buffer);
      				preg_match_all('#\{\{\{([^\{\}]*)(\|([^\{\}]*)?)?\}\}\}#sU', $buffer, $matches);
      			}	
      		}
      
      		if (empty($varcache["$key"]))
      		{
      			($hook = vBulletinHook::fetch_hook('vault_templatecode_complete')) ? eval($hook) : false;
      
      			return $text;
      		}
      Find:
      Code:
      		while (!empty($matches[0]))
      		{
      			foreach ($matches[1] AS $key => $name)
      			{
      				if (!empty($acceptable["$name"]))
      				{
      					foreach ($acceptable["$name"] AS $match)
      					{
      						if ($temp_values["$name"] !== null)
      						{
      							$value = $temp_values["$name"];
      						}
      						else if ($matches[3]["$key"] !== null)
      						{
      							$value = $matches[3]["$key"];
      						}
      						else
      						{
      							$value = '';
      						}
      
      						$value = $this->clean_value($value);
      						$text = str_replace($matches[0]["$match"], $value, $text);
      					}
      				}
      				else
      				{
      					$text = str_replace($matches[0]["$key"], '', $text);
      				}
      			}
      
      			preg_match_all('#\{\{\{([^\{\}]*)(\|([^\{\}]*)?)?\}\}\}#sU', $text, $matches);
      
      			if (!empty($matches[0]))
      			{
      				$acceptable = array();
      
      				foreach ($matches[1] AS $i => $name)
      				{
      					$acceptable["$name"][] = $i;
      				}
      			}
      		}
      Replace with:
      Code:
      		foreach ($varcache["$key"] AS $name => $instances)
      		{
      			foreach ($instances AS $param)
      			{
      				if ($temp_values["$name"] !== null)
      				{
      					$value = $temp_values["$name"];
      				}
      				else if ($param['default'] !== null)
      				{
      					$value = $param['default'];
      				}
      				else
      				{
      					$value = '';
      				}
      
      				$value = $this->clean_value($value);
      				$text = str_replace($param['find'], $value, $text);
      			}
      		}
      Reply Reply  
    7. September 1, 2010 6:33 PM
      Jaxel Jaxel is offline
      Junior Member
      Unfortunately, its still not fast enough... I have pages that worked fine in VB3...

      http://www.8wayrun.com/wiki/Talim_-_..._ZeroEffect317
      http://www.8wayrun.com/wiki/Seong_Mi...by_InsaneKhent

      However on the VB4 version, they just wont load at all...

      Code:
      Fatal error: Maximum execution time of 30 seconds exceeded in /home/eightway/public_html/vault/class/bbcode/cleaner.php on line 324
      Reply Reply  
    8. September 2, 2010 1:58 AM
      pegasus pegasus is offline
      VaultWiki Team
      If I copy the source, those pages take about 7 seconds to load here. I suspect the parsing is slowed down dramatically by another modification you are using. What other mods are you using that affect the parser? Would it be possible for me to have a look at your plugin code to see if there is some inefficiency there?

      As a side note, those pages are ridiculously long anyway, and should be reduced in the best interest of your server hardware. I recommend separating them into multiple pages, perhaps as part of a Book.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 12:09 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.