Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 04 Aug 2016, 04:32
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
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.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #2  
Old 04 Aug 2016, 10:49
nhawk nhawk is offline
 
Join Date: Jan 2011
Anything is possible with a plugin.

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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #3  
Old 04 Aug 2016, 21:18
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
 
Join Date: Sep 2008
Real name: Michael Miller Jr
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.
__________________
Daddy Does Dios and Figs!
https://www.linkedin.com/in/thelastsuperman

Search - Use the search feature to find similar issues/answers.
Information - Include screenshots, copy/pasted error codes, url etc.
Fixed - Please return to your thread/post and let us know how it was fixed!
Thanks - For participating! Click the "Like" on a post if someone helped you!
Reply With Quote
  #4  
Old 04 Aug 2016, 21:31
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
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?
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #5  
Old 04 Aug 2016, 23:17
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
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 04 Aug 2016 at 23:19 ---------------

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.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #6  
Old 10 Aug 2016, 19:35
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
I first had the site owner run the manual query:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That didn't work.

Then I directed the owner to run the manual query:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:

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.
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 05:29.

Layout Options | Width: Wide Color: