[mythtv-users] mythweb_sessions table is huge

Michael T. Dean mtdean at thirdcontact.com
Mon Mar 21 11:21:09 UTC 2016


On 03/21/2016 12:49 AM, Will Dormann wrote:
> Hi folks,
>
> I've got a mythtv instance that's been running for over 15 years in some
> form or another.   Looking at what's using up my disk space, I'm
> noticing that my mythweb_sessions table is pretty big:
>
> # ls -alh mythweb_sessions.MYD
> -rw-rw---- 1 mysql mysql 1.8G Mar 21 00:40 mythweb_sessions.MYD

This indicates one of 2 possible situations:
   a) You have regular visitors from the Internet, totaling well over 
529,000 unique visitors in the last 15 years, or
   b) You haven't properly configured login for MythWeb, so MythWeb 
creates a brand new session for you every time you visit the page

Since a) would imply a lack of authentication, that means b) is 
definitely involved and a) may be possible (though I'd guess it's just b).

If you configure login, then MythWeb will use the already-created 
session associated with the user who logs in each time you visit--and, 
more interestingly, will use/remember the settings you specify in 
MythWeb settings.

My system which is using a database created 12 years ago:

# ls -l mythweb_sessions.MYD
-rw-rw---- 1 mysql mysql 3652 Mar 21 07:08 mythweb_sessions.MYD


> Any harm in removing the contents of this table?

Nope. Just means you'll have to set up your MythWeb-specific settings, 
again--though since you don't seem to have authentication enabled, you 
must be living with the default settings as it is, so you'll be right 
back where you are.

Just use mysql:

mysql -umythtv -p mythconverg -e 'DELETE FROM mythweb_sessions;'

and set up authentication so you're not creating new sessions each time 
you access MythWeb:

https://github.com/MythTV/mythweb/blob/master/README#L57
https://github.com/MythTV/mythweb/blob/master/README#L71
https://github.com/MythTV/mythweb/blob/master/INSTALL#L349

If nothing else, use client certs--that way, you still don't have to log 
in to access MythWeb, but get the benefits of authentication and 
session-awareness once you configure a cert in your browser(s):

https://httpd.apache.org/docs/2.2/ssl/ssl_howto.html#accesscontrol

Mike


More information about the mythtv-users mailing list