Viewing Graphs make MySQL errors

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
User avatar
Cramin
Posts: 23
Joined: Mon Mar 06, 2017 4:06 pm
Contact:

Viewing Graphs make MySQL errors

Post by Cramin »

I get errors when watching graphs.

Code: Select all

2017-05-06 18:22:22 - PHPSVR ERROR: Input Expected, Script Server Terminating
2017-05-06 18:22:22 - PHPSVR ERROR: Input Expected, Script Server Terminating
2017-05-06 18:22:22 - PHPSVR ERROR: Input Expected, Script Server Terminating
2017-05-06 18:22:22 - PHPSVR ERROR: Input Expected, Script Server Terminating
2017-05-06 18:22:22 - PHPSVR ERROR: Input Expected, Script Server Terminating
2017-05-06 18:22:22 - SPINE: Poller[1] FATAL: MySQL Error:'2006', Message:'MySQL server has gone away' [110, Connection timed out] (Spine thread)
2017-05-06 18:22:22 - SPINE: Poller[1] ERROR: SQL Failed! Error:'2013', Message:'Lost connection to MySQL server during query', SQL Fragment:'INSERT INTO poller_output_boost (local_data_id, rrd_name, time, output) VALUES (137,'traffic_in','2017-05-06 18:22:07','13226459366'),(137,'traffic_out','2017-05-06 18:22:07','143310481898'),(138,'traffic_in','2017-05-06 18:22:07','9262366711'),(138,'traffic_out','2017-05-06 18:22:07','2482364692850'),(139,'traffic_in','2017-05-06 18:22:07','15990545805'),(139,'traffic_out','2017-05-06 18:22:07','1952117663597'),(140,'traffic_in','2017-05-06 18:22:07','25529225915'),(140,'traffic_out','2017-05-06 18:22:07','6022509206823'),(141,'traffic_in','2017-05-06 18:22:07','12288353107'),(141,'traffic_out','2017-05-06 18:22:07','157039888772'),(142,'traffic_in','2017-05-06 18:22:07','12290248531'),(142,'traffic_out','2017-05-06 18:22:07','156427425298'),(143,'traffic_in','2017-05-06 18:22:07','17150297240'),(143,'traffic_out','2017-05-06 18:22:07','2442076768008'),(144,'traffic_in','2017-05-06 18:22:07','42104066378'),(144,'traffic_out','2017-05-06 18:22:07','13124110942147'),(145,'traffic_in','2017-05-06 18:22:07','70' 
Cacti Server - XEON 3075 2GB RAM - RAID1 2x WD Raptor 160GB - Ubuntu 16.04.2
MySQL Server - C2D E7300 2GB RAM - RAID5 3x WD 160GB - FREEBSD 10

Code: Select all

2017-05-06 18:27:22 - SYSTEM MIKROTIK STATS: Time:9.7600 Processes:10 Hosts:7 Interfaces:168 Queues:0 Users:0 Trees:0 Waps:0 Wreg:0
2017-05-06 18:27:12 - SYSTEM SYSLOG STATS:Time:0.02 Deletes:0 Incoming:0 Removes:0 XFers:0 Alerts:0 Alarms:0 Reports:0
2017-05-06 18:27:12 - SYSTEM THOLD STATS: Time:0.3254 Tholds:11 TotalDevices:20 DownDevices:1 NewDownDevices:0 
mysqltuner.pl

Code: Select all

root@database:~ # ./mysqltuner.pl
 >>  MySQLTuner 1.7.1 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering

[--] Skipped version check for MySQLTuner script
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password: [OK] Currently running supported MySQL version 10.1.22-MariaDB
[OK] Operating on 64-bit architecture

-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: /var/db/mysql/database.local.err(31K)
[OK] Log file /var/db/mysql/database.local.err exists
[OK] Log file /var/db/mysql/database.local.err is readable.
[OK] Log file /var/db/mysql/database.local.err is not empty
[OK] Log file /var/db/mysql/database.local.err is smaller than 32 Mb
[!!] /var/db/mysql/database.local.err contains 6 warning(s).
[OK] /var/db/mysql/database.local.err doesn't contain any error.
[--] 4 start(s) detected in /var/db/mysql/database.local.err
[--] 1) 2017-05-04 10:18:39 34422743040 [Note] /usr/local/libexec/mysqld: ready for connections.
[--] 2) 2017-04-24  8:56:26 34422743040 [Note] /usr/local/libexec/mysqld: ready for connections.
[--] 3) 2017-04-24  8:50:01 34422743040 [Note] /usr/local/libexec/mysqld: ready for connections.
[--] 4) 2017-04-19 17:26:32 34422743040 [Note] /usr/local/libexec/mysqld: ready for connections.
[--] 3 shutdown(s) detected in /var/db/mysql/database.local.err
[--] 1) 2017-05-04 10:18:36 35021250048 [Note] /usr/local/libexec/mysqld: Shutdown complete
[--] 2) 2017-04-24  8:55:48 34897341440 [Note] /usr/local/libexec/mysqld: Shutdown complete
[--] 3) 2017-04-24  8:49:52 34932857088 [Note] /usr/local/libexec/mysqld: Shutdown complete

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE
[--] Data in MyISAM tables: 615K (Tables: 24)
[--] Data in MEMORY tables: 1M (Tables: 6)
[--] Data in InnoDB tables: 1G (Tables: 114)
[OK] Total fragmented tables: 0

