DEBUG - Error Creating New Session


Subject: DEBUG - Error Creating New Session
Often I'm told that the phpbb_session table is full and I must empty it manually to make the site work again. I don't know if you have my same problem, anyway here is the patch (that will be included in phpbb 3)

OPEN:

Code: [Download] [Hide]
  1. include/sessions.php 


FIND:

Code: [Download] [Hide]
  1. message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql); 


REPLACE WITH:

Code: [Download] [Hide]
  1. $error = TRUE;  
  2. if (SQL_LAYER == "mysql" || SQL_LAYER == "mysql4")  
  3. {  
  4. $sql_error = $db->sql_error($result);  
  5. if ($sql_error["code"] == 1114)  
  6. {  
  7. $result = $db->sql_query('SHOW TABLE STATUS LIKE "'.SESSIONS_TABLE.'"');  
  8. $row = $db->sql_fetchrow($result);  
  9. if ($row["Type"] == "HEAP")  
  10. {  
  11. if ($row["Rows"] > 550)  
  12. {  
  13. $delete_order = (SQL_LAYER=="mysql4") ? " ORDER BY session_time ASC" : "";  
  14. $db->sql_query("DELETE QUICK FROM ".SESSIONS_TABLE."$delete_order LIMIT 50");  
  15. }  
  16. else  
  17. {  
  18. $db->sql_query("ALTER TABLE ".SESSIONS_TABLE." MAX_ROWS=".($row["Rows"]+50));  
  19. }  
  20. if ($db->sql_query($sql))  
  21. {  
  22. $error = FALSE;  
  23. }  
  24. }  
  25. }  
  26. }  
  27. if ($error)  
  28. {  
  29. message_die(CRITICAL_ERROR, "Error creating new session", "", __LINE__, __FILE__, $sql);  

Subject: Re: [Patch] Error Creating New Session
Even if I added this patch, the problem seemed not to be solved...so, as suggested here, I increased the MAX_ROWS of the table (that actually in phpBBXS are 550 :shock: ) with a query like this

Code: [Download] [Hide]
  1. ALTER TABLE phpbb_sessions MAX_ROWS = 2500; 


and now it seems work fine :wink:

Subject: Re: [Patch] Error Creating New Session
Great suggestion!

I'm moving this to the Docs Section.

Thank you very much for this... many users will find this useful. :up:


P.S.: Since it's not the first time you are suggesting me something really useful... you are upgraded to VIP with special access to Development section. :wink:

Subject: Re: [Patch] Error Creating New Session
thx :wink:

Subject: Re: [Patch] Error Creating New Session
hmm i little bit confused, should we all apply this? or only if we have errors with sessions?

Subject: Re: [Patch] Error Creating New Session
It's up to you...untill you don't have problem with sessions, you shoudn't touch anything but if you want to prevent any problem, apply it :)

Subject: Re: [Patch] Error Creating New Session
You're right... I quote this...
z3d0 wrote: [View Post]
It's up to you...untill you don't have problem with sessions, you shoudn't touch anything but if you want to prevent any problem, apply it :)

Subject: Re: [Patch] Error Creating New Session
Quote:
SQL Error : 1114 The table 'phpbb_sessions' is full

INSERT INTO phpbb_sessions (session_id, session_user_id, session_start, session_time, session_ip, session_user_agent, session_page, session_logged_in, session_admin) VALUES ('14d3ecbe31ca3d5e9dcc308160f9b4ac', 4, 1175281452, 1175281452, 'c9e3b416', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.3) Gecko/20070309 Firefox/2.


I have that problem, which solution must implement
Code: [Download] [Hide] [Select]
ALTER TABLE phpbb_sessions MAX_ROWS = 2500;
this or the solution in the first topic??

I have IP, the firts topic is for IP? or XS?

thanks, i don't want have this problem with full table again

Profile PM  
Subject: Re: [Patch] Error Creating New Session
Hmm one day more after truncate the table are full again :P

Now I apply the patch, and I hope that don't have this problem again


thanks thanks Z3do

Profile PM  
Subject: Re: [Patch] Error Creating New Session
ok, for 1 month this solution work, but now my website have more than 1200 users and the error appear again.

I believed that the solution is

Code: [Download] [Hide]
  1. ALTER TABLE phpbb_sessions MAX_ROWS = 9999;  


because of 2500 register are reached easily in my website in this moments.


my question now is this?

when my website grows again, this value was small again.

what is the maximum value than I can set up


thanks




EDIT:

AND waht about this table phpbb_sessions_keys¿???

i can truncate this table too, or if I do that, I will have troubles??

Profile PM  
Subject: Re: [Patch] Error Creating New Session
Your table is HEAP or MyISAM?

Subject: Re: [Patch] Error Creating New Session
is heap MG, I will that with heap table this problem don't appear again but :(

now 1300 users :mrgreen:

thanks, for now 9999 rows works

Profile PM  
Subject: Re: [Patch] Error Creating New Session
diegomak wrote: [View Post]
is heap MG, I will that with heap table this problem don't appear again but :(

now 1300 users :mrgreen:

thanks, for now 9999 rows works

Convert it to MyISAM.

Subject: Re: [Patch] Error Creating New Session
Mighty Gorgon wrote: [View Post]

Convert it to MyISAM.


Mighty Gorgon wrote: [View Post]
I've edited the code to Icy Phoenix.
Anyway you may even decide to convert the table from HEAP to MyISAM.
HEAP type has the advantage to remain loaded in memory, so SQL are a bit faster, but MyISAM should not have the problem listed above.
I use MyISAM... :wink:



I don`t know how do that.
but now, I ask,
in the final version(1.1.0.15) you do that(myISAM table??)
in the final version I need apply this patch???(in the first topic)

jeje my forum around 1800 users now :P

Profile PM  
Subject: Re: [Patch] Error Creating New Session
If you don't know how to do it... don't do it... :wink:

On a clean installation sessions table is MyISAM.

I won't convert tables with the upgrade script, because it may leads to some problems if not done properly.


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.0879s (PHP: 24% SQL: 76%)
SQL queries: 11 - Debug Off - GZIP Enabled