Done 'high' for 'apache optimize' in 'webserver config'. But it is still happening.
Is this happening because server has only 2 GB RAM ?
Memory is enough but need optimize mysql. Usually using mysqltuner.
Install mysqltuner and run the command - 'perl mysqltuner.pl'. Below is the output -
[root@server1 ~]# perl mysqltuner.pl
>> MySQLTuner 1.6.13 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: hoxxinxxxxx---
Please enter your MySQL administrative password:
[--] Skipped version check for MySQLTuner script
[!!] failed to execute: SHOW SLAVE STATUS\G
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW SLAVE HOSTS
[!!] FAIL Execute SQL / return code: 256
[OK] Currently running supported MySQL version 10.0.25-MariaDB
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE _SCHEMA
[--] Data in InnoDB tables: 5G (Tables: 1790)
[!!] Total fragmented tables: 1
-------- Security Recommendations ------------------------------------------------------------------
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE TRIM(USER) = '' OR USER IS NULL
[!!] FAIL Execute SQL / return code: 256
[OK] There are no anonymous accounts for any database users
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE (password = '' OR password IS N ULL) AND plugin NOT IN ('unix_socket', 'win_socket')
[!!] FAIL Execute SQL / return code: 256
[OK] All database users have passwords assigned
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE CAST(password as Binary) = PASS WORD(user) OR CAST(password as Binary) = PASSWORD(UPPER(user)) OR CAST(password as Binary) = PASSWORD(UPPER( LEFT(User, 1)) + SUBSTRING(User, 2, LENGTH(User)))
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SELECT CONCAT(user, '@', host) FROM mysql.user WHERE HOST='%'
[!!] FAIL Execute SQL / return code: 256
[!!] There is no basic password file list!
-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined
[!!] failed to execute: SHOW ENGINE PERFORMANCE_SCHEMA STATUS
[!!] FAIL Execute SQL / return code: 256
[!!] failed to execute: SHOW ENGINE PERFORMANCE_SCHEMA STATUS
[!!] FAIL Execute SQL / return code: 256
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 16h 46m 22s (2M q [35.049 qps], 18K conn, TX: 10G, RX: 2G)
[--] Reads / Writes: 95% / 5%
[--] Binary logging is disabled
[--] Physical Memory : 990.6M
[--] Max MySQL memory : 836.0M
[--] Other process memory: 562.2M
[--] Total buffers: 416.0M global + 2.8M per thread (151 max threads)
[!!] failed to execute: SHOW ENGINE PERFORMANCE_SCHEMA STATUS
[!!] FAIL Execute SQL / return code: 256
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 454.9M (45.92% of installed RAM)
[OK] Maximum possible memory usage: 836.0M (84.39% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (25/2M)
[OK] Highest usage of available connections: 9% (14/151)
[OK] Aborted connections: 1.87% (338/18047)
[!!] 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] Sorts requiring temporary tables: 0% (0 temp sorts / 1M sorts)
[OK] No joins without indexes
[OK] Temporary tables created on disk: 6% (531 on disk / 8K total)
[!!] Table cache hit rate: 2% (399 open / 19K opened)
[OK] Open file limit used: 0% (5/20K)
[OK] Table locks acquired immediately: 99% (2M immediate / 2M locks)
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 1 thread(s).
[--] Using default value is good enough for your version (10.0.25-MariaDB)
-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is enabled.
[!!] failed to execute: SHOW ENGINE PERFORMANCE_SCHEMA STATUS
[!!] FAIL Execute SQL / return code: 256
[--] Memory used by P_S: 0B
[--] Sys schema isn't installed.
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.2% (24M used / 134M cache)
[!!] Cannot calculate MyISAM index size - re-run script as root user
-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/1B
[OK] Aria pagecache hit rate: 99.7% (77K cached / 244 reads)
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[!!] InnoDB buffer pool / data size: 128.0M/5.2G
[!!] InnoDB buffer pool <= 1G and innodb_buffer_pool_instances(!=1).
[OK] InnoDB Used buffer: 87.50% (7167 used/ 8191 total)
[OK] InnoDB Read buffer efficiency: 93.07% (263036560 hits/ 282631949 total)
[OK] InnoDB Write log efficiency: 99.96% (599060211 hits/ 599304638 total)
[!!] InnoDB log waits: 0.01% (19 waits / 244427 writes)
-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB 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:
Run OPTIMIZE TABLE to defragment tables for better performance
OPTIMIZE TABLE hostingultraso1_hostingultraso.cache_form; -- can free 178 MB
Total freed space after theses OPTIMIZE TABLE : 178 Mb
MySQL started within last 24 hours - recommendations may be inaccurate
Dedicated this server to your database for highest performance.
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 (20480) variable
should be greater than table_open_cache ( 400)
Variables to adjust:
query_cache_type (=0)
table_open_cache (> 400)
innodb_buffer_pool_size (>= 5G) if possible.
innodb_buffer_pool_instances (=1)
innodb_log_buffer_size (>= 8M)
[root@server1 ~]#