Results 1 to 4 of 4

Thread: reducing lag?

  1. #1
    Join Date
    Aug 2002
    Location
    Canada!
    Posts
    159

    reducing lag?

    I run a moderately sized forum and I've noticed that some of our threads (which are 300-400pages long) take a longer time to load. It may be affecting the VPS as a whole as well, I was looking through "top -c" and found one MySql process had been running for about 5 hours.

    I don't know if it's the huge threads that cause it but sometimes it takes a second or two to just load a page. I've been getting random timeouts as well but they're not so frequent.

    Is there anyway to reduce lag on my server?

    httpd.conf

    Timeout 35
    KeepAlive On
    MaxKeepAliveRequests 120
    KeepAliveTimeout 3
    MinSpareServers 2
    MaxSpareServers 5
    StartServers 3
    MaxClients 150
    MaxRequestsPerChild 30
    edit: I also have mod_evasive installed and running, would that be a cause for lag?

    Thanks!

  2. #2
    Join Date
    Jul 2000
    Location
    Colorado Springs, CO
    Posts
    2,280
    mod_evasive isnt going to be affecting your large forum page requests like that. It sounds to me that the software isnt as effecient as it should be. It shouldnt be pulling the data for all the posts in the thread, just counting them to generate a page count. Are you running vbulletin?

    I dont think adjusting any of the settings you have listed there are going to help on this specific issue. But a good set for those numbers we often recommend, start with the mysql settings. Pulled from the guide here on wht.

    Optimizing your server for efficiency

    *** MySQL Optimization***
    This will help you to understand how it is possible to optimize MYSQL to fit your needs, hardaware , and mysql current usage.

    Here are suggested settings for the my.cnf file. on a server 256mb + ram. You can and should customize these settings specifically for your VPS's usage. . DO NOT change your setting without understanding what it does. Make a backup of your my.cnf before editing the /etc/my.cnf .

    [mysqld]
    max_connections = 400
    key_buffer = 64M
    join_buffer_size = 1M
    read_buffer_size = 1M
    sort_buffer_size = 2M
    table_cache = 1024
    thread_cache_size = 286
    interactive_timeout = 25
    wait_timeout = 1000
    connect_timeout = 10
    max_heap_table_size = 128M
    max_allowed_packet = 16M
    max_connect_errors = 10
    read_rnd_buffer_size = 524288
    query_cache_limit = 1M
    query_cache_size = 16M
    query_cache_type = 1
    query_prealloc_size = 163840
    tmp_table_size = 32M
    myisam_sort_buffer_size = 32M
    query_alloc_block_size = 32768
    bulk_insert_buffer_size = 16M
    skip-innodb

    [mysqld_safe]
    open_files_limit = 8192

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [myisamchk]
    key_buffer = 32M
    sort_buffer = 32M
    read_buffer = 16M
    write_buffer = 16M

    [mysqlhotcopy]
    interactive-timeout


    ***PHP & Apache Optimization***

    For httpd.conf we suggest:
    Timeout 200
    KeepAlive On
    maxKeepAliveRequests 100
    KeepAliveTimeout 3
    MinSpareServers 10
    MaxSpareServers 20
    StartServers 15
    MaxClients 250
    MaxRequestsPerChild 0
    HostnameLookups Off

    You can use ab to benchmark your Apache before and after you make changes.

    ab -c 5 -n 20 some_php_site_on_your_server.com/file.php

    I suggest doing 2 or 3 tests like that to get an average.

    If you want to check the Apache error log, try this -->
    cat /usr/local/apache/logs/error_log

    You can find the amount of connections to Apache with this command:
    netstat -nt | grep :80 | wc -l

    To find the amount of Apache processes use this command:
    ps -A | grep httpd | wc -l (this will show the process count)
    ps -aux | grep httpd (this will show the actual processes)

    To find the amount of MySQL processes use this command:
    ps -A | grep mysql | wc -l (this will show the process count)
    ps -aux | grep mysql (this will show the actual processes)
    Greg Landis | Founder Jaguarpc - Keeping websites happy since 1998
    Managed IT Solutions - Business hosting | Virtual Private Servers | Cloud VPS Hosting | Dedicated servers | Backup service
    Follow us @ Facebook.com/Jaguarpc | Twitter: @JaguarPC | (888)-338-5261 | sales @ jaguarpc.com

  3. #3
    Join Date
    May 2003
    Location
    Virginia
    Posts
    298
    Totally off topic but I just noticed the woman on the front of the JaguarPC website appears to be the same woman on the Simpli Hosting website. Are these companies owned by the same folks or?

    http://www.jaguarpc.com/

    http://www.simpli.biz/about_us.php


    Tom

  4. #4
    Join Date
    Jul 2000
    Location
    Colorado Springs, CO
    Posts
    2,280
    No its from a stock photo set, they must have the same set. She has lots of poses to choose from. I should just get one of our own staff to pose for the site
    Greg Landis | Founder Jaguarpc - Keeping websites happy since 1998
    Managed IT Solutions - Business hosting | Virtual Private Servers | Cloud VPS Hosting | Dedicated servers | Backup service
    Follow us @ Facebook.com/Jaguarpc | Twitter: @JaguarPC | (888)-338-5261 | sales @ jaguarpc.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •