Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 08-04-2016, 02:32 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Odd issue with "session" table

I provide technical assistance at a forum running vB 4.2.2, and a few days ago for no apparent reason the "session" table began to fill up and throw a MySQL error preventing our users from using the site.

I directed the site owner to truncate the "session" table via phpMyAdmin, and we were back up. However, the issue came back very soon.

The first thing I checked was to make certain the cronimage was intact in all of the footer templates, which it is, and I verified the image is present in the DOM of all the styles.

Next I checked the Scheduled Tasks, and verified that the 2 hourly cleanup tasks are being run. One was set at 5 after the hour and the other at 20 after, and I changed to one set at 20 after to 35 after so that the two hourly cleanups would be 30 minutes apart. The issue persisted.

As a temporary fix, I wrote a plugin that prunes the "session" table of all expired rows any time one of the 4 senior staff members loads the index, showthread, search and online scripts. When I leave my compute for more than a few minutes I leave Who's Online running so it will auto-refresh and keep pruning the table.

Earlier today, I followed:

AdminCP -> Maintenace -> Diagnostics -> System Information -> Table Status

and I found that the "session" table has very small values for Data_length and Max_data_length:

Data_length: 11744
Max_data_length: 12768

At MHB (Math Help Boards) these values are:

Data_length: 127296
Max_data_length: 13486755

And on my local dev site, they are:

Data_length: 129500
Max_data_length: 14738963

So my questions are:
  • Is it possible that these values were recently changed (via plugin code or host) to be much smaller?
  • How do we go about resetting them to larger values?

I appreciate any advice you can give.
Reply With Quote
  #2  
Old 08-04-2016, 08:49 AM
nhawk nhawk is offline
 
Join Date: Jan 2011
Posts: 1,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anything is possible with a plugin.

To increase the size, look into this MySql query...

Code:
alter table tablename max_rows = XXXXXXX avg_row_length = XXXX
Reply With Quote
2 благодарности(ей) от:
MarkFL, RichieBoy67
  #3  
Old 08-04-2016, 07:18 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is your session timeout set to?
Admin CP > Settings > Options > Cookies and HTTP Header Options > Session Timeout

Some sites try to increase that (by daysssss not minutes) and too large of a session timeout setting without a plugin to conteract it can cause issues as you've described. When you prune the session table, granted it reduces the session table from filling up and preventing access however it also resets the user and if they were previously logged in now they aren't and if in a middle of a post and autosave didn't kick in just in time bam now typed post is now gone as well. Be careful with the session table, you can also simply use sql TRUNCATE to wipe the slate clean but same thing will happen i.e. all users still on the site BUT seems as if everyone logged out all at once that way.
Reply With Quote
Благодарность от:
MarkFL
  #4  
Old 08-04-2016, 07:31 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How many entries were in the table and what is the difference between the timestamp of the first and last entry in the table?
Also if it fills up so quickly, are there thousands of bots crawling that forum or something?
Reply With Quote
3 благодарности(ей) от:
MarkFL, ProfC, TheLastSuperman
  #5  
Old 08-04-2016, 09:17 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't have phpMyAdmin access, or the ability to run a manual query. And there are just a few bots at any given time.

The site owner did run an "alter table" query, but it had no effect.

I'm thinking the database may have to be altered via server config. I just now noticed the max_heap_table_size is set at 16384 while at my local dev site it's at 16777216 (2^10 times as large). We'll have a go at changing that.

--------------- Added [DATE]1470352791[/DATE] at [TIME]1470352791[/TIME] ---------------

Quote:
Originally Posted by TheLastSuperman View Post
What is your session timeout set to?
Admin CP > Settings > Options > Cookies and HTTP Header Options > Session Timeout

Some sites try to increase that (by daysssss not minutes) and too large of a session timeout setting without a plugin to conteract it can cause issues as you've described. When you prune the session table, granted it reduces the session table from filling up and preventing access however it also resets the user and if they were previously logged in now they aren't and if in a middle of a post and autosave didn't kick in just in time bam now typed post is now gone as well. Be careful with the session table, you can also simply use sql TRUNCATE to wipe the slate clean but same thing will happen i.e. all users still on the site BUT seems as if everyone logged out all at once that way.
We have the session timeout at 900 right now. So far no one is complaining about being logged out in the middle of a session though.
Reply With Quote
  #6  
Old 08-10-2016, 05:35 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I first had the site owner run the manual query:

Code:
alter table `session` max_rows = 25000 avg_row_length = 532
That didn't work.

Then I directed the owner to run the manual query:

Code:
set @@max_heap_table_size=16777216
That didn't work...and I began to suspect the db would need to be restarted.

I directed the owner to the following link:

How to edit the MySQL my.cnf file

I was informed by the owner:

Quote:
That's not possible as we're not running on a VPS or dedicated server.
Okay, well I then suggested contacting the host for assistance. After waiting nearly a week for them to reply, they finally edited the my.cnf file, and we appear to be back in business.

We still have no idea how the MySQL variable was changed in the first place.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:23 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04397 seconds
  • Memory Usage 2,223KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete