Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: High hard disk usage when the server isn't even being used.

  1. #11
    Join Date
    Aug 2006
    Location
    home
    Beans
    Hidden!
    Distro
    Ubuntu Studio 9.10 Karmic Koala

    Re: High hard disk usage when the server isn't even being used.

    Hi

    disk grinding at daily intervals:

    updatedb -used by locate & slocate- indexes your system -except your pruned paths and FS's- everyday
    > that is all files that changed, quite similar to windoze & osx file indexing

    it's a default setting in debian ( and so also in ubuntu )
    settings:
    Code:
    /etc/updatedb.conf
    the cron job is in cron.daily > and so runs daily at a fixed time.
    Code:
    /etc/cron.daily/mlocate

    regarding apache:

    you most likely installed apache2 prefork

    if it's serving dynamic pages ( php & the likes )
    then each process ( depending on loaded apache modules ) is 15-32MB ( with me it's about 30MB on average )

    if it's static pages then only a couple of MB are needed.


    apache2 has a bad default setting ( big iron ) that spawns a couple of processes and keeps a couple in reserve.

    following is important

    the default MaxClients=150 setting.. when busy it will keep spawning processes until this maximum is reached ... in other words if your serving dynamic pages and have a busy server > worst case scenario is that apache will use 150x32MB = 4.8GB....

    you can test this by refreshing a page it serves very fast ( tap the F5 key very fast for a minute )... your server will almost certainly die/ lock up in front you ....

    a good reasonable setting for the couple of hundred pages your serving daily is

    Code:
    sudo vim /etc/apache2/apache2.conf
    and look for following

    Code:
    <IfModule mpm_prefork_module>
        StartServers          5
        MinSpareServers       5
        MaxSpareServers      10
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
    a little lower you have the settings for the apache worker module .. just ignore those ( they're there for SMP machines with apache2 worker installed, full explanation of this is a little of topic )


    I suggest changing previous into something like this... ( a save setting I use on low memory machines ).

    Code:
    <IfModule mpm_prefork_module>
        StartServers          2
        MinSpareServers       2
        MaxSpareServers      4
        MaxClients          6
        MaxRequestsPerChild   1000
    </IfModule>
    now apache will spawn maximum 6 processes > worst case 6*32MB= 192MB ... if you don't use MYSQL then 256MB ram will just do....

    a little bit above that you have the KeepAliveTimeout parameter, change it to

    Code:
    KeepAliveTimeout 2
    with
    Code:
    KeepAlive On

    bye...
    Last edited by djamu; November 16th, 2008 at 08:53 PM. Reason: spel
    democracy : 2 wolves and a sheep voting on "what's for dinner"
    i am self-employed, and my views reflect the electrical charges held between many simultaneously firing synapses... or is that synapsi?
    http://3d.uk.to

  2. #12
    Join Date
    Jun 2008
    Location
    SATA1 block 3054 sector 4
    Beans
    466
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: High hard disk usage when the server isn't even being used.

    The maxclients thing on my server must be okay, because I went to my site and refreshed it 100 times at once, no hiccups at all lol. Thanks.

  3. #13
    Join Date
    Aug 2006
    Location
    home
    Beans
    Hidden!
    Distro
    Ubuntu Studio 9.10 Karmic Koala

    Re: High hard disk usage when the server isn't even being used.

    well I do suggest or rather urge you to match the maxclients to the available ram ... just in case some idiot runs a script fetching lots of pages / spawning lots of instances .... pretty easy to do
    ( most basic DOS attack you can imagine )....

    just a good advice
    democracy : 2 wolves and a sheep voting on "what's for dinner"
    i am self-employed, and my views reflect the electrical charges held between many simultaneously firing synapses... or is that synapsi?
    http://3d.uk.to

  4. #14
    Join Date
    Jun 2008
    Location
    SATA1 block 3054 sector 4
    Beans
    466
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: High hard disk usage when the server isn't even being used.

    Quote Originally Posted by djamu View Post
    well I do suggest or rather urge you to match the maxclients to the available ram ... just in case some idiot runs a script fetching lots of pages / spawning lots of instances .... pretty easy to do
    ( most basic DOS attack you can imagine )....

    just a good advice
    Well I think my largest page is 1mb, so spawning lots of pages wont do much... Besides, I watch my network constantly, so I will notice and block the ip.


    BTW: DOS was awesome.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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