SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member
    Join Date
    Dec 2000
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a dedicated Red Hat Linux server with 128Mb RAM. I've currently 30'000 visitors a day (1250/hours) on some free hosts and when I redirect them to my dedicated server, the server is full in a few seconds.

    Right now my MaxClient property on httpsd.conf is 150 and I know I could change this but when I look at the running process (using the 'top' utility), I see that 95% of my RAM is used already (and 0.2% of CPU). Each httpsd process takes 2.4% of RAM! Isn't ~3Mb a lot?! I use PHP and MySQL but that still seems a lot to me!!! (I mean, I don't use Windows! ).

    I'll updgrade my RAM soon but I'm not even sure if 256Mb will be enough! Maybe I should go with 512Mb? Or maybe is there a way to optimize Apache so that each process takes less RAM? Should I remove some of the default modules? I could remove mod_perl since I don't use it but maybe other modules? Could I manage to get 1-2Mb of RAM per httpd process by changing some configurations?

    Thanks,


    sCandy

  2. #2
    SitePoint Member
    Join Date
    Dec 2000
    Location
    Poland
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can have even 1GB memory and it will be swallowed in a few minutes, because the Linux uses all available memory to cache the disk accesses! But if the system (applications) needs more memory it smoothly decreases cache size (opposite to Windows, which starts swapping in this case).
    Check out (using your top utility) how much memory is "free" (probably only few MBs) and how much is "cached" (probably more than 60MB at your machine). "Cached" means FREE (in roughly words) !!!

    Chris

  3. #3
    Non-Member
    Join Date
    Dec 2000
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really? Then I could set up a limit to 500 clients and it would still work even with 128Mb?! I use the top utility to monitor, here's what I get:

    Mem: 125932K av, 121752K used, 4180K free, 78324K shrd, 71856K buff
    Swap: 265032K av, 2260K used, 262772K free 18152K cached

    I don't see a cache for the memory? Or is it this 'buff' memory? I managed to lower the apache deamons to 1.9% of memory but my server crashed after a while when I made it public. I don't know what happened but I think it's related with memory because when my sites are closed, everything works very well. Also look at this:

    83 processes: 81 sleeping, 2 running, 0 zombie, 0 stopped

    Is it normal most processes are sleeping? I've set a lower KeepAlive option, 7 seconds but the processes seems to stay during a long time... Do you have an idea what my idea could be?

    Thanks

    sCandy

  4. #4
    SitePoint Member
    Join Date
    Dec 2000
    Location
    Poland
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    > Really? Then I could set up a limit to 500 clients and it would still work even with 128Mb?!

    Just try to raise the limit for the Apache and you can see.

    > I don't see a cache for the memory? Or is it this 'buff' memory?

    The amount of the free memory you can get using free util. It is calculated as free (4180K)+ buffers (71856K) + cached (18152K). It seems you have plenty of it.

    > Also look at this: 83 processes: 81 sleeping, 2 running, 0 zombie, 0 stopped

    Well, 0 zombie processes means that's nothing wrong with your Linux. Many sleeping processes are deamons & other programs which are not used in this moment. Sleeping is the most efficient way to have a program in the memory ready for immediate action without using CPU time (isn't it like the Apache should work ?). Eg. the program which is waiting for pressing a key is sleeping.

    Chris
    PS. I ahve only 2 running processes in this moment too (X & netscape).


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
  •