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.

Low Memory VPS : MySQL and Apache Optimization Guide

Discussion in 'Site & Server Administration' started by agnivo007, Jan 8, 2007.

  1. #1
    Just wrote an article based on my experiences. Hope you'd like it and it's useful to you...

    Snippet :
    Story Link

    Give it a Digg if you like it (I'm not trying to draw some traffic) and add a green rep if you find it useful.
     
    agnivo007, Jan 8, 2007 IP
  2. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #2
    agnivo007, Jan 10, 2007 IP
  3. eljefe3

    eljefe3 Peon

    Messages:
    894
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I talked to my hosts and they say you actually get more memory on a shared or reseller plan than you do on a VPS. Heck they even talked me out of spending more money with them as I was going to go with a VPS. They said that on a shared host you have access to more burstable RAM than you do on a VPS so if you need a lot of computing power once in a while, shared is the way to go while if you have a much less but continous drain on CPU, then VPS was the way to go.

    They save me $50/month with this info.
     
    eljefe3, Jan 10, 2007 IP
  4. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #4
    And be prepared to get kicked out with no notice ! You'll learn a lesson quickly if you have a site that gets high traffic bursts.

    BTW, decent VPSs are now $20+ (unmanaged)
     
    agnivo007, Jan 11, 2007 IP
  5. koolasia

    koolasia Banned

    Messages:
    1,413
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I have set my vds as per u said lets see if it works faster than before or no

    thanks
     
    koolasia, Jan 11, 2007 IP
  6. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks... don't forget the tuning part as I described in the last few paragraphs.
     
    agnivo007, Jan 11, 2007 IP
  7. grk519

    grk519 Peon

    Messages:
    293
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Nice article and thanks for posting!
     
    grk519, Jan 15, 2007 IP
  8. saadahmed007

    saadahmed007 Admínistratör

    Messages:
    5,272
    Likes Received:
    869
    Best Answers:
    0
    Trophy Points:
    380
    #8
    Just optimized my vps on which i host my directory :)
    Saad
     
    saadahmed007, Jan 16, 2007 IP
  9. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Looking for feedback and performance report after optimization, guys!
     
    agnivo007, Jan 22, 2007 IP
  10. koolasia

    koolasia Banned

    Messages:
    1,413
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I Had Just Optimized My Apache And Trust Me Its Really Better . Ill optimize sql later n tell u that too
     
    koolasia, Jan 23, 2007 IP
  11. Namesniper

    Namesniper Well-Known Member

    Messages:
    365
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    118
    #11
    How exactly did you optimzied Apache and whats your current apache settings ?
     
    Namesniper, Feb 9, 2007 IP
  12. koolasia

    koolasia Banned

    Messages:
    1,413
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Namesniper do you have ssh root access ???
     
    koolasia, Feb 9, 2007 IP
  13. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #13
    koolasia, yes this optimization really works...especially apache. The total mem utilization never crosses 180MB on my 256MB VPS.

    Will try to tweak it more and later post regarding this...
     
    agnivo007, Feb 10, 2007 IP
  14. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Posted another apache config there...
     
    agnivo007, Mar 19, 2007 IP
  15. Namesniper

    Namesniper Well-Known Member

    Messages:
    365
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    118
    #15
    Where did you posted it ?
     
    Namesniper, Mar 19, 2007 IP
  16. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #16
    agnivo007, Mar 19, 2007 IP
  17. guitarbinge

    guitarbinge Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #17
    good read-im about to switch servers myself...
     
    guitarbinge, Apr 28, 2008 IP
  18. onel0ve

    onel0ve Member

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
  19. RoseHosting

    RoseHosting Well-Known Member

    Messages:
    230
    Likes Received:
    11
    Best Answers:
    11
    Trophy Points:
    138
    #19
    You can try to optimize your Apache and MySQL services for low memory use as described below:

    Edit your Apache configuration file
    • Red Hat / Fedora: /etc/httpd/conf/httpd.conf
    KeepAlive On
    KeepAliveTimeout 3
    <IfModule prefork.c>
    StartServers 2
    MinSpareServers 2
    MaxSpareServers 5
    ServerLimit 100
    MaxClients 100
    MaxRequestsPerChild 500
    </IfModule>
    <IfModule worker.c>
    StartServers 2
    MaxClients 150
    MinSpareThreads 15
    MaxSpareThreads 50
    ThreadsPerChild 15
    MaxRequestsPerChild 0
    </IfModule>

    • Ubuntu / Debian: /etc/apache2/apache2.conf
    KeepAlive On
    KeepAliveTimeout 3
    <IfModule mpm_prefork_module>
    StartServers 2
    MinSpareServers 2
    MaxSpareServers 5
    MaxClients 100
    MaxRequestsPerChild 500
    </IfModule>
    <IfModule mpm_worker_module>
    StartServers 2
    MaxClients 150
    MinSpareThreads 15
    MaxSpareThreads 50
    ThreadsPerChild 15
    MaxRequestsPerChild 0
    </IfModule>

    Also, remove any Apache modules you aren't using.
    =================================================

    Edit your MySQL configuration file
    • Red Hat / Fedora: /etc/my.cnf
    • Ubuntu / Debian: /etc/mysql/my.cnf
    [mysqld]
    port = 3306
    socket = /var/lib/mysql/mysql.sock
    skip-locking
    key_buffer = 16K
    max_allowed_packet = 1M
    table_cache = 4
    sort_buffer_size = 64K
    read_buffer_size = 256K
    read_rnd_buffer_size = 256K
    net_buffer_length = 2K
    thread_stack = 64K

    Do not forget to restart your Apache / MySQL service for the changes to take effect.
     
    RoseHosting, Feb 24, 2011 IP
  20. abinteractive

    abinteractive Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    If you don't use innodb in your mysql applications then switch it off in the my.cnf options to save a useful chunk of memory
     
    abinteractive, Mar 1, 2011 IP