Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2008
    Posts
    269

    Server Optmization

    Hi guys, please help for optimization my server.

    My actually configurations.

    Dedicated Server:
    i7 920 / 24GB Memory / Port 1Gbit / Cpanel

    System:
    Centos 5 64Bits / Nginx (cpnginx.com) / PHP 5.2.7 / Apache 2

    Configurations:
    /etc/my.cnf
    Code:
    [mysqld]
    # From syslint.com
    local-infile=0
    skip-locking
    key_buffer = 384M
    max_allowed_packet = 1M
    max_connections = 500
    max_user_connections = 50
    wait_timeout=40
    connect_timeout=10
    table_cache = 512
    sort_buffer_size = 256K
    read_buffer_size = 2M
    read_rnd_buffer_size = 8M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size = 32M
    thread_concurrency = 16
    server-id       = 1
    
    [mysqldump]
    quick
    max_allowed_packet = 16M
    
    [mysql]
    no-auto-rehash
    
    [myisamchk]
    key_buffer = 256M
    sort_buffer_size = 256M
    read_buffer = 2M
    write_buffer = 2M
    
    [mysqlhotcopy]
    interactive-timeout
    Nginx Config:
    Code:
    # cPanel Nginx Master configuration
    user  nobody;
    error_log  logs/error.log;
    #Number of worker you need
    worker_processes  1;
    # How many connections a worker can handle maximum.
    events {
        worker_connections  50000;
    }
    http {
    	include    mime.types;
     	default_type  application/octet-stream;
     	sendfile on;
    	server_names_hash_max_size 10000;
            server_names_hash_bucket_size 1024;
     	tcp_nopush on;
     	tcp_nodelay on;
     	keepalive_timeout  10;
     	gzip on;
     	gzip_min_length  1100;
     	gzip_buffers  4 32k;
     	gzip_types    text/plain  application/x-javascript text/xml text/css;
     	ignore_invalid_headers on;
     	client_header_timeout  3m;
     	client_body_timeout 3m;
     	send_timeout     3m;
     	include "/usr/local/nginx/conf/vhost.conf";
     	include "/etc/cpnginx/cpanelproxy.conf";
    }
    Executed Command:
    Code:
    netstat -an|grep :80|wc -l
    2915
    Load Averages: 12.27 12.12 11.85

  2. #2
    Join Date
    Nov 2010
    Location
    Arizona
    Posts
    297
    Paste the output of top -c

    You probably need to optimize MySQL. Check out this script:

    http://mysqltuner.pl/mysqltuner.pl

  3. #3
    Join Date
    Apr 2009
    Location
    inside wht
    Posts
    716
    It seems to be a default configuration. Send the following ,

    # mysqladmin proc stat
    # mpstat 3
    # top -n1 -c
    # exim -bpc
    24x7 PRO-ACTIVE SERVER MANAGEMENT | OUTSOURCED WEB HOSTING SUPPORT
    Now Available The first Support Brand for Startup Hosting Companies

    Sales : sales @ syslint.com | Skype us : SyslintSkype | Call us : (+91)6007799

  4. #4
    Join Date
    Jul 2008
    Posts
    269
    Quote Originally Posted by asciiDigital View Post
    Paste the output of top -c
    You probably need to optimize MySQL. Check out this script:
    http://mysqltuner.pl/mysqltuner.pl
    Code:
    top - 15:15:31 up 14:11,  1 user,  load average: 9.33, 9.45, 9.44
    Tasks: 151 total,   2 running, 149 sleeping,   0 stopped,   0 zombie
    Cpu(s):  3.2%us,  1.7%sy, 16.4%ni, 81.4%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st
    Mem:  24677140k total,  2483684k used, 22193456k free,   252288k buffers
    Swap: 12586808k total,        0k used, 12586808k free,  1441972k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    24267 nobody    19   4  174m  33m  14m S 25.0  0.1   0:07.83 /usr/local/apache/b
    14052 nobody    20   4  197m  55m  16m S 23.3  0.2   5:46.71 /usr/local/apache/b
    21406 nobody    20   4  177m  36m  16m S 18.6  0.1   2:12.31 /usr/local/apache/b
    24057 nobody    20   4  175m  35m  15m S 14.0  0.1   0:33.90 /usr/local/apache/b
    22740 nobody    20   4  191m  51m  15m S 13.3  0.2   1:13.14 /usr/local/apache/b
    24040 nobody    20   4  192m  52m  15m S 13.0  0.2   0:46.05 /usr/local/apache/b
    24264 nobody    20   4  195m  54m  15m S 12.3  0.2   0:07.51 /usr/local/apache/b
    24050 nobody    20   4  182m  40m  15m R  8.7  0.2   0:41.07 /usr/local/apache/b
    14049 nobody    19   4  177m  35m  16m S  7.7  0.1   5:55.13 /usr/local/apache/b
    19832 nobody    19   4  176m  36m  15m S  7.7  0.1   2:28.36 /usr/local/apache/b
    11411 nobody    15   0 43980  20m  804 S  2.3  0.1   3:53.94 nginx: worker proce
     3004 mysql     21   6  752m 181m 4020 S  1.0  0.8  22:31.69 /usr/sbin/mysqld --
    24328 root      15   0 12744 1128  808 R  0.3  0.0   0:00.08 top -c
        1 root      15   0 10352  704  588 S  0.0  0.0   0:01.00 init [3]
        2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.09 [migration/0]
        3 root      34  19     0    0    0 S  0.0  0.0   0:00.03 [ksoftirqd/0]
        4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/0]
        5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.10 [migration/1]
        6 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/1]
        7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/1]
        8 root      RT  -5     0    0    0 S  0.0  0.0   0:00.14 [migration/2]
        9 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/2]
       10 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/2]
       11 root      RT  -5     0    0    0 S  0.0  0.0   0:00.09 [migration/3]
       12 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/3]
       13 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/3]
       14 root      RT  -5     0    0    0 S  0.0  0.0   0:00.03 [migration/4]
       15 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/4]
       16 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/4]
       17 root      RT  -5     0    0    0 S  0.0  0.0   0:00.03 [migration/5]
       18 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/5]
       19 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/5]
    Quote Originally Posted by Syslint View Post
    It seems to be a default configuration. Send the following ,

    # mysqladmin proc stat
    # mpstat 3
    # top -n1 -c
    # exim -bpc
    mysqladmin proc stat:
    Code:
    +--------+--------------+-----------+--------------+---------+------+-------+---
    ---------------+
    | Id     | User         | Host      | db           | Command | Time | State | In
    fo             |
    +--------+--------------+-----------+--------------+---------+------+-------+---
    ---------------+
    | 333893 | wordpres_blog | localhost | wordpres_blog | Sleep   | 0    |       |
                   |
    | 333894 | wordpres_blog | localhost | wordpres_blog | Sleep   | 0    |       |
                   |
    | 333895 | root         | localhost |              | Query   | 0    |       | sh
    ow processlist |
    +--------+--------------+-----------+--------------+---------+------+-------+---
    ---------------+
    Uptime: 51219  Threads: 3  Questions: 5010021  Slow queries: 0  Opens: 328  Flus
    h tables: 1  Open tables: 320  Queries per second avg: 97.816
    mpstat 3:
    Code:
    03:19:53 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle
        intr/s
    03:19:56 PM  all    0.25   23.37    2.29    0.00    0.12    0.21    0.00   73.76
       2710.67
    03:19:59 PM  all    0.21   24.67    2.62    0.04    0.04    0.29    0.00   72.12
       2829.00
    03:20:02 PM  all    1.04   31.79    4.71    0.04    0.08    1.00    0.00   61.33
       2656.81
    03:20:05 PM  all    0.21   16.25    1.83    0.00    0.04    0.21    0.00   81.46
       2504.35
    03:20:08 PM  all    0.21   21.57    2.21    0.04    0.12    0.25    0.00   75.59
       2917.28
    03:20:11 PM  all    0.21   13.42    1.25    0.00    0.04    0.21    0.00   84.87
       2921.07
    03:20:14 PM  all    0.25   20.95    2.00    0.00    0.08    0.17    0.00   76.55
       2610.67
    03:20:17 PM  all    0.17   21.12    2.12    0.04    0.04    0.17    0.00   76.34
       2389.04
    03:20:20 PM  all    0.21   18.07    1.83    0.00    0.04    0.17    0.00   79.68
       2135.33
    03:20:23 PM  all    0.21   26.31    2.59    0.00    0.04    0.25    0.00   70.60
       2254.33
    03:20:26 PM  all    0.17   22.49    2.12    0.00    0.08    0.21    0.00   74.93
       2544.67
    03:20:29 PM  all    0.58   19.41    1.87    0.00    0.04    0.87    0.00   77.22
       2601.67
    top -n1 -c:
    Code:
    top - 15:21:05 up 14:17,  1 user,  load average: 12.16, 11.70, 11.53
    Tasks: 151 total,   4 running, 147 sleeping,   0 stopped,   0 zombie
    Cpu(s):  4.7%us,  1.3%sy, 12.6%ni, 84.2%id,  0.1%wa,  0.0%hi,  0.1%si,  0.0%st
    Mem:  24677140k total,  2513180k used, 22163960k free,   252776k buffers
    Swap: 12586808k total,        0k used, 12586808k free,  1451460k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    25639 nobody    20   4  192m  51m  15m R 53.7  0.2   0:09.23 /usr/local/apache/b
    25453 nobody    20   4  181m  39m  15m R 49.7  0.2   0:30.56 /usr/local/apache/b
    26795 nobody    20   4  192m  51m  14m S 37.8  0.2   0:06.09 /usr/local/apache/b
    24264 nobody    20   4  194m  53m  16m S 33.8  0.2   0:58.63 /usr/local/apache/b
    19832 nobody    19   4  175m  35m  15m S 23.9  0.1   3:19.53 /usr/local/apache/b
    14052 nobody    20   4  194m  53m  16m S 21.9  0.2   6:38.36 /usr/local/apache/b
    21406 nobody    20   4  187m  44m  16m R 21.9  0.2   3:07.65 /usr/local/apache/b
    25628 nobody    20   4  192m  52m  15m S 13.9  0.2   0:18.07 /usr/local/apache/b
    24050 nobody    20   4  174m  34m  15m S  4.0  0.1   1:35.33 /usr/local/apache/b
     3004 mysql     21   6  752m 181m 4036 S  2.0  0.8  22:43.92 /usr/sbin/mysqld --
    11411 nobody    15   0 44244  21m  804 S  2.0  0.1   4:01.63 nginx: worker proce
    25626 nobody    20   4  175m  35m  15m S  2.0  0.1   0:20.98 /usr/local/apache/b
        1 root      15   0 10352  704  588 S  0.0  0.0   0:01.00 init [3]
        2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.09 [migration/0]
        3 root      34  19     0    0    0 S  0.0  0.0   0:00.03 [ksoftirqd/0]
        4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/0]
        5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.10 [migration/1]
        6 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/1]
        7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/1]
        8 root      RT  -5     0    0    0 S  0.0  0.0   0:00.14 [migration/2]
        9 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/2]
       10 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/2]
       11 root      RT  -5     0    0    0 S  0.0  0.0   0:00.09 [migration/3]
       12 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/3]
       13 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/3]
       14 root      RT  -5     0    0    0 S  0.0  0.0   0:00.03 [migration/4]
       15 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/4]
       16 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/4]
       17 root      RT  -5     0    0    0 S  0.0  0.0   0:00.03 [migration/5]
       18 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/5]
       19 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 [watchdog/5]
       20 root      RT  -5     0    0    0 S  0.0  0.0   0:00.02 [migration/6]
    exim -bpc:
    Code:
    0

  5. #5
    Join Date
    Apr 2009
    Location
    inside wht
    Posts
    716
    That is strange , are you using software raid ?
    This server suphp or dso ? ( /usr/local/cpanel/bin/rebuild_phpconf --current )
    ?
    24x7 PRO-ACTIVE SERVER MANAGEMENT | OUTSOURCED WEB HOSTING SUPPORT
    Now Available The first Support Brand for Startup Hosting Companies

    Sales : sales @ syslint.com | Skype us : SyslintSkype | Call us : (+91)6007799

  6. #6
    Join Date
    May 2009
    Location
    Italy - Rome
    Posts
    149
    You must optimize Apache and tuning Nginx.
    But it's great to know how many connections you have:

    netstat -an | grep "ESTABLISHED" | grep ".80 " | awk '{print $5}' | sed 's/\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)\.[0-9]*/\1/' | uniq | wc -l

Similar Threads

  1. Mysql Optmization Guru needed
    By azn_romeo_4u in forum Systems Management Requests
    Replies: 6
    Last Post: 02-20-2011, 06:18 PM
  2. Natcoweb: Quad Server, Storage Dedicated Server, Blade Server Solutions
    By Natcoweb in forum Dedicated Hosting Offers
    Replies: 0
    Last Post: 09-14-2009, 09:32 AM
  3. 3+ Server Cluster, 1TB File Server, 10M (3,240G xfer) Included, $99/Server
    By alias_willsmith in forum Dedicated Hosting Offers
    Replies: 7
    Last Post: 08-28-2007, 05:40 PM
  4. Search engine optmization work needed
    By gt3n in forum Employment / Job Offers
    Replies: 1
    Last Post: 09-02-2005, 07:42 PM
  5. Replies: 4
    Last Post: 09-25-2004, 06:37 PM

Posting Permissions

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