My forum keeps crashing every week or two, because the TMP file in MYSQL keeps getting full and maxing out. When that happens I get this error message on the forum:
My webhost said that I can't clear out the TMP file and that only their higher admins can. What is this? I created a ticket for this issue and today my webhost said that the issue is connected to the phpbb_sessions table. See their email to me below. What can I do about this?General Error
SQL ERROR [ mysqli ]
Disk full (/tmp/#sql_1d9a_1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") [1021]
An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.
My reply to them:Thank you for contacting support. My name is Joshua and I am a Web Administrator with Bluehost. I am following up on this case regarding /tmp being 100% full. Looking into this further it appears that /tmp is filling up due to checks done on your MySQL database happier2_phpbbbackup_restore. Currently, it looks like happier2_phpbbbackup_restore is 3.3G and your /tmp directory is only 1.1G. It does appear that the largest table is phpbb_sessions. Moving forward you can either:
1) Work with your site developer in order to reduce the size of the phpbb_sessions table
2) Have us increase the size of /tmp. Currently, /tmp is 1.1G. You have 2.1G available on your main drive. If you were looking to have us increase the size of /tmp you may want to reduce the current usage of your account first. Here is a breakdown of the account:
https://privatebin.support-tools.com/?a ... iWCB9PjAMq
If you would like us to increase the size of /tmp, please let us know how large you would like to increase it to. If you would like us to remove any content prior, please reply to this email with "I GIVE BLUEHOST PERMISSION TO REMOVE <insert FULL file paths here>". Please note that content removal is irrecoverable.
If you have any further questions, please do not hesitate to reply to this email.
Their next reply to me:So you mean the phpbb sessions table is bloating up and causing the forum to crash? What if I just delete that table? That table is expendable and doesn't contain any posts or data and can be recreated automatically by the forum. Why would a sessions table become 1 GB? It's just a temporary table. Could spam bots be filling it up?
Yes you can just delete the TMP folder on my SQL server. You did that 2 or 3 times before right? Check my records. Removing it doesn't erase anything important. It's just a cache folder right? Why didn't you remove it yet? Last time your customer service staff just removed it without any further questions. It looks like your security protocols are more strict than before?
I have little space left on my server. Increasing the size of the TMP file allowance would only be a temporary solution until it fills up again. It's better to prevent it from filling up. Would enabling cloudflare help?
Any advice? What does it mean to truncate the phpbb_sesssions table? How do I do that? Would that help? Is that a permanent fix?My name is Elissa S. of escalated support,
Generally we should ask before removing client data. Since the sessions table is generated by your site we should be asking before removing the files. For files in /tmp we're generally more willing to go ahead wit those removals without permission given those files are often automatically generated by system services. For example I see we removed the /tmp/wpinstaller zip files as these were generated by wpinstaller and the failure of wpinstaller to manage these files in the past has been an issue. Since those do not contain sites or unique user generated data there's little harm in removing them.
On the sessions table: In my understand removing that table would logout all users on your site. They can just log back in. Generally we do not delete or drop tables automatically because we are not your system administrators nor do we specialized in phpbb. In most cases it would be fine but since we did not build, design or maintain your site I don't know if you've modified what's kept that or if this data was purposeful retained by you for a specific reason.
I do understand that the phpbb administrator tools do have a clear sessions option.
Why is it large? Probably because there are either a large amount of logins or login attempts or your site isn't cleaning up the sessions after they expire or they're set to not expire. Spambots could be at fault. That said we are not database administrators and I would suggest consulting with a phpbb administrator for better insight into this issue Using cloudflare is generally a good idea as their cdn usually filters out known problem bots and attackers that have hit other sites automatically.
As to dropping the sessions table, you can do so in phpmyadmin or via the mysql command line. There might be an option in phpbb to clear the sessions table too, if that's available I would suggest that as it would do it in the way the software expects. If you want me to do it I would login as root, and use the mysql command line to execute the following
USE happier2_phpbbbackup_restore;
TRUNCATE TABLE phpbb_sessions;
Again this would just completely wipe the table and I'm doing this on the inference that the following posts contain accurate information. Again we do not have phpbb administration experience here and I would strongly recommend retaining someone with the appropriate experience or having a working backup that you can restore.
viewtopic.php?t=1314325
viewtopic.php?t=1638695
viewtopic.php?t=2375091
I hope this information helps, but if you require further assistance or have any additional questions, then please do not hesitate to reply to this email so that we may continue to help as needed.
Also, what's the connection between the TMP file in MYSQL and the phpbb_sessions table? I searched this forum's archives and there's no info about that that I could find.
Thanks.