Author Topic: Mysql my.cnf  (Read 9284 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Mysql my.cnf
« on: December 07, 2017, 03:23:30 PM »
2 GB Ram,2 Cpu openvz vps I use.
Using 1.5 gb ram

[PID] [MEM] [PATH]
31022 4.6 mysql1
26730 0.3 root1
27148 0.3 root1
27155 0.3 root1
27158 0.3 root1
27160 0.3 root1
27165 0.3 root1
27680 0.2 root1
28895 0.2 root1
3074 0.2 nobody1
570 0.2 root1
592 0.2 named1
944 0.2 root1
960 0.2 root1
974 0.2 nobody1
1071 0.1 nobody1
26541 0.1 postfix1
27690 0.1 root1
28899 0.1 root1

Mysqltuner:
-------- Recommendations -------------------------------------------------------                                       --------------------
General recommendations:
    Control warning line(s) into /var/lib/mysql/server.net.err fil                                       e
    Control error line(s) into /var/lib/mysql/server.net.err file
    MySQL started within last 24 hours - recommendations may be inaccurate
    Configure your accounts with ip or subnets only, then update your configurat                                       ion with skip-name-resolve=1
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries which have no LIMIT clause
    Set thread_cache_size to 4 as a starting value
    Performance should be activated for better diagnostics
    Consider installing Sys schema from https://github.com/mysql/mysql-sys
    Read this before changing innodb_log_file_size and/or innodb_log_files_in_gr                                       oup: http://bit.ly/2wgkDvS
Variables to adjust:
    query_cache_size (=0)
    query_cache_type (=0)
    query_cache_limit (> 1M, or use smaller result sets)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    thread_cache_size (start at 4)
    performance_schema = ON enable PFS
    innodb_log_file_size should be (=16M) if possible, so InnoDB total log files                                        size equals to 25% of buffer pool size.
    innodb_buffer_pool_instances (=1)

I added them. my.cnf . I added them. This time it gives an error.

Code: [Select]
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
 query_cache_size (=0)
    query_cache_type (=0)
    query_cache_limit (> 1M)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    thread_cache_size (4)
    performance_schema = ON
    innodb_log_file_size should be (=16M)
    innodb_buffer_pool_instances (=1)


Offline
***
Re: Mysql my.cnf
« Reply #1 on: December 07, 2017, 03:33:29 PM »
You need to add query_cache_size (=0) as query_cache_size =0. SO it will look like

[mysqld]
 query_cache_size =0


Adjust the other variables same like this.