1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Please help to fix my apache setting ?

Discussion in 'Apache' started by energetic, Sep 25, 2007.

Thread Status:
Not open for further replies.
  1. #1
    I found that all my website are loaded in very slow speed.
    my server P4 3.0, 1G RAM, 100M port
    Here is the following apache status at the time the website loading is very slow:

    Apache Server Status
    Server Version: Apache/1.3.39 (Unix) mod_ssl/2.8.30 OpenSSL/0.9.7f PHP/5.2.3 mod_perl/1.29 FrontPage/5.0.2.2510
    Server Built: Sep 12 2007 22:15:18
    Current Time: Tuesday, 25-Sep-2007 08:13:03 PDT
    Restart Time: Tuesday, 25-Sep-2007 00:24:06 PDT
    Parent Server Generation: 0
    Server uptime: 7 hours 48 minutes 57 seconds
    Total accesses: 100325 - Total Traffic: 318.6 MB
    CPU Usage: u98.73 s10.58 cu0 cs0 - .388% CPU load
    3.57 requests/sec - 11.6 kB/second - 3330 B/request
    107 requests currently being processed, 2 idle servers


    httpd setting :
    Timeout 60
    KeepAlive Off
    MaxKeepAliveRequests 500
    KeepAliveTimeout 5
    MinSpareServers 5
    MaxSpareServers 20
    #StartServers 8
    MaxClients 1000
    MaxRequestsPerChild 150



    one of my client's website stat : >10000 unique per day


    Would you like telling how to optimize my server so that:
    1. my server can handle hosting high traffic website.
    2. speed the the website loading.

    Thanks
     
    energetic, Sep 25, 2007 IP
  2. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    One way to speed up a bit, is to setup a secondary website, without php or any other support (basicly a very cut down apache/web service) and use that to directly serve all of your static files (ie images css / etc).

    You might want look at putting some type of caching into your application, so it's not always doing everything when requested. ALso you could try optimizing the application to do less work (ie smaller / optimized sql queries, do some preformance optimization of your code).

    Trying to get rid of unneeded modules might help as well, do you really need mod ssl & frontpage installed ?

    less modules = faster server.
     
    powerspike, Sep 25, 2007 IP
  3. nick-a

    nick-a Active Member

    Messages:
    446
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Use apache 2.2 with worker module, and turn on keepalives! The server should handle 10k uniques a day and not slow down...
     
    nick-a, Sep 26, 2007 IP
  4. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Is this site using mysql?
     
    cyanide, Sep 26, 2007 IP
  5. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #5
    yes. Do you have any idea ?

     
    energetic, Sep 26, 2007 IP
  6. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #6
    how to upgrade apache 2.2 ?


     
    energetic, Sep 26, 2007 IP
  7. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Anytime, you are using mysql, you should look at that first.

    I assume this is a dedicated and you have root access?
    Open up the mysql config and post the contents, type:
    then close the file, by typing
    then type
    and post those results
     
    cyanide, Sep 27, 2007 IP
  8. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #8
    login as: root
    Last login: Wed Sep 26 12:00:04 2007 from 21...
    [root@64 ~]# vi /etc/my.cnf
    [root@64 ~]# mysqladmin extended-status
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    [root@64 ~]#
     
    energetic, Sep 27, 2007 IP
  9. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #9
    When you did vi /etc/my.cnf what happened?

    Regarding Access denied, are you on a cpanel server?
    Sounds like no password has been set.

    In cpanel, log into whm and click MySQL Root Password
    and in the box type a password, it can be anything, you don't need to remember it,
    then try that code again
     
    cyanide, Sep 27, 2007 IP
  10. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #10
    I am using Directadmin as control panel.
    Would you like telling me how to do ?
     
    energetic, Sep 29, 2007 IP
  11. Scriptona

    Scriptona Notable Member

    Messages:
    4,957
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    280
    #11
    You should really reduce
    With the CPU and 1GB RAM you should get that value down to

    Also

    Down to

    Then restart apache


    Always use top to monitor your CPU/RAM usage

    Also rebuild apache with susexec enabled to get track of what account on the server is consuming much resources and use as less modules in apache as possible (no need for things like front page extensions as example)


    Mysql is another verse though
     
    Scriptona, Sep 30, 2007 IP
  12. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #12
    I have tried and see what happen....
     
    energetic, Oct 1, 2007 IP
  13. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #13
    the apache still slow to react.

    Processor Name Intel(R) Pentium(R) 4 CPU 3.00GHz
    Vendor ID GenuineIntel
    Processor Speed (MHz) 2996.537
    Processor Name Intel(R) Pentium(R) 4 CPU 3.00GHz
    Vendor ID GenuineIntel
    Processor Speed (MHz) 2996.537
    Total Memory 969512 kB
    Free Memory 371648 kB
    Total Swap Memory 1966072 kB
    Free Swap Memory 1965244 kB




    exim exim (pid 4495 ) Start Stop Restart Reload
    httpd httpd (pid 11027 15748 15752 15869 15954 15965 16188 16300 16304 16309 16311 16346 16349 16993 18107 18139 18885 18895 19802 19812 20332 20335 20336 20341 20342 20343 20356 20363 20364 20365 20373 20374 20375 20376 20427 20434 20435 20443 20549 20930 20940 21150 21360 22391 22395 22396 22412 22423 22424 22591 22613 22614 22745 22867 23157 23344 23801 23859 24065 24566 24587 24589 24590 24594 24710 24761 24762 24978 24983 24984 24986 24988 24989 ) Start Stop Restart Reload
    mysqld mysqld (pid 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 22157 21330 21641 21707 21825 22017 22404 23106 23384 23493 23887 24548 24967 25005 25030 25037 25038 25041 25045 25060 25066 25067 25068 25070 25073 25090 25092 25093 25097 25110 25116 25118 25120 25124 25126 25127 25130 25132 25133 25134 25138 25139 25140 25141 25143 25144 25145 25146 25147 25148 25149 25150 25151 25152 25154 25155 25157 )
     
    energetic, Oct 2, 2007 IP
  14. Scriptona

    Scriptona Notable Member

    Messages:
    4,957
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    280
    #14
    You really need more RAM as you are using SWAP already
     
    Scriptona, Oct 2, 2007 IP
  15. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #15
    How many RAM you suggest ?
     
    energetic, Oct 2, 2007 IP
  16. Scriptona

    Scriptona Notable Member

    Messages:
    4,957
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    280
    #16
    Just checked your stats again - I was mistaken - Thought free SWAP space is the used one

    Your RAM usage looks fine but you need to know what's slowing your server

    You can install suexec to know what account is causing the load and investigate this account further
     
    Scriptona, Oct 2, 2007 IP
  17. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #17
    I know which account causing the server busy, the account has >10000 unique per day

    how to fix it ?

     
    energetic, Oct 3, 2007 IP
  18. crashlab

    crashlab Active Member

    Messages:
    77
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    50
    #18
    The best way is reading a good book to make it!
     
    crashlab, Oct 3, 2007 IP
  19. energetic

    energetic Well-Known Member

    Messages:
    2,844
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #19
    If I have time to read a book, I would not post my difficulties here.


     
    energetic, Oct 3, 2007 IP
  20. Scriptona

    Scriptona Notable Member

    Messages:
    4,957
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    280
    #20
    Start from those

    then play with those numbers while watching server performance in peak hours to know what's good for your server and traffic
     
    Scriptona, Oct 3, 2007 IP
Thread Status:
Not open for further replies.