I'm getting about 20 instances of the following message at the top of the MySQLTuner tab:

warning: Division by zero in /home/termbrok/public_html/sites/all/modules/dbtuner/dbtuner.mysqltuner.inc(84) : eval()'d code on line 1.

FYI I'm able to run MySQLTuner on my server with no issues.

Comments

mikeytown2’s picture

Version: 6.x-1.0-alpha2 » 6.x-1.x-dev

It's what happens when you have created your own perl to php converter...

Code in question

    // Function Replacement
    $parsedexpr = dbtuner_perl_to_php_func($parsedexpr);
    // Eval code
    eval('$compval = ' . $parsedexpr . ';');
    $parsedcomp = dbtuner_perl_to_php_comp($compval . $comp);
    eval('$condition = ' . $parsedcomp . ';');

Any chance I could get the input from you? Does that page still display info? if so could you paste it here?

Lloyd’s picture

If you're referring to the mysqltuner output, i've included that below. If it's something else let me know what you need. This is a fantastic module. Can't believe I just stumbled upon it. I was browsing on whether I should convert to Innodb and this popped up. If I do convert, going to be much, much easier. Thanks for another great addition.


Queries

Uptime in seconds: 37666
Uptime is less than 1 day, performance tuning may not be accurate
    (Uptime <86400)
    (37666 37666<86400)
Uptime: 10h 27m 46s
Questions: 374128
% slow queries: 0
slow query rate: 0 per day
Long query time: 10
long_query_time is set to 10 seconds or more. This may not be appropriate for your environment.
    (long_query_time >=10)
    (10 10>=10)
Slow query logging: OFF
Enable the slow query log to troubleshoot bad queries.
    ("log_slow_queries" eq 'OFF')
    ("OFF" OFF=== 'OFF')
% reads: 56.1330501389
% writes: 43.8669498611
qps: 9.93277757128
reads per sec: 1.28760567408 per day
writes per sec: 1.00624023469 per day
Queries: 9.93277757128 per second
Connections: 3 Thousand
Bytes sent: 2 Billion
Bytes received: 131 Million


versions

Supported Version: 5
Release Series: 5.0
version less then 5.1, upgrade!
    (substr("version",0,3) ne "5.1")
    (substr("5.0.91-community",0,3) '5.0' !== "5.1")
Minor Version: 91
Distribution: MySQL Community Edition (GPL)
Distribution: MySQL Community Edition (GPL)

MySQL Architecture: x86_64


Query cache

Query cache efficiency (%): 81.542239189
% query cache used: 33.6587587992
The query cache is not being fully utilized.
    (Qcache_free_memory / query_cache_size * 100 <80)
    (16941008 / 50331648 * 100 33.6587587992<80)
Query cache low memory prunes: 0 per day
Query cache size: 48.0 Mb
Query cache min result size: 1.0 Mb
The max size of the result set in the query cache is the default of 1 Mb. Changing this (usually by increasing) may increase efficiency.
    (&hr_bytes(query_cache_limit) eq "1.0 Mb")
    (dbtuner_hr_bytes(1048576) '1.0 Mb' === "1.0 Mb")


Sorts

Total sorts: 8622
% sorts that cause temporary tables: 0
rate of sorts that cause temporary tables: 0 per day
sort_buffer_size: 2.0 Mb
read_rnd_buffer_size: 256.0 Kb
Sort rows: 0 per day

Joins,scans

rate of joins without indexes: 0 per day
rate of reading first index entry: 0 per day
rate of reading fixed position: 0 per day
rate of reading next table row: 0 per day

temp tables

tmp_table_size-max_heap_table_size: 0
tmp_table_size: 40.0 Mb
max_heap_table_size: 40.0 Mb
% temp disk tables: 28.664580073
Too many temporary tables are being written to disk. Increase max_heap_table_size and tmp_table_size.
    (Created_tmp_disk_tables / (Created_tmp_tables + Created_tmp_disk_tables) * 100 >25)
    (2198 / (5470 + 2198) * 100 28.664580073>25)
temp disk rate: 0 per day
temp table rate: 0 per day


MyISAM index cache

MyISAM key buffer size: 32.0 Mb
max % MyISAM key buffer ever used: 12.6800537109
MyISAM key buffer (index cache) % used is low. You may need to decrease the size of key_buffer_size, re-examine your tables to see if indexes have been removed, or examine queries and expectations about what indexes are being used.
    ((Key_blocks_used)*key_cache_block_size/key_buffer_size * 100 <95)
    ((4155)*1024/33554432 * 100 12.6800537109<95)
% MyISAM key buffer used: 29.4830322266
MyISAM key buffer (index cache) % used is low. You may need to decrease the size of key_buffer_size, re-examine your tables to see if indexes have been removed, or examine queries and expectations about what indexes are being used.
    ((1-Key_blocks_unused*key_cache_block_size/key_buffer_size) * 100 <95)
    ((1-23107*1024/33554432) * 100 29.4830322266<95)
% index reads from memory: 99.1709983552


other caches

table open cache size (5.1+): table_open_cache
Size of the table cache
    (table_open_cache >-1)
    (table_open_cache table_open_cache>-1)
rate of table open: 0 per day
% open files: 28.3333333333
rate of open files: 0 per day
Immediate table locks %: 99.8100239792
Table lock wait rate: 0 per day
thread cache: 4
Total threads created: 149
thread cache hit rate %: 0.0394597457627
Threads that are slow to launch: 0
Slow launch time: 2


Connections

% connections used: 34
Max connections used: 17
Max connections limit: 50
% aborted connections: 14.4862288136
Too many connections are aborted, meaning they cannot be authorized.
    (Aborted_connects/Connections * 100 >5)
    (547/3776 * 100 14.4862288136>5)
rate of aborted connections: 0 per day
% aborted clients: 0.238347457627
rate of aborted clients: 0 per day


InnoDB

Is InnoDB enabled?: DISABLED
You do not have InnoDB enabled
    ("have_innodb" ne "YES")
    ("DISABLED" DISABLED!== "YES")
% innoDB log size: 62.5
InnoDB log file size is not an appropriate size, in relation to the InnoDB buffer pool. Consider changing either\ninnodb_log_file_size or innodb_buffer_pool_size
    (innodb_log_file_size / innodb_buffer_pool_size * 100 >=0)
    (5242880 / 8388608 * 100 62.5>=0)


other

MyISAM concurrent inserts: 1

INSERT DELAYED USAGE


Delayed_errors 0


Delayed_insert_threads 0


Delayed_writes 0


Not_flushed_delayed_rows
meatbag’s picture

I'm getting these messages as well. And i don't use any perl to php converter.

mikeytown2’s picture

@meatbag
I created a small perl to php converter for this module. If you use this module; you have used the converter.

I think the best solution is to ditch the rules from the perl script and go 100% php #931634: DB Tuning disclaimer and/or make tuner configuration more specific to Drupal's usage of MySQL.