1000+ members and guests online at once

Discussion in 'Hosting Discussions' started by maynard, May 11, 2005.

  1. maynard

    maynard Aspirant

    10
    1
    +0
    Hello,

    I've a quit popular website, the website is fully php-mysql driven site, originally its postnuke based but with lotsa of customizations
    it has also forum- phpbb2.
    Also, it has Downloads section, has like 400 mega of different downloads items (all are legal and everything)
    Some of the site section is restricted to members, my members number (right now) is 15,300 (Avg. 100 new member everyday)

    Here's my Server specs:

    AMD 2800+
    1 G ram
    CentOS 4.0
    Cpanel/WHM
    Apache 1.3.33
    PHP 4.3.11 w/Zend optimizer
    MySQL 4.0.24

    my cnf file only has this :

    [mysqld]
    set-variable = max_connections=500
    safe-show-database

    here's what mysqladmin status says (avg. 800 user online):
    Uptime: 65558
    Threads: 3
    Questions: 11295884
    Slow queries: 20
    Opens: 24181
    Flush tables: 1
    Open tables: 64
    Queries per second avg: 172.304

    and (avg. 1100 users online) :

    Uptime: 103977
    Threads: 7
    Questions: 21667953
    Slow queries: 37
    Opens: 32031
    Flush tables: 1
    Open tables: 64
    Queries per second avg: 208.392

    and Here's what my Free command says:

    total used free shared buffers cached
    Mem: 1019664 802036 217628 0 27564 277052
    -/+ buffers/cache: 497420 522244
    Swap: 2031608 291776 1739832

    and here's an example of my TOP:

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    11309 nobody 15 0 22824 13m 2916 S 18.2 1.4 0:01.41 httpd
    4838 nobody 15 0 24272 14m 2916 S 13.5 1.5 1:05.82 httpd
    11340 mysql 15 0 42144 11m 1368 S 6.0 1.1 0:00.23 mysqld
    11338 mysql 15 0 42144 11m 1368 S 5.7 1.1 0:00.22 mysqld
    10299 nobody 16 0 24748 15m 2932 S 3.4 1.6 12:33.70 httpd
    26556 nobody 16 0 27524 18m 2924 S 0.5 1.8 49:51.80 httpd
    10875 nobody 15 0 23396 14m 2916 S 0.5 1.4 0:05.42 httpd
    26567 nobody 15 0 46480 20m 2932 S 0.3 2.1 48:15.77 httpd
    21493 nobody 16 0 24828 15m 2928 S 0.3 1.6 2:36.53 httpd
    6165 nobody 16 0 24236 14m 2916 S 0.3 1.5 0:44.29 httpd
    10727 root 16 0 8968 2240 1808 S 0.3 0.2 0:00.06 sshd
    11083 nobody 15 0 23784 14m 2932 S 0.3 1.5 0:03.44 httpd

    My load average is usually are like : 2.13, 3.16, 3.36
    its never less 1.8 anyway and might up to 8 or 9 sometimes

    as Im a bit newbie in the servers thing, I was wondering about recommendations for optmizie this server (like my.cnf ..etc)
    and to let you know the speed of the website isnt bad at all, its quit good but not the fastest and its only that site on that server.

    any input would be greatly appreciated
     
    1
  2. PerfectSQL

    PerfectSQL Server Admin

    364
    115
    +1
    Hello,
    First off, you'd probably do well by installing eaccellorater to speed up your PHP .. there is a good thread located HERE explaing how to install it. You should remove your zend optimizer or at least disable optimization if you need it for Zend encoded files.

    Your my.cnf is very sparse, so i'd recomend you take a look at
    THIS THREAD, you will find alot of usefull information about tuning your mysql settings.

    Let us know after reviewing those threadsw if you need more specific help
     
  3. MaXBoost

    MaXBoost Adherent

    270
    63
    +0

    agreed to everthing you said, but i'll keep using both zend and eaccellorater. it does no harm to the sever or php plus you get an extra 15% faster page loads
     
  4. maynard

    maynard Aspirant

    10
    1
    +0
    Thanks for responding.

    I read those 2 threads and found them very usefull, but I only have 2 things make me worry:

    1- as MaXBoost said, I need Zend and Im not sure if both eaccellorater and Zend will go along with each other ?

    2- as I'm having a dynamic website, the site info is changing like every 5 min. people post news item, comments beside the forums ..etc
    I wonder if I used php cashe tool such as eaccelerator, would that effect the dynamic contents for such very active site ?
    and the things goes as well for MySQL query cach
     
  5. PerfectSQL

    PerfectSQL Server Admin

    364
    115
    +1
    You can use them both together.. just set this under your php.ini

    [Zend]
    zend_optimizer.optimization_level=0

    that will turn off the optimization, so you can use it to just run zend encoded scripts.

    As for question 2, the content changes, but the scripts do not. eaccelorater stores the scripts in a compiled state and reuses them. It works great with forums and portals etc.
     
  6. maynard

    maynard Aspirant

    10
    1
    +0
    Thanks for respondingand the great help

    I enhanced my cnf file and add the following


    Code:
    [mysqld]
    
    skip-locking
    
    set-variable = max_connections=500
    set-variable = max_allowed_packet=5M
    set-variable = connect_timeout=15
    set-variable = key_buffer=64M
    set-variable = join_buffer=1M
    set-variable = record_buffer=1M
    set-variable = sort_buffer=1M
    set-variable = sort_buffer_size=786k
    set-variable = read_buffer_size=512k
    set-variable = read_rnd_buffer_size=768K
    set-variable = table_cache=384
    set-variable = thread_cache_size=50 
    set-variable = thread_concurrency=2
    set-variable = wait_timeout=15
    set-variable = query_cache_limit=1M
    set-variable = query_cache_size=32M
    set-variable = query_cache_type=1
    set-variable = myisam_sort_buffer_size=32M
    skip-innodb
    safe-show-database
    and then I installed eaccelerator and there's some great speed improvments in all over the server
    yet it didnt lower the laod that much, still get up 3 as load avg. in peak hours but still way better from the scary 8 and 9 I used to have