-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] There is no basic password file list!

-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined

-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 2d 8h 11m 48s (9M q [48.973 qps], 168K conn, TX: 4G, RX: 1G)
[--] Reads / Writes: 76% / 24%
[--] Binary logging is enabled (GTID MODE: OFF)
[--] Physical Memory     : 1.8G
[--] Max MySQL memory    : 1.5G
[--] Other process memory: 427.2M
[--] Total buffers: 568.0M global + 6.5M per thread (151 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 1.5G (83.18% of installed RAM)
[OK] Maximum possible memory usage: 1.5G (82.83% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (0/9M)
[!!] Highest connection usage: 100%  (152/151)
[OK] Aborted connections: 0.06%  (107/168574)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[!!] Query cache may be disabled by default due to mutex contention.
[OK] Query cache efficiency: 38.3% (4M cached / 11M selects)
[!!] Query cache prunes per day: 109
[OK] Sorts requiring temporary tables: 1% (546 temp sorts / 34K sorts)
[OK] No joins without indexes
[OK] Temporary tables created on disk: 9% (14K on disk / 149K total)
[OK] Thread cache hit rate: 65% (58K created / 168K connections)
[!!] Table cache hit rate: 1% (256 open / 14K opened)
[OK] Open file limit used: 0% (68/108K)
[OK] Table locks acquired immediately: 99% (4M immediate / 4M locks)
[OK] Binlog cache memory access: 100.00% (1590598 Memory / 1590598 Total)

-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
[--] Memory used by P_S: 0B
[--] Sys schema isn't installed.

-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 2 thread(s).
[--] Using default value is good enough for your version (10.1.22-MariaDB)

-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.3% (49M used / 268M cache)
[OK] Key buffer size / total MyISAM indexes: 256.0M/990.0K
[OK] Read Key buffer hit rate: 100.0% (6M cached / 549 reads)
[!!] Write Key buffer hit rate: 4.0% (2M cached / 93K writes)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[!!] InnoDB buffer pool / data size: 128.0M/1.4G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (75 %): 48.0M * 2/128.0M should be equal 25%
[!!] InnoDB buffer pool <= 1G and Innodb_buffer_pool_instances(!=1).
[--] InnoDB Buffer Pool Chunk Size not used or defined in your version
[OK] InnoDB Read buffer efficiency: 99.91% (209092918 hits/ 209273888 total)
[OK] InnoDB Write log efficiency: 92.43% (6716941 hits/ 7267136 total)
[!!] InnoDB log waits: 0.00% (10 waits / 550195 writes)

-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/1B
[!!] Aria pagecache hit rate: 81.2% (77K cached / 14K reads)

-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.

-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.

-------- RocksDB Metrics ---------------------------------------------------------------------------
[--] RocksDB is disabled.

-------- Spider Metrics ----------------------------------------------------------------------------
[--] Spider is disabled.

-------- Connect Metrics ---------------------------------------------------------------------------
[--] Connect is disabled.

-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.

-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] This is a standalone server.

-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
    Control warning line(s) into /var/db/mysql/database.local.err file
    Dedicate this server to your database for highest performance.
    Reduce or eliminate persistent connections to reduce connection usage
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    Increase table_open_cache gradually to avoid file descriptor limits
    Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
    Beware that open_files_limit (108081) variable
    should be greater than table_open_cache (256)
    Performance should be activated for better diagnostics
    Consider installing Sys schema from https://github.com/mysql/mysql-sys
Variables to adjust:
    max_connections (> 151)
    wait_timeout (< 28800)
    interactive_timeout (< 28800)
    query_cache_size (=0)
    query_cache_type (=0)
    query_cache_size (> 16M)
    table_open_cache (> 256)
    performance_schema = ON enable PFS
    innodb_buffer_pool_size (>= 1G) if possible.
    innodb_log_file_size * innodb_log_files_in_group should be equals to 1/4 of buffer pool size (=64M) if possible.
    innodb_buffer_pool_instances (=1)
    innodb_log_buffer_size (>= 16M)
my.cnf

Code: Select all

root@database:~ # cat /var/db/mysql/my.cnf
# The following options will be passed to all MariaDB clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# The MariaDB server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/db/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/db/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 256M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 64M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 48M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Viewing Graphs make MySQL errors

Post by Osiris »

Max connections? Disable binlog
Before history, there was a paradise, now dust.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest