1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help tweaking server

Discussion in 'Server Configuration and Hosting' started by Rob, Apr 4, 2012.

  1. Rob

    Rob Well-Known Member

    I've recently migrated to xenforo from vbulletin and expected page loads to be quicker under xenforo but that doesnt seem to be the case at the moment, despite me now using a CDN with xenforo.

    I would like help tweaking and maximising performance of my server (VPS). I have shell access and can provide any information but thats where I'm stuck - Server config is definitly not my strong point.

    Is anyone prepared to help me? What info do you need?

    Thank you for your help
     
  2. Adam Howard

    Adam Howard Well-Known Member

    If you're using Debian or Ubuntu I can help you very easily.

    But before we get started do a ping test to your Dedicated Server or VPS Server. Make sure that its not a host issues that is making your site seem slow. IF things ping well and resolve well.... Let's move on....

    First lets see what is using up so much resources.

    apt-get install aptitude

    aptitude install htop

    top (make a screen copy from here)
    htop (make a screen copy from here)

    This will get me a basic understanding of what processes your using.

    I also need to know the basic of your setup... ie.... Ram, cpu, apache version, php version, and mysql version. I would suggest 5.3.10 for php and mysql 5.5 or 5.6
     
  3. Ghan_04

    Ghan_04 Active Member

    I can help if you're running either Red Hat or CentOS - those are the distros I usually use. In either case, if you are using Apache, you might want to consider switching to Nginx or Litespeed, both of which generally have better performance.
     
  4. Rob

    Rob Well-Known Member

    I'm using apache on CentOS.... I will get you the other info's very soon. Thank you!
     
    TheVisitors likes this.
  5. Rob

    Rob Well-Known Member

    This is the ping response (using http://www.webwiz.co.uk/domain-tools/ping.htm )

    And from my own machine (UK):-
     
  6. Ghan_04

    Ghan_04 Active Member

    It would be helpful to know the hardware specs on the server as well. Mainly the RAM will be most important here. Also your traffic levels are good to know to get a better idea of what might need to be tweaked and how much room you have to work with.
     
  7. wickedstangs

    wickedstangs Well-Known Member

    I would like help too... VPS server
    ping.JPG

    whm.JPG
     
  8. Adam Howard

    Adam Howard Well-Known Member

  9. Ghan_04

    Ghan_04 Active Member

    wickedstangs, PM me or start your own thread and I can help you. :)

    Rob, where is your VPS hosted right now?
     
  10. Adam Howard

    Adam Howard Well-Known Member

  11. wickedstangs

    wickedstangs Well-Known Member

    RAM 960MB
    FEB 2, 2012-MAR 3, 2012
    monthly.JPG
     
  12. Rob

    Rob Well-Known Member

    Server Specs:-

    OS: Cent OS
    CPU: GenuineIntel, Intel(R) Xeon(R)CPU E5606 @ 2.13GHz
    Memory: 2.0 GB (817.2 MB free)
    Apache: 2.2.3
    Mysql: 5.0.95
    PHP: 5.2.10


    Am working on the aptitude info now
     
  13. Ghan_04

    Ghan_04 Active Member

    Is the server completely unmanaged? Does it have cPanel installed?
     
  14. Adam Howard

    Adam Howard Well-Known Member

    Backup and edit mysql server's /etc/my.cnf and place the following mysql server settings in /etc/my.cnf and restart mysql server afterwards. Make sure to restart mysql server everytime you make changes to your my.cnf for the changes to take effect.

    If mysql doesn't restart properly after my.cnf changes make sure skip-innodb entry is removed or commented out from below my.cnf

    Code:
    [client]
    port = 3306
    socket = /var/run/mysqld/mysqld.sock
    
    [mysqld]
    bind-address = 127.0.0.1
    user = mysql
    pid-file = /var/run/mysqld/mysqld.pid
    socket = /var/run/mysqld/mysqld.sock
    port = 3306
    basedir = /usr
    datadir = /var/lib/mysql
    tmpdir = /tmp
    lc-messages-dir = /usr/share/mysql
    skip-external-locking
    
    #skip-name-resolve
    #old_passwords
    back_log = 50
    #skip-innodb
    max_connections = 250
    key_buffer_size = 32M
    myisam_sort_buffer_size = 64M
    myisam_max_sort_file_size = 1048M
    join_buffer_size = 256K
    read_buffer_size = 256K
    sort_buffer_size = 256K
    table_definition_cache = 8000
    table_open_cache = 8000
    thread_cache_size = 256
    wait_timeout = 90
    interactive_timeout = 60
    connect_timeout = 10
    tmp_table_size = 64M
    max_heap_table_size = 64M
    max_allowed_packet = 64M
    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 = 512K
    query_cache_size = 48M
    query_cache_type = 1
    query_prealloc_size = 262144
    query_alloc_block_size = 65536
    range_alloc_block_size = 4096
    transaction_alloc_block_size = 8192
    transaction_prealloc_size = 4096
    default-storage-engine = MyISAM
    max_write_lock_count = 8
    
    innodb_open_files = 500
    innodb_data_file_path= ibdata1:10M:autoextend
    innodb_buffer_pool_size = 256M
    innodb_additional_mem_pool_size = 32M
    
    innodb_log_files_in_group = 2
    innodb_log_file_size = 5M
    innodb_log_buffer_size = 8M
    innodb_flush_log_at_trx_commit = 2
    innodb_thread_concurrency = 8
    innodb_flush_method = O_DIRECT
    
    slow_query_log=0
    long_query_time=1
    slow_query_log_file=/var/lib/mysql/slowq.log
    
    [mysqld_safe]
    socket = /var/run/mysqld/mysqld.sock
    nice = -5
    open-files-limit = 8192
    
    [mysqldump]
    quick
    max_allowed_packet = 64M
    
    [myisamchk]
    key_buffer_size = 32M
    sort_buffer_size = 1M
    read_buffer_size = 1M
    write_buffer_size = 1M
    
    [mysqlhotcopy]
    interactive-timeout 
    Try install php5-apc (if it's not already installed with cPanel)


    For your config.php

    Code:
    ## Caching
    
    #  http://xenforo.com/community/threads/speed-up-your-board-caching.5699/
    
    #  http://xenforo.com/community/threads/tip-use-apc.6456/
    
    $config['cache']['frontend'] = 'Core';
    
    $config['cache']['frontendOptions'] = array(
    
                                            'caching'                      => true,
    
                                            'automatic_serialization'      => true,
    
                                            'lifetime'                      => 10800,
    
                                            'cache_id_prefix' => 'xf'
    
    );
    
    $config['cache']['backend'] = 'Apc';
     
  15. Rob

    Rob Well-Known Member

    Traffic.... March 4th - April 3rd:-
    94,736 people visited this site
    220,726 Visits
    94,736 Unique Visitors
    1,580,382 Pageviews
     
  16. Rob

    Rob Well-Known Member

    Oh god.... this is confusing.. Why have you hijacked my thread? Cant you maybe have started you own?


    It has plesk running.
     
  17. Adam Howard

    Adam Howard Well-Known Member

    Upgrade Apache and PhP (if you have no control panel)

    Backup and edit mysql server's /etc/my.cnf and place the following mysql server settings in /etc/my.cnf and restart mysql server afterwards. Make sure to restart mysql server everytime you make changes to your my.cnf for the changes to take effect.

    If mysql doesn't restart properly after my.cnf changes make sure skip-innodb entry is removed or commented out from below my.cnf

    Code:
    [client]
    port = 3306
    socket = /var/run/mysqld/mysqld.sock
    
    [mysqld]
    bind-address = 127.0.0.1
    user = mysql
    pid-file = /var/run/mysqld/mysqld.pid
    socket = /var/run/mysqld/mysqld.sock
    port = 3306
    basedir = /usr
    datadir = /var/lib/mysql
    tmpdir = /tmp
    lc-messages-dir = /usr/share/mysql
    skip-external-locking
    
    #skip-name-resolve
    #old_passwords
    back_log = 50
    #skip-innodb
    max_connections = 250
    key_buffer_size = 32M
    myisam_sort_buffer_size = 64M
    myisam_max_sort_file_size = 2048M
    join_buffer_size = 256K
    read_buffer_size = 256K
    sort_buffer_size = 256K
    table_definition_cache = 8000
    table_open_cache = 8000
    thread_cache_size = 256
    wait_timeout = 90
    interactive_timeout = 60
    connect_timeout = 10
    tmp_table_size = 64M
    max_heap_table_size = 64M
    max_allowed_packet = 64M
    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 = 512K
    query_cache_size = 48M
    query_cache_type = 1
    query_prealloc_size = 262144
    query_alloc_block_size = 65536
    range_alloc_block_size = 4096
    transaction_alloc_block_size = 8192
    transaction_prealloc_size = 4096
    default-storage-engine = MyISAM
    max_write_lock_count = 8
    
    innodb_open_files = 500
    innodb_data_file_path= ibdata1:10M:autoextend
    innodb_buffer_pool_size = 256M
    innodb_additional_mem_pool_size = 32M
    
    innodb_log_files_in_group = 2
    innodb_log_file_size = 5M
    innodb_log_buffer_size = 8M
    innodb_flush_log_at_trx_commit = 2
    innodb_thread_concurrency = 8
    innodb_flush_method = O_DIRECT
    
    slow_query_log=0
    long_query_time=1
    slow_query_log_file=/var/lib/mysql/slowq.log
    
    [mysqld_safe]
    socket = /var/run/mysqld/mysqld.sock
    nice = -5
    open-files-limit = 8192
    
    [mysqldump]
    quick
    max_allowed_packet = 64M
    
    [myisamchk]
    key_buffer_size = 32M
    sort_buffer_size = 1M
    read_buffer_size = 1M
    write_buffer_size = 1M
    
    [mysqlhotcopy]
    interactive-timeout 
    
    Try install php5-apc (if it's not already installed)

    For your config.php

    Code:
    ## Caching
    
    #  http://xenforo.com/community/threads/speed-up-your-board-caching.5699/
    
    #  http://xenforo.com/community/threads/tip-use-apc.6456/
    
    $config['cache']['frontend'] = 'Core';
    
    $config['cache']['frontendOptions'] = array(
    
                                            'caching'                      => true,
    
                                            'automatic_serialization'      => true,
    
                                            'lifetime'                      => 10800,
    
                                            'cache_id_prefix' => 'xf'
    
    );
    
    $config['cache']['backend'] = 'Apc';
     
  18. Adam Howard

    Adam Howard Well-Known Member

    Sorry, just noticed someone did hijack it.

    Will be steping out now
     
  19. Rob

    Rob Well-Known Member

    This is not a host issue... my host is very well respected. The issues here are mine since its an unmanaged server and I need to manage it.. lol
     
  20. craigiri

    craigiri Well-Known Member

    I got a noticeable speed bump by turning off apache logging. If you use goog analytics, you probably don't need logging on the server. Keep in mind logging has to write a lot of information to a file for every page and image loaded.

    Most of the other stuff is a balancing act between apache and mysql. You seem to have too much free RAM - that will get used up if you increase certain of the mysql and apache settings. The idea is to use the RAM...or at least most of it.
     
    TheVisitors likes this.

Share This Page