server memory cannot release

server memory cannot release

by Patrick Lee -
Number of replies: 11

Please help!

I just installed and configured  well Moodle Version 1.4.3+.

About my computer configuration are :

128MB Ram, Linux 9 with apache server,PHP module,Mysql.

Anything ok but i have a problem in apache server.

I discovered that memory cannot be released after browsing.

It will cause apache very slow response or browser halted.

so many httpd daemon still running while all login were out and browser

was quit. 

Please advise me how to solve~

Following are some information:

Using vmstat command

  procs                      memory      swap          io     system      cpu
 r  b  w   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id
 1  0  2   7088  28708   5512  29932    0    0     0     0  103    13  0  0 100
 0  0  2   7088  28708   5512  29932    0    0     0     0  102    10  0  0 100
 0  0  2   7088  28708   5520  29932    0    0     0     8  104    17  0  1 99
 0  0  2   7088  28708   5520  29932    0    0     0     0  102    11  0  0 100
 0  0  3   7088  26132   5528  29932    0    0     0    16  320    83 45  4 50
 1  0  2   7088  19564   5528  29932    0    0     0     0  150    98 66  5 28
 1  0  2   7088  15480   5528  29932    0    0     0     0  102    17 88 12  0
 0  0  0   7088  14428   5540  29932    0   14     0   238  186    76 28  4 68
 0  0  0   7088  14428   5540  29932    0    0     0     0  103    13  0  0 100
 0  0  0   7088  14428   5528  29952    0    0     0    66  109    16  0  0 100
 1  0  0   7088  14428   5440  30040    0    0     0     0  106    13  0  1 99
 1  0  1   7088  14428   5248  30232    0    0     0     0  102    28 96  4  0
 1  0  0   7088  14428   5248  30244    0    2     0   124  153    28 12  0 88
 0  0  0   7088  14428   5236  30256    0    0     0     0  103    12  0  0 100
 1  0  0   7088  14428   5236  30264    0    0     0    78  112    81 75  2 23
 0  0  0   7088  14428   5228  30272    0    0     0     0  147    20 36  0 63
 0  0  0   7088  14428   5236  30272    0   34     0   152  113    16  0  1 99
 0  0  0   7088  14428   5236  30272    0   70     0    70  102    11  0  0 100
 0  0  0   7088  14428   5236  30272    0   78     0    78  112    15  0  0 100
 1  0  0   7088  14428   5244  30272    0   86     0    94  120    79 27  1 71

[root@moodle root]# ps -ef | grep httpd
root      1707     1  0 12:02 ?        00:00:01 /usr/sbin/httpd
apache    1731  1707  0 12:02 ?        00:00:02 [httpd]
apache    1732  1707  0 12:02 ?        00:00:00 [httpd]
apache    1733  1707  0 12:02 ?        00:00:02 [httpd]
apache    1734  1707  0 12:02 ?        00:00:00 [httpd]
apache    1735  1707  0 12:02 ?        00:00:00 [httpd]
apache    1736  1707  0 12:02 ?        00:00:00 [httpd]
apache    1737  1707  0 12:02 ?        00:00:00 [httpd]
apache    1738  1707  0 12:02 ?        00:00:00 [httpd]
root      1872  1826  0 12:44 pts/0    00:00:00 grep httpd

Average of ratings: -
In reply to Patrick Lee

Re: server memory cannot release

by Genner Cerna -
I've notice this too...
In reply to Patrick Lee

Re: server memory cannot release

by Mark Stevens -
I'm sorry I don't know about your particular problem, but can you get more RAM?  128MB seems very small nowadays, and more RAM cannot hurt smile
In reply to Mark Stevens

Re: server memory cannot release

by Patrick Lee -

Thank you for your advise.

My moodle server just is in testing stage so that using 128MB. But i just used one browser to access my moodle server, i don't know why it has slow preformance.

By the way, i need to restart apache server for memory release.

Any configuration file need pay attention?

In reply to Patrick Lee

Re: server memory cannot release

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
httpd by default will hang on to memory for its processes and keep processes running .... one httpd process will serve lots of pages.  This avoids having to continually start new processes.  You can tinker with settings in your httpd.conf to change the number of threads that are kept active.

Also, Linux in general will keep a lot of stuff active in "free" memory just because it can, in case you need it again.  When memory is needed these are purged.  Your server has stabilised on 30Mb of this cache which seems reasonable.

Finally, 128Mb is not much, unless you know how to really pare down the system to remove unnecessary processes and kernel modules.

Your performance may not even be related to memory though.  What sort of CPU do you have?  I would also recommend a PHP accelerator.
In reply to Martin Dougiamas

Re: server memory cannot release

by Patrick Lee -

Thank you for your support.

I am using Intel Celeron 733 CPU. How much memory need to install into computer, I guess that 30-50 students in class at same time.

Please advise~smile

In reply to Patrick Lee

