VPS with Virtualmin

Hi,

I tried looking for the answer, but I couldn’t find it so here it is my question:

I have a VPS with 512 RAM and 1GB burst. I installed a Centos with a minimum setup (only using 4 MB) after that I installed wget and perl using yum to install virtualmin. After installing virtualmin the memory usage jump to 278MB~300MB. I am not running postgres, FTP, email. I only run apache, PHP and MySQL.

Why there is so much memory usage?

Virtualmin itself uses a pretty small amount of RAM, about 30MB on my system here.

So what you’re likely seeing is a daemon, or perhaps a group of daemons, that’s using some RAM. It’s not unusual to see Apache, PHP, and MySQL to use quite a bit of RAM.

If you’d like to see what processes are using up your memory, you can log onto the command line, and type “ps auxw”.

Also, you can review this guide for some thoughts on tuning memory usage:

http://www.virtualmin.com/documentation/system/low-memory

i was up around 300mb usage when i first installed , but i got it down to about 177mb by disabling various features/process/daemons i wasnt needing.

(my vps is limited to 512 too)

Hi,

Thank you for your reply. After executing the recommended command this is what I get:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 2148 660 ? Ss Oct02 0:00 init [3] root 7702 0.0 1.2 32308 12728 ? Ss 08:23 0:00 /usr/sbin/httpd apache 7703 0.0 0.3 21796 3308 ? S 08:23 0:00 /usr/sbin/httpd apache 7717 0.0 0.6 32444 7072 ? S 08:23 0:00 /usr/sbin/httpd apache 7719 0.0 0.6 32444 7072 ? S 08:23 0:00 /usr/sbin/httpd apache 7720 0.0 0.5 32308 6008 ? S 08:23 0:00 /usr/sbin/httpd apache 7722 0.0 0.5 32308 6008 ? S 08:23 0:00 /usr/sbin/httpd apache 7725 0.0 0.5 32308 6008 ? S 08:23 0:00 /usr/sbin/httpd apache 7726 0.0 0.5 32308 6008 ? S 08:23 0:00 /usr/sbin/httpd apache 7727 0.0 0.5 32308 6008 ? S 08:23 0:00 /usr/sbin/httpd apache 7729 0.0 0.5 32308 6008 ? S 08:23 0:00 /usr/sbin/httpd root 9414 0.0 0.1 3700 1308 ? S 08:23 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log- mysql 9476 0.0 1.7 136892 18076 ? Sl 08:23 0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/my root 11661 0.0 0.0 2240 640 ? S<s Oct02 0:00 /sbin/udevd -d named 12028 0.0 0.3 70996 3636 ? Ssl Oct02 0:00 /usr/sbin/named -u named dbus 12053 0.0 0.0 2832 656 ? Ss Oct02 0:00 dbus-daemon --system root 12280 0.0 0.1 4484 1112 ? Ss Oct02 0:00 crond root 13312 0.0 0.0 5664 712 ? Ss Oct02 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam root 13313 0.0 0.0 5664 440 ? S Oct02 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam root 13314 0.0 0.0 5664 428 ? S Oct02 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam root 13315 0.0 0.0 5664 428 ? S Oct02 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam root 13316 0.0 0.0 5664 428 ? S Oct02 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam root 13332 0.0 0.8 14252 8992 ? Ss Oct02 0:00 /usr/bin/perl /usr/libexec/usermin/miniserv.pl /etc/usermin/miniserv.conf root 13337 0.0 0.6 11632 6352 ? Ss Oct02 0:00 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf root 15841 0.0 0.1 7180 1064 ? Ss Oct02 0:00 /usr/sbin/sshd 500 23776 0.0 0.7 22524 8284 ? S 15:26 0:00 /usr/bin/php-cgi root 24175 0.0 0.2 10016 2908 ? Ss 17:36 0:00 sshd: root@pts/0 root 24215 0.0 0.1 3700 1460 pts/0 Ss 17:36 0:00 -bash root 24245 0.0 0.0 2524 920 pts/0 R+ 17:36 0:00 ps auxw

I just for testing disable apache and MySQL and the memory usage went down to 119MB.

What I am missing?

Thank you

What are you using to determine your memory usage?

You can see your memory usage by running “free -m” on the command line… but you’ll need to note that the cache/buffers lines should actually be considered free memory. Linux keeps them for caching if they’re not needed, but as soon as an app needs them, they’re made available.

In your output above, it looks like BIND (your DNS server) is using about 70MB of RAM, Virtualmin is using about 11MB, Usermin is at 14MB… every process there is using some amount of RAM, it’s simply that a little bit here and there adds up :slight_smile:

-Eric

An alternative tool to real-time display memory usage (among many other things) is “atop”. Can help to find dynamic memory usage spikes too. I also find it somewhat better-arranged than (even if very similar to) “ps”.

Hi,

I disable the BIND DNS ( as I am not using it ) and the memory usage drop. I did the low memory setup for MySQL and it is still using over 120MB of memory with only a couple of empty tables and no one accessing them.

I was also looking a Apache configuration when I noticed that all the following modules are loaded when apache run:

LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_alias_module modules/mod_authn_alias.so LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule ldap_module modules/mod_ldap.so LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule include_module modules/mod_include.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule ext_filter_module modules/mod_ext_filter.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule expires_module modules/mod_expires.so LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule info_module modules/mod_info.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule cache_module modules/mod_cache.so LoadModule suexec_module modules/mod_suexec.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule file_cache_module modules/mod_file_cache.so LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule cgi_module modules/mod_cgi.so LoadModule version_module modules/mod_version.so

I was looking around for the list of the minimum necessary Apache modules to run Drupal, but I couldn’t find it. Any suggestion?

Once again thank you for the help.

youd have to look into drupal id say.

ive used command ‘top’ and ‘free -m’ but i think my himonitor script gets it from /proc/meminfo

im not that sure either how to get accuate reading for an individual process…

not sure if youve seen this:

http://www.virtualmin.com/documentation/system/low-memory