Page 2 of 2

Re: phpbb sessions question [Solved]

PostPosted: Mon Jul 24, 2006 6:23 pm
Author: Driver 7
I noticed this morning that the sessions tables here were full. I have now gone 15 days after changing my sessions table type to a MYISAM Table. I am curious as to why others are not doing the same? Is there any reason why one would not want to do this.

My sessions tables were filling up every other day before the change.

Re: phpbb sessions question

PostPosted: Mon Jul 24, 2006 8:51 pm
Author: Teelk
Hey Driver 7,

Could you clarify something for me? In the first few posts you say that you changed the sessions table from HEAP to MyISAM, and in the last post you say you changed from MyISAM to HEAP.. <img>

A fresh install of IM 1.4.0(or a recent phpBB version) would create the sessions table as MyISAM. This table type most likely won't fill up as it's MAX_ROWS is usually large enough to handle a busy forum. A HEAP table's MAX_ROWS is much lower, usually set to 550 by your host.

The advantage to using HEAP over MyISAM is that HEAP is much faster as it's kept in memory rather then written to HDD. But, of coarse, it can't handle as many entries as it would most likely crash the server.

Regardless of your session table type you can try to increase the MAX_ROWS to suit the number of sessions that may occur based on your user base.

Run the following query in phpmyadmin.
Code: Select all
ALTER TABLE phpbb_sessions MAX_ROWS = 2500;
You can increase the number of rows past 2500, but it cannot exceed the MySQL max_heap_table_size.

The MySQL people say that MySQL won't let you increase the MAX_ROWS past the max_heap_table_size. But, I've also heard that increasing the MAX_ROWS pas the max_heap_table_size can give you the sessions table full error, so I don't know the truth.

Alternatively, we could introduce a script which would check how many sessions exist for a user ip and once it reaches a certain number, delete the oldest one. That would work great normally, but if you have a number of users behind a proxy then they all couldn't get access to the board.

Re: phpbb sessions question

PostPosted: Tue Jul 25, 2006 6:17 am
Author: Driver 7
oops. Ya I meant to say I changed it from HEAP to MyISAM. <img>

Thanks for the response. My site does not really seem any slower since the change and my server is very stable so far so I will leave it as is I guess.

But I will run that query right now. Thanks bro.

Re: phpbb sessions question

PostPosted: Tue Jul 25, 2006 10:02 am
Author: Teelk
With modern servers and software, plus high-speed internet connections, you most likely won't even notice a difference in speed. It should be set to MyISAM nowadays anyway.

Re: phpbb sessions question

PostPosted: Sat Jan 12, 2008 1:27 am
Author: binh.tang
"Teelk";p="12371" wrote:Hey Driver 7,

Run the following query in phpmyadmin.
Code: Select all
ALTER TABLE phpbb_sessions MAX_ROWS = 2500;
You can increase the number of rows past 2500, but it cannot exceed the MySQL max_heap_table_size.


Hi Teelk,

I ran the command but looking at phpmyadmin, I can see over 2500 rows already! So, I changed it the MAX_ROWS to 5000 instead. The next day, I checked on phpmyadmin, the phpbb_sessions table had over 6000 rows. Isn't that supposed to 'cap' it to 5000 instead?

Not sure what's going on. The php_sessions table was on MyISAM, but I changed it to InnoDB instead and my site seems to run a lot better......

Hopefully someone can shed some light on how to 'kill' unused sessions in the phpbb_sessions table......