Re: server memory cannot release

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
My usual answer to such hardware questions is "as much as you can afford" ...  smile
In reply to Martin Dougiamas

Re: server memory cannot release

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
One of the most dispensible process for serviing up content is Xwindows. I assume you are not running that. Why not post a more complete list of running processesx and we might be able to suggest some that are less than entirely vital.
In reply to Marcus Green

Re: server memory cannot release

by Patrick Lee -

Hi Marcus,

I had installed Xwindows in linux but not start. It is running runlevel 3. Following are running processes.

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Jan07 ?        00:00:04 init
root         2     1  0 Jan07 ?        00:00:00 [keventd]
root         3     1  0 Jan07 ?        00:00:00 [kapmd]
root         4     1  0 Jan07 ?        00:00:00 [ksoftirqd_CPU0]
root         9     1  0 Jan07 ?        00:00:00 [bdflush]
root         5     1  0 Jan07 ?        00:00:00 [kswapd]
root         6     1  0 Jan07 ?        00:00:00 [kscand/DMA]
root         7     1  0 Jan07 ?        00:00:23 [kscand/Normal]
root         8     1  0 Jan07 ?        00:00:00 [kscand/HighMem]
root        10     1  0 Jan07 ?        00:00:00 [kupdated]
root        11     1  0 Jan07 ?        00:00:00 [mdrecoveryd]
root        15     1  0 Jan07 ?        00:00:00 [kjournald]
root        73     1  0 Jan07 ?        00:00:00 [khubd]
root      1464     1  0 Jan07 ?        00:00:00 syslogd -m 0
root      1468     1  0 Jan07 ?        00:00:00 klogd -x
rpc       1486     1  0 Jan07 ?        00:00:00 [portmap]
rpcuser   1505     1  0 Jan07 ?        00:00:00 [rpc.statd]
root      1573     1  0 Jan07 ?        00:00:00 /usr/sbin/apmd -p 10 -w 5 -W -P /etc/sysconfig/apm-scripts/apmscript
root      1610     1  0 Jan07 ?        00:00:00 /usr/sbin/sshd
root      1624     1  0 Jan07 ?        00:00:00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
root      1636     1  0 Jan07 ?        00:00:00 /bin/sh /usr/bin/safe_mysqld --defaults-file=/etc/my.cnf
mysql     1666  1636  0 Jan07 ?        00:00:07 [mysqld]
root      1680     1  0 Jan07 ?        00:00:00 [sendmail]
smmsp     1689     1  0 Jan07 ?        00:00:00 [sendmail]
root      1699     1  0 Jan07 ?        00:00:00 gpm -t imps2 -m /dev/mouse
root      1719     1  0 Jan07 ?        00:00:00 crond
root      1738     1  0 Jan07 ?        00:00:00 cupsd
xfs       1795     1  0 Jan07 ?        00:00:00 [xfs]
daemon    1813     1  0 Jan07 ?        00:00:00 [atd]
root      1821     1  0 Jan07 ?        00:00:00 login -- root
root      1822     1  0 Jan07 ?        00:00:00 login -- root
root      1823     1  0 Jan07 tty3     00:00:00 /sbin/mingetty tty3
root      1824     1  0 Jan07 tty4     00:00:00 /sbin/mingetty tty4
root      1825     1  0 Jan07 tty5     00:00:00 /sbin/mingetty tty5
root      1826     1  0 Jan07 tty6     00:00:00 /sbin/mingetty tty6
root      1835  1821  0 Jan07 tty1     00:00:00 -bash
root      1882  1822  0 Jan07 tty2     00:00:00 -bash
root      2277     1  0 Jan07 ?        00:00:02 /usr/sbin/httpd
apache    2280  2277  0 Jan07 ?        00:00:33 [httpd]
apache    2281  2277  0 Jan07 ?        00:00:45 [httpd]
apache    2282  2277  0 Jan07 ?        00:00:38 [httpd]
apache    2283  2277  0 Jan07 ?        00:00:42 [httpd]
apache    2284  2277  0 Jan07 ?        00:00:44 [httpd]
apache    2290  2277  0 Jan07 ?        00:00:35 [httpd]
apache    2296  2277  0 Jan07 ?        00:00:46 [httpd]
root      4249  1610  0 09:00 ?        00:00:00 /usr/sbin/sshd
root      4251  4249  0 09:00 pts/0    00:00:00 -bash
root      4292  4251  0 09:00 pts/0    00:00:00 ps -ef
root      4293  4251  0 09:00 pts/0    00:00:00 more

that's all

In reply to Patrick Lee

Re: server memory cannot release

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I am by no means an expert, but that looks like a reasonably slimline system. You are absolutly right to have install the X system, it can be very handy for some purposes, and you obviously know your stuff about run levels. The only think that I rasied a slight question mark about was if you need the CUPSD printer daemon running, but I have no idea if that would free up much ram anyway. Time for more RAM chips I guess.