documentation
download & extend
community & support
B3 hosting
May 24, 2012, 12:48:29 AM
Home
Features
Get Started
Supported Games
Forums
Help
Search
Tags
Groupware
Login
Register
Activation Mail
It appears you have not registered with our community. To register please click here ...
You are here:
Big Brother Bot Forum
Community Developers
Plugin Developers
Optimize DB Plugin, and disablded on startup?
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Optimize DB Plugin, and disablded on startup? (Read 405 times)
WickedShell
Dev. Team
OS: Linux
Type: Home user
Gameservers:
UrT
Posts: 198
Offline
Optimize DB Plugin, and disablded on startup?
«
on:
October 06, 2011, 07:29:24 AM »
I went to write a plugin the other day, that would register B3 on a cronjob to periodically optimize database tables, as well as maybe make a backup. In the interest of not repeating work I did a quick grep through B3's source code, and noticed that setup.py allows tables to be optimized at startup, but that it is also commented out. Is there a reason for this? For the most part the database doesn't explode out of control with wasted space, but some plugins do start to generate sizeable overhead.
Looking at the databases for some of the B3's I have access to, some of them are floating at several megabytes of overhead, (30MiB size, 2 MiB overhead) (this is the entire DB, not just a specific table). I guess that's not to ridiculous, but it does bother that optimization bone of mine.
Is there a reason this was disabled? The big culprit in terms of overhead is actually the chatlogger plugin with about 4 to 8 times as much overhead as anything sels, which already has a periodic clean up function associated with it, with ctime being the second biggest accumulator. Is it worth writing a general DB optimize plugin, or is this something that will be left to plugins to manage? (And should I shoot the 2 or 3 lines of python code courgette would need to include optimize with chatlogger). Or am I just being ridiculous (or really wrong)?
Sidenote; I'm not surprised chat logger and ctime are the big overhead consumers, everything else only tends to insert things or update, not remove.
Logged
EchelonV2 Development;
https://github.com/WickedShell/echelon
EchelonV2 Issue Tracker;
https://github.com/WickedShell/echelon/issues
MordyT
Support Hero
OS: Windows
Type: Gameserver Rental Co.
Gameservers:
2x CoD4, 1x BF3
Posts: 2627
Offline
Owner of Host4B3.com - Over 70 bots hosted!
Re: Optimize DB Plugin, and disablded on startup?
«
Reply #1 on:
October 06, 2011, 07:40:51 AM »
Well, possibly one of the reasons it was disabled (if I remember) is some thread where by optimizing it would lock the tables, disallowing another service to use them.
I would be all over a database backup plugin, esp if it e-mails the database. One script I use (WHMCS) does this daily, awesome tool.
Logged
Need B3 Bot hosting? Check out
Host4B3.com
Check
Twitter.com/Host4B3
for updates if the site it down.
Help will be given to those with a b3.log
System: Python 2.7.1 - B3 Source Code - Locally hosted MySQL & Apache - Win 2k3
WickedShell
Dev. Team
OS: Linux
Type: Home user
Gameservers:
UrT
Posts: 198
Offline
Re: Optimize DB Plugin, and disablded on startup?
«
Reply #2 on:
October 06, 2011, 08:06:27 AM »
Ah... Yes, that would be a problem, although if it was run early enough at startup by core b3 code, everything else could just be made to wait, which would make startup slower, and require a restart to optimize, but that's easier to explain
As far as backing it up, I was mostly thinking of going so far as to do the equivalent to a phpmyadmin export, and save it to a local folder. But once it's there I imagine emailing it would be pretty trivial. Although it might start to hit message size limits eventually (I don't know how big some of the reaaally huge B3 databases are, especially for people who have multiple b3's pointed to the same DB/clients table). But I guess I'll start that as a separate plugin.
Logged
EchelonV2 Development;
https://github.com/WickedShell/echelon
EchelonV2 Issue Tracker;
https://github.com/WickedShell/echelon/issues
Courgette
Senior Dev.
OS: Linux
Type: Home user
Posts: 3484
Offline
Support Specialty:
B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
Re: Optimize DB Plugin, and disablded on startup?
«
Reply #3 on:
October 06, 2011, 09:19:37 AM »
I don't remember what the issue was with optimization but I have an other argument against it.
Database table space optimization is the responsibility of a sysadmin and as such is not to be treated at the application level.
B3 is already quite a complex application and to ensure its long term health we'd better try to keep it as simple as we can. In other words, we'd better keep its responsibilities limited.
Current B3 responsibilities are :
connect to a game server
fetch game server events
convert them to B3 events
dispatch events to plugins
provide to plugins means of controlling the game server
provide data persistence
Logged
Follow me :
@cucurb
.~. new
Smokin' guns official website
MordyT
Support Hero
OS: Windows
Type: Gameserver Rental Co.
Gameservers:
2x CoD4, 1x BF3
Posts: 2627
Offline
Owner of Host4B3.com - Over 70 bots hosted!
Re: Optimize DB Plugin, and disablded on startup?
«
Reply #4 on:
October 06, 2011, 09:48:58 AM »
http://forum.bigbrotherbot.net/xlrstats/xlrstats-not-running-correctly-on-mysql-5-5/
is the thread I was thinking of.
Logged
Need B3 Bot hosting? Check out
Host4B3.com
Check
Twitter.com/Host4B3
for updates if the site it down.
Help will be given to those with a b3.log
System: Python 2.7.1 - B3 Source Code - Locally hosted MySQL & Apache - Win 2k3
Mikobiko
Sr. Member
OS: Windows
Type: Owner dedicated server(s)
Gameservers:
COD4, COD5, COD7, Homefront
Posts: 211
Offline
Re: Optimize DB Plugin, and disablded on startup?
«
Reply #5 on:
October 06, 2011, 05:04:27 PM »
I use mysqldumper with a cron type task, it optimizes the database tables as part of the backup routine, and sends daily emails letting me know if theyw ere successful.
Really would suggest that.
Logged
WickedShell
Dev. Team
OS: Linux
Type: Home user
Gameservers:
UrT
Posts: 198
Offline
Re: Optimize DB Plugin, and disablded on startup?
«
Reply #6 on:
October 06, 2011, 07:00:53 PM »
I have to agree with the above, the following are the only reasons why I was considering it.
One - I keep having to deal with people who can not figure out how to maintain a working cron job, back up schedules, or can't understand the effort.
Two - While I agree that it's system level/sysadmin stuff, I was unsure as some stuff like chatlogger plugin manages history depth already.
And yes, in essence all the code I was going to do was setup an entry into the crontab, and let it run it from there. So verdict then is that leave the sysadmin's to do it as is there job. (And thus I should just start doing it for people rather then throwing them a plugin to not bother me about it?
Logged
EchelonV2 Development;
https://github.com/WickedShell/echelon
EchelonV2 Issue Tracker;
https://github.com/WickedShell/echelon/issues
Tags:
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News (Read Only)
===> News Archive
===> Website News
=> General Discussion
===> Servers
=> Shared Services
-----------------------------
Support Forums
-----------------------------
=> Support Instructions
=> Installation Support
=> General Usage Support
=> Game specific Support
===> Battle Field 3
=====> BF3/B3 beta board
===> Battle Field Bad Company 2
===> Call of Duty series
=====> CoD, CoD:UO, CoD2
=====> Call of Duty 4 (Modern Warfare)
=====> Call of Duty 5 (World at War)
=====> Call of Duty 6 (Modern Warfare 2)
=====> Call of Duty 7 (Black Ops)
=======> AlterOps
===> Frontlines, Fuel of War
===> Enemy Territory
===> Homefront
===> Medal of Honor 2010
===> Open Arena
===> Red Orchestra 2
===> Smokin' Guns
===> Soldier of Fortune 2
===> Urban Terror
===> World of Padman
===> Other games
-----------------------------
Add-Ons
-----------------------------
=> Plugins Discussion
===> Plugin Releases!
===> Plugins by xlr8or
===> Plugins by Courgette
===> Plugins by Freelander
===> Plugins by Bakes
===> Plugins by Ismael
===> Plugins by flinkaflenkaflrsk
===> Plugins by Anubis
===> Plugins by Spoon
===> Plugins by PtitBigorneau
===> Plugins by BlackMamba
===> Plugins by Beber888
===> Plugins by grosbedo
=> XLRstats
===> Weaponmodifiers
=> Echelon
===> Echelon version 2
=> Configurations
=> Installers
-----------------------------
Community Developers
-----------------------------
=> Plugin Developers
=> The Code Bin
Rate this page +1 at Google Search
Web Toolbar by Wibiya
SimplePortal 2.3.1 © 2008-2009, SimplePortal