So I thought maybe it’s time for an update.
The project is moving, albeit slowly, and I realy do not like the current PHP implementation, I want to move towards a C++ version, and I will do so as soon as I figure out how to do CLI “update/refresh” …
i.e. See how W GET works with the progress bar and kbps all in text, I have NO idea how that works.
I am also looking at adding RRDTOOL support.
Anyway here’s the current sample output:
1
| [buzz@server01 .sysadmin]$ ./dbstat.php summary |
1
| ----- mySQL dbStat v1.1 Summary Report----- |
1
| exampledb1: 13 tables (0 VIEWS 13 INNODB 0 MYISAM) 0.77MB DATA 0.64MB INDEX |
1
| exampledb2: 15 tables (0 VIEWS 14 INNODB 1 MYISAM) 0.22MB DATA 0.19MB INDEX |
1
| exampledb3: 62 tables (0 VIEWS 0 INNODB 62 MYISAM) 0.45MB DATA 0.5MB INDEX |
1
| exampledb4: 3 tables (0 VIEWS 0 INNODB 3 MYISAM) 0.02MB DATA 0.01MB INDEX |
1
| exampledb5: 4 tables (0 VIEWS 0 INNODB 4 MYISAM) 0.02MB DATA 0.01MB INDEX |
1
| exampledb6: 4 tables (0 VIEWS 0 INNODB 4 MYISAM) 39.81MB DATA 22.22MB INDEX |
1
| exampledb7: 3 tables (0 VIEWS 0 INNODB 3 MYISAM) 0.04MB DATA 0.01MB INDEX |
1
| exampledb9: 599 tables (8 VIEWS 1 INNODB 590 MYISAM) 8702.79MB DATA 4559.42MB INDEX |
1
| exampledb10: 22 tables (0 VIEWS 21 INNODB 1 MYISAM) 6.66MB DATA 2.26MB INDEX |
Detail:
1
| ----- START mySQL dbStat v1.1 Detail Report: exampledb9 ----- |
1
| exampledb9: 599 tables (8 VIEWS 1 INNODB 590 MYISAM) 8893.7MB DATA 4583.54MB INDEX |
1
| --- Table Index Ratio Report index:data (457 Tables) --- |
1
| exampledb9.table1: 315.0769:1 |
1
| exampledb9.table2: 315.0769:1 |
1
| exampledb9.table3: 157.5385:1 |
1
| exampledb9.table4: 146.2857:1 |
1
| exampledb9.table5: 128.0000:1 |
… (I’ve truncated this very long list)
1
| --- Table Fragmentation Report (2 Tables) --- |
1
| exampledb9.atable: 0.6067 |
1
| exampledb9.atable: 0.1285 |
1
| --- Table Low Size Report (47 Tables) --- |
1
| exampledb9.atable: 0 bytes |
1
| exampledb9.atable: 0 bytes |
1
| exampledb9.atable: 0 bytes |
1
| exampledb9.atable: 0 bytes |
1
| exampledb9.atable: 0 bytes |
… (Truncated again)
1
| --- Table Detail Report (591 Tables) --- |
1
| SCHEMA.TABLENAME: ENGINE: ROWS: TOTAL SIZE (MB): DATA SIZE (MB): DATA PERCENTAGE OF TOTAL (%): INDEX SIZE (MB): INDEX PERCENTAGE OF TOTAL (%): LAST UPDATE TIME |
1
| exampledb9.a_table: MyISAM: 28906414: 3272.43531003: 3031.82567548: 92.6474: 204.63809450: 7.3526: 2008-05-22 11:59:42 |
.. (truncated)
1
| ----- END mySQL dbStat v1.1 Detail Report: exampledb9 ----- |
Tags:
dbStat,
mySQL,
php
No Comments »
Seems that dbStat had to be developed much faster than I realised, it _was_ a personal project that I was working on as I got time.
Now it has been completely re-written to provide a complete “break down” of a large mySQL database suffering some major iowait (on average 15%).
The database in question was 17GB in size with 63% of that data size being pure indexes … MAJOR headache.
After completion of v1.0 dbStat, and subsequent review of the output, we were able to reduce the Index size by 7GB (41% of Total).
So the datbase is siting at ~10gb (40% index), plenty more work to do, but by removing the problem causing indexes we have reduced the index overhead and stemmed a growth of ~380mb/24hrs
Rapid development has left a few bugs, currently dbStat is at v1.2 with a very buggy CSV export function, anyway more as the project progresses, it also raises a few questions about public release now due to it being laregly to resolve a business issue.
Hmm maybe I can get a testimonial! haha
EDIT: iowait is down to 2.28% now
No Comments »
I have been working on a script as of late to aid in the ever ongoing process of optimizing a web applications “back end”, inevitably the database, and underlying code.
Thus dbstat was born, the current version is not for release _just yet_ , as some tweaks are still needed, at the moment it only supports reporting for a single database at any one time.
v 0.5 Features list.
- Dynamic / Fixed row size checking. (Dynamic size rows can cause table fragmentation).
- MyISAM / InnoDBÂ checking (Reports total number of tables using these engines).
- Index threshold testing.
- Table fragmentation threshold testing.
- Table size threshold testing.
- Database size reporting.
At the moment this is currently written in PHP, and is quite heavily scripted I will be looking to move to C++ for a v1.0 for the release, for calculations sake and to remove the need to install PHP.
I will post more information as the project develops, I will be looking to release the program and source under GPL by version 1.
By version 1, I intend to have included the following:
- User interactive reporting. (On even of threshold being exceeded, prompt user to fix or skip, with cursory notes*)
- Table de-fragmentation.
- Reporting to include suggested fixes.
*Cursory notes to describe the fix, and possible implications of actioning it.
So watch this space, and please leave requests via comments
Tags:
database,
dbStat,
mySQL,
optimization,
tool.
1 Comment »