New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
High RAM usage, but why?
Hey everyone.
I have two lowend VPSes I use for development/testing. A 128MB Xen VPS running Debian, Apache, MySQL and PHP and another VPS with 384MB of RAM running Deiban, Nginx, MySQL and PHP.
Both VMs have 'stock configurations', in that the software stacks have been unmodified from downloading/installation.
My question is, is it normal for a VM with no use and such a basic setup to require 100+MB of RAM?
The LAMP stack on the 128MB Xen platform uses 126MB on a straight-up default configuration.
The LEMP stack on the 384MB OpenVZ platform uses 183MB on a straight-up default configuration.
But why?
root@vps:~# ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 2024 676 ? Ss Nov30 0:01 init [2] root 1383 0.0 0.2 8664 792 ? Ss Nov30 0:00 /usr/sbin/saslauthd -a pam -c -m /var/run/saslauthd -n 2 root 1384 0.0 0.1 8664 508 ? S Nov30 0:00 /usr/sbin/saslauthd -a pam -c -m /var/run/saslauthd -n 2 root 1398 0.0 0.1 1732 652 ? Ss Nov30 0:00 /sbin/syslogd root 1434 0.0 0.2 2284 844 ? Ss Nov30 0:00 /usr/sbin/cron root 1583 0.0 0.2 2388 836 ? Ss Nov30 0:00 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6 root 1605 0.0 0.3 9988 1548 ? Ss Nov30 0:00 sendmail: MTA: accepting connections bind 5233 0.0 2.3 42724 9216 ? Ssl Nov30 0:00 /usr/sbin/named -u bind root 5331 0.0 0.2 5484 968 ? Ss Nov30 0:00 /usr/sbin/sshd root 5377 0.0 0.7 5340 2860 ? Ss Nov30 0:00 /usr/sbin/apache2 -k start www-data 5427 0.0 0.7 5668 2820 ? S Nov30 0:00 /usr/sbin/apache2 -k start www-data 17654 0.0 0.6 5500 2648 ? S Nov30 0:00 /usr/sbin/apache2 -k start root 18428 0.0 0.3 2680 1236 ? S Nov30 0:00 /bin/sh /usr/bin/mysqld_safe mysql 19564 0.0 4.7 137212 18636 ? Sl Nov30 0:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/va root 19566 0.0 0.1 1664 584 ? S Nov30 0:00 logger -t mysqld -p daemon.error www-data 19721 0.0 0.6 5612 2692 ? S Nov30 0:00 /usr/sbin/apache2 -k start www-data 19722 0.0 0.6 5500 2648 ? S Nov30 0:00 /usr/sbin/apache2 -k start www-data 21540 0.0 0.6 5492 2596 ? S Nov30 0:00 /usr/sbin/apache2 -k start root 22320 0.0 0.7 8540 3012 ? Ss 04:47 0:00 sshd: root@pts/0 root 22342 0.0 0.4 2968 1652 pts/0 Ss 04:48 0:00 -bash root 22369 0.0 0.7 8540 3012 ? Ss 04:50 0:00 sshd: root@notty root 22371 0.0 0.2 1920 796 ? Ss 04:50 0:00 /usr/lib/openssh/sftp-server root 22409 0.0 0.2 2344 928 pts/0 R+ 05:01 0:00 ps aux
Comments
Hell, even when I used the lowendscript or the Centmin scripts to install the software stacks I -STILL- get high ram usage when in fact I should be using 40-60MB max. Why is that?
Apache, Mysql, sendmail and Openssh use tons of RAM so i guess it is normal.
Well, I guess my next question would be what (in particular) should I do to tweak Apache and MySQL to perform their (easy/simple) task of serving practically nothing? They're both dev VPSes each with stock Wordpress installation on them with no traffic. I thought the amount of RAM for both would be enough to serve just a stock wordpress install. I set these up so I could get more familiar with Apache and Nginx and learn how to stop relying on things such as cPanel (Even though I got a nice cPanel VPS elsewhere for production sites, hehe) and to become more familiar with OSes other than CentOS.
Thanks.
I always reboot after running LEScript just to see what happens with memory. Running apt-get seems to use up available memory.
Are you sure you're not looking at memory being put aside for cache?
Hmm, how would I know/check to see what memory is being used for cache? I think I solved the issued on the LNMP stack, but the LAMP stack on the Xen VM w/128MB ram is still using 126MB when I use 'free -m'.
I just did a clean reinstall of Debian 5 32bit and installed the lowendscript software stack and it appears to be running as expected now, using just 50MB of RAM with a stock wordpress installation.
Going to hit it with Loadimpact now to see what the memory does with some 'visits'.
I can't read that hell of output u_u
And where says 126MB or 183MB?
MySQL INNODB uses about 100MB on some systems. Just disabling it alone frees up a good deal of memory. Then again, MySQL MyISAM is useless as a reliable database engine so you're better off moving to PostgreSQL or SQLite.
Yeah same thought to try that, also with the difference in OVZ and XEN memory allocation, anyway, @op in Debian/Ubuntu add "skip-innodb" to /etc/mysql/my.cnf, then restart mysql server and check memory usage.
Disable named and you'll see
named eats a lot of memory
Yeah. Looks at the VSZ column of named. That's going to use a lot of memory on OpenVZ VPS.