Get the most out of your Centmin Mod LEMP stack
Become a Member

Optimizing my install?

Discussion in 'System Administration' started by Oxide, Jan 21, 2016.

  1. Oxide

    Oxide Active Member

    534
    29
    28
    Mar 19, 2015
    Ratings:
    +59
    Local Time:
    5:01 AM
    So basically, i feel my centminmod install isn't optimized enough.. I already use memcached, zendopcache etc however it still takes some time to load the front index of my forum (300-500ms).

    Here is my server:
    [​IMG]



    Here is my mariadb my.cnf file, anything I should increase & to what:
    Code:
    [mysqld]
    local-infile=0
    ignore-db-dir=lost+found
    #character-set-server=utf8
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    
    #bind-address=127.0.0.1
    # optimized my.cnf for MariaDB 5.5.x
    # by eva2000
    # vbtechsupport.com
    
    tmpdir=/home/mysqltmp
    
    innodb=ON
    #skip-federated
    #skip-pbxt
    #skip-pbxt_statistics
    #skip-archive
    #skip-name-resolve
    #old_passwords
    back_log = 75
    max_connections = 300
    key_buffer_size = 32M
    myisam_sort_buffer_size = 32M
    myisam_max_sort_file_size = 2048M
    join_buffer_size = 128K
    read_buffer_size = 128K
    sort_buffer_size = 256K
    table_definition_cache = 4096
    table_open_cache = 2048
    thread_cache_size = 128
    wait_timeout = 120
    connect_timeout = 10
    tmp_table_size = 32M
    max_heap_table_size = 32M
    max_allowed_packet = 32M
    max_seeks_for_key = 1000
    group_concat_max_len = 1024
    max_length_for_sort_data = 1024
    net_buffer_length = 16384
    max_connect_errors = 100000
    concurrent_insert = 2
    read_rnd_buffer_size = 256K
    bulk_insert_buffer_size = 8M
    query_cache_limit = 1M
    query_cache_size = 1000M
    query_cache_type = 1
    query_cache_min_res_unit = 2K
    query_prealloc_size = 262144
    query_alloc_block_size = 65536
    transaction_alloc_block_size = 8192
    transaction_prealloc_size = 4096
    default-storage-engine = InnoDB
    
    log_warnings=1
    slow_query_log=0
    long_query_time=1
    slow_query_log_file=/var/lib/mysql/slowq.log
    log-error=/var/log/mysqld.log
    
    # innodb settings
    innodb_large_prefix=1
    innodb_purge_threads=1
    innodb_file_format = Barracuda
    innodb_file_per_table = 1
    innodb_open_files = 1000
    innodb_data_file_path= ibdata1:10M:autoextend
    innodb_buffer_pool_size = 48M
    
    ## https://mariadb.com/kb/en/mariadb/xtradbinnodb-server-system-variables/#innodb_buffer_pool_instances
    #innodb_buffer_pool_instances=2
    
    innodb_log_files_in_group = 2
    innodb_log_file_size = 128M
    innodb_log_buffer_size = 8M
    innodb_flush_log_at_trx_commit = 2
    innodb_thread_concurrency = 0
    innodb_lock_wait_timeout=50
    innodb_flush_method = O_DIRECT
    innodb_support_xa=1
    
    # 200 * # DISKS
    innodb_io_capacity = 100
    innodb_read_io_threads = 2
    innodb_write_io_threads = 2
    
    # mariadb settings
    [mariadb]
    #thread-handling = pool-of-threads
    #thread-pool-size= 20
    #mysql --port=3307 --protocol=tcp
    #extra-port=3307
    #extra-max-connections=1
    
    userstat = 0
    key_cache_segments = 1
    aria_group_commit = none
    aria_group_commit_interval = 0
    aria_log_file_size = 32M
    aria_log_purge_type = immediate
    aria_pagecache_buffer_size = 8M
    aria_sort_buffer_size = 8M
    
    [mariadb-5.5]
    #ignore_db_dirs=
    query_cache_strip_comments=0
    
    innodb_read_ahead = linear
    innodb_adaptive_flushing_method = estimate
    innodb_flush_neighbor_pages = 1
    innodb_stats_update_need_lock = 0
    innodb_log_block_size = 512
    
    log_slow_filter =admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
    
    [mysqld_safe]
    socket=/var/lib/mysql/mysql.sock
    log-error=/var/log/mysqld.log
    #nice = -5
    open-files-limit = 8192
    
    [mysqldump]
    quick
    max_allowed_packet = 32M
    
    [myisamchk]
    tmpdir=/home/mysqltmp
    key_buffer = 32M
    sort_buffer = 16M
    read_buffer = 16M
    write_buffer = 16M
    
    [mysqlhotcopy]
    interactive-timeout
    
    [mariadb-10.0]
    # 2 variables needed to switch from XtraDB to InnoDB plugins
    #plugin-load=ha_innodb
    #ignore_builtin_innodb
    
    ## MariaDB 10 only save and restore buffer pool pages
    ## warm up InnoDB buffer pool on server restarts
    innodb_buffer_pool_dump_at_shutdown=1
    innodb_buffer_pool_load_at_startup=1
    innodb_buffer_pool_populate=0
    ## Disabled settings
    performance_schema=OFF
    innodb_stats_on_metadata=OFF
    innodb_sort_buffer_size=2M
    innodb_online_alter_log_max_size=128M
    query_cache_strip_comments=0
    log_slow_filter =admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk



    MySQL Tuner:
    Code:
    >>  MySQLTuner 1.6.2 - 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
    [OK] Currently running supported MySQL version 10.0.23-MariaDB
    [OK] Operating on 64-bit architecture
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MRG_MyISAM
    [--] Data in MyISAM tables: 81M (Tables: 504)
    [--] Data in InnoDB tables: 24M (Tables: 214)
    [!!] Total fragmented tables: 23
    
    -------- 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: 32d 1h 51m 49s (77M q [27.988 qps], 22M conn, TX: 73B, RX: 9B)
    [--] Reads / Writes: 68% / 32%
    [--] Binary logging is disabled
    [--] Total buffers: 1.1G global + 1.0M per thread (300 max threads)
    [OK] Maximum reached memory usage: 1.1G (3.60% of installed RAM)
    [OK] Maximum possible memory usage: 1.4G (4.51% of installed RAM)
    [OK] Slow queries: 0% (101/77M)
    [OK] Highest usage of available connections: 6% (18/300)
    [OK] Aborted connections: 0.00%  (36/22244761)
    [OK] Query cache efficiency: 44.6% (29M cached / 66M selects)
    [OK] Query cache prunes per day: 0
    [OK] Sorts requiring temporary tables: 0% (30 temp sorts / 588K sorts)
    [!!] Joins performed without indexes: 36140
    [!!] Temporary tables created on disk: 53% (165K on disk / 310K total)
    [OK] Thread cache hit rate: 99% (19 created / 22M connections)
    [OK] Table cache hit rate: 46% (1K open / 3K opened)
    [OK] Open file limit used: 19% (1K/8K)
    [OK] Table locks acquired immediately: 99% (24M immediate / 24M locks)
    
    -------- MyISAM Metrics -----------------------------------------------------
    [!!] Key buffer used: 25.5% (8M used / 33M cache)
    [OK] Key buffer size / total MyISAM indexes: 32.0M/6.6M
    [OK] Read Key buffer hit rate: 100.0% (92M cached / 10K reads)
    [!!] Write Key buffer hit rate: 64.7% (5M cached / 1M writes)
    
    -------- InnoDB Metrics -----------------------------------------------------
    [--] InnoDB is enabled.
    [OK] InnoDB buffer pool / data size: 48.0M/24.2M
    [!!] InnoDB buffer pool <= 1G and innodb_buffer_pool_instances(!=1).
    [!!] InnoDB Used buffer: 66.66% (2047 used/ 3071 total)
    [OK] InnoDB Read buffer efficiency: 99.85% (144185324 hits/ 144402840 total)
    [!!] InnoDB Write buffer efficiency: 0.00% (0 hits/ 1 total)
    [OK] InnoDB log waits: 0.00% (0 waits / 1033738 writes)
    
    -------- AriaDB Metrics -----------------------------------------------------
    [--] AriaDB is disabled.
    
    -------- Replication Metrics -------------------------------------------------
    [--] No replication slave(s) for this server.
    [--] This is a standalone server..
    
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Adjust your join queries to always utilize indexes
        When making adjustments, make tmp_table_size/max_heap_table_size equal
        Reduce your SELECT DISTINCT queries which have no LIMIT clause
    Variables to adjust:
        join_buffer_size (> 128.0K, or always use indexes with joins)
        tmp_table_size (> 32M)
        max_heap_table_size (> 32M)
        innodb_buffer_pool_instances (=1)
    
     
    Last edited: Jan 21, 2016
  2. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    5:01 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    With that said, also check out discussion in thread at Optimising wait times | Centmin Mod Community as there's many many factors that effect page load times
     
  3. Oxide

    Oxide Active Member

    534
    29
    28
    Mar 19, 2015
    Ratings:
    +59
    Local Time:
    5:01 AM
    yep i cant afford $150/hr for help :/ lol
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    5:01 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. Oxide

    Oxide Active Member

    534
    29
    28
    Mar 19, 2015
    Ratings:
    +59
    Local Time:
    5:01 AM
    Yes, I am using CloudFlare.

    I am using my own browser, comparing another site also running CloudFlare and same forum software.

    Check website perfomance and response: Check host - online website monitoring, Check IP
    PageSpeed Insights
    WebPagetest Test Result - Dulles : pscentral.net/ - 01/20/16 18:20:31
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    5:01 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ouch at 3.13MB = 3209KB sized page no wonder.. !

    upload_2016-1-21_4-37-20.png

    cut page size to <400-900KB and it will be much faster !
     
  7. Oxide

    Oxide Active Member

    534
    29
    28
    Mar 19, 2015
    Ratings:
    +59
    Local Time:
    5:01 AM
    Yeah, no idea how to do that. I guess IPS is heavy, and always been? :p

    I am talking about the first page load, you are too?

    [​IMG]
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    5:01 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    chrome dev tools is geographically relative to your location and server/site location + your ISP net connection speed.. you must have a fast ISP connection to download 3+ MB in less than 920ms ? if you throttle connection to 5Mbps or abouts see what times you get

    use webpagetest.org for your tests on various connection speed, browser and country/city test servers

    but ultimately 3.3MB sized pages is way too large ! aim for <900KB if possible

    majority is image sizes
     
    Last edited: Jan 21, 2016
  9. Oxide

    Oxide Active Member

    534
    29
    28
    Mar 19, 2015
    Ratings:
    +59
    Local Time:
    5:01 AM
    Right.

    Image sizes, however after the first page load they get cached right? The thing I am thinking about, is the first page load (the PHP file / document it self) takes 300-500ms just that, then all that other stuff..
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    5:01 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  11. Ahmad

    Ahmad Active Member

    209
    80
    28
    Apr 13, 2015
    Ratings:
    +150
    Local Time:
    8:01 PM
    1.9.9
    10.1.10
    Yep, it's your custom theme, switch to the default IPS theme and you'll notice a difference I guess.
     
  12. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    3:01 PM
    Just thinking... it would be great to have a page in the resources area which lists all the different testing sites out there. I have a bunch of them bookmarked, but having a list for users might be a good resource. :)