New on LowEndTalk? Please Register and read our Community Rules.
Help with debian
Okay guys I am not a total linux guru. I get by but when it comes to debian I really am lost. I have our billing server
Running on a 512mb ram Xen Vps but memory usage always running near 450mb and slow page loads. I am using Lighttpd and mysql.
What would be some things to do with out killing the system and starting over to lower the memory usage?
Comments
MySQL always uses alot of RAM and CPU.
Billing systems can be heavy. You can however try tweaking Lighttpd to use less RAM and do less.
And yeah, MySQL is pretty heavy.
Also, this doesn't have anything to do with Debian. Debian is my favorite OS, and the lightest in my opinion.
why don't u optimize mysql?
I see people running wordpress on 64 mb vps I can't believe whmcs would use most of a 512 mb ram Xen vps
[email protected]:/etc/init.d# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 8516 832 ? Ss 14:42 0:00 init [2]
root 2 0.0 0.0 0 0 ? S 14:42 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 14:42 0:00 [migration/0]
root 4 0.0 0.0 0 0 ? S 14:42 0:00 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S 14:42 0:00 [watchdog/0]
root 6 0.0 0.0 0 0 ? S 14:42 0:00 [migration/1]
root 7 0.0 0.0 0 0 ? S 14:42 0:00 [ksoftirqd/1]
root 8 0.0 0.0 0 0 ? S 14:42 0:00 [watchdog/1]
root 9 0.0 0.0 0 0 ? S 14:42 0:00 [migration/2]
root 10 0.0 0.0 0 0 ? S 14:42 0:00 [ksoftirqd/2]
root 11 0.0 0.0 0 0 ? S 14:42 0:00 [watchdog/2]
root 12 0.0 0.0 0 0 ? S 14:42 0:00 [events/0]
root 13 0.0 0.0 0 0 ? S 14:42 0:00 [events/1]
root 14 0.0 0.0 0 0 ? S 14:42 0:00 [events/2]
root 15 0.0 0.0 0 0 ? S 14:42 0:00 [cpuset]
root 16 0.0 0.0 0 0 ? S 14:42 0:00 [khelper]
root 17 0.0 0.0 0 0 ? S 14:42 0:00 [netns]
root 18 0.0 0.0 0 0 ? S 14:42 0:00 [async/mgr]
root 19 0.0 0.0 0 0 ? S 14:42 0:00 [pm]
root 20 0.0 0.0 0 0 ? S 14:42 0:00 [xenwatch]
root 21 0.0 0.0 0 0 ? S 14:42 0:00 [xenbus]
root 22 0.0 0.0 0 0 ? S 14:42 0:00 [sync_supers]
root 23 0.0 0.0 0 0 ? S 14:42 0:00 [bdi-default]
root 24 0.0 0.0 0 0 ? S 14:42 0:00 [kintegrityd/0]
root 25 0.0 0.0 0 0 ? S 14:42 0:00 [kintegrityd/1]
root 26 0.0 0.0 0 0 ? S 14:42 0:00 [kintegrityd/2]
root 27 0.0 0.0 0 0 ? S 14:42 0:00 [kblockd/0]
root 28 0.0 0.0 0 0 ? S 14:42 0:00 [kblockd/1]
root 29 0.0 0.0 0 0 ? S 14:42 0:00 [kblockd/2]
root 30 0.0 0.0 0 0 ? S 14:42 0:00 [kseriod]
root 34 0.0 0.0 0 0 ? S 14:42 0:00 [kondemand/0]
root 35 0.0 0.0 0 0 ? S 14:42 0:00 [kondemand/1]
root 36 0.0 0.0 0 0 ? S 14:42 0:00 [kondemand/2]
root 37 0.0 0.0 0 0 ? S 14:42 0:00 [khungtaskd]
root 38 0.0 0.0 0 0 ? S 14:42 0:00 [kswapd0]
root 39 0.0 0.0 0 0 ? SN 14:42 0:00 [ksmd]
root 40 0.0 0.0 0 0 ? S 14:42 0:00 [aio/0]
root 41 0.0 0.0 0 0 ? S 14:42 0:00 [aio/1]
root 42 0.0 0.0 0 0 ? S 14:42 0:00 [aio/2]
root 43 0.0 0.0 0 0 ? S 14:42 0:00 [crypto/0]
root 44 0.0 0.0 0 0 ? S 14:42 0:00 [crypto/1]
root 45 0.0 0.0 0 0 ? S 14:42 0:00 [crypto/2]
root 48 0.0 0.0 0 0 ? S 14:42 0:00 [khvcd]
root 123 0.0 0.0 0 0 ? S 14:42 0:00 [kjournald]
root 217 0.0 0.1 16896 796 ? S<s 14:42 0:00 udevd --daemon
root 548 0.0 0.0 0 0 ? S 14:42 0:00 [flush-202:1]
root 1086 0.0 1.3 228104 7008 ? Ss 14:43 0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
www-data 1087 0.0 1.2 228104 6200 ? S 14:43 0:00 php-fpm: pool www
www-data 1088 0.0 1.2 228104 6200 ? S 14:43 0:00 php-fpm: pool www
root 1099 0.0 0.3 52652 1788 ? Sl 14:43 0:00 /usr/sbin/rsyslogd -c5
bind 1134 0.0 3.0 142920 15352 ? Ssl 14:43 0:00 /usr/sbin/named -u bind
root 1169 0.0 0.1 21068 984 ? Ss 14:43 0:00 /usr/sbin/cron
111 1199 0.0 0.1 29724 652 ? Ss 14:43 0:00 /usr/bin/dbus-daemon --system
www-data 1240 0.0 0.7 63844 3812 ? S 14:43 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
www-data 1249 0.0 3.5 273616 18076 ? Ss 14:43 0:00 /usr/bin/php-cgi
root 1292 0.0 0.1 4116 720 ? S 14:43 0:00 /bin/sh /usr/bin/mysqld_safe
www-data 1294 0.4 3.5 279704 17768 ? S 14:43 0:08 /usr/bin/php-cgi
mysql 1608 0.1 8.9 354116 45436 ? Sl 14:43 0:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/var/run/mysqld/mysqld.pid
root 1609 0.0 0.1 4024 676 ? S 14:43 0:00 logger -t mysqld -p daemon.error
root 1786 0.0 0.5 102596 2824 ? Ss 14:43 0:00 sendmail: MTA: accepting connections
root 2014 0.0 0.2 49432 1168 ? Ss 14:43 0:00 /usr/sbin/sshd
root 2195 0.0 0.6 70724 3416 ? Ss 14:43 0:00 sshd: [email protected]/0
root 2197 0.0 0.2 116496 1376 ? Ss 14:43 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
nobody 2198 0.0 0.3 270196 1760 ? Sl 14:43 0:01 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
root 2277 0.0 0.1 6088 628 tty1 Ss+ 14:43 0:00 /sbin/getty 38400 tty1
root 2278 0.0 0.1 6088 628 tty2 Ss+ 14:43 0:00 /sbin/getty 38400 tty2
root 2279 0.0 0.1 6088 632 tty3 Ss+ 14:43 0:00 /sbin/getty 38400 tty3
root 2280 0.0 0.1 6088 628 tty4 Ss+ 14:43 0:00 /sbin/getty 38400 tty4
root 2281 0.0 0.1 6088 632 tty5 Ss+ 14:43 0:00 /sbin/getty 38400 tty5
root 2282 0.0 0.1 6088 628 tty6 Ss+ 14:43 0:00 /sbin/getty 38400 tty6
root 2283 0.0 0.1 6088 632 hvc0 Ss+ 14:43 0:00 /sbin/getty 38400 hvc0
root 2284 0.0 0.1 16892 700 ? S< 14:43 0:00 udevd --daemon
root 2285 0.0 0.1 16892 700 ? S< 14:43 0:00 udevd --daemon
root 2286 0.0 0.4 17936 2052 pts/0 Ss 14:43 0:00 -bash
root 2328 0.0 0.6 10700 3380 pts/0 T 14:59 0:00 nano /etc/init.d/rc
root 2346 0.0 0.2 14972 1112 pts/0 R+ 15:16 0:00 ps aux
ps aux info
Tasks: 76 total, 1 running, 74 sleeping, 1 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 507568k total, 399532k used, 108036k free, 9076k buffers
Swap: 1048568k total, 0k used, 1048568k free, 280112k cached
Why are you running bind?
didn't see that one now uninstalled.
can anybody suggest how to get rid of
Setting up linux-image-2.6.32-5-amd64 (2.6.32-45) ...
Running depmod.
Running update-initramfs.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
update-initramfs: Generating /boot/initrd.img-2.6.32-5-amd64
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
entry not specified.
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.32-5-amd64.postinst line 799, line 2.
dpkg: error processing linux-image-2.6.32-5-amd64 (--configure):
subprocess installed post-installation script returned error exit status 2
configured to not write apport reports
always errors reported.
kill innodb
Optimize MySQL to run faster
217 root 16 -4 16896 512 424 S 0 0.1 0:00.06 udevd
not sure by my reading do I need this running?
You try maybe the man pages, etc http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udevd.html
Far as mysql, have you done any optimization at all to the my.cnf ? even the packages come with samples in such as -small -medium -large, the default one typically meant for rather large memory usage.
ps_mem.py output?
nice app @steve81 never seen that one before. Helped me alot and now it is fixed.
I run WHMCS on a 512mb OpenVZ VPS with no problem.
I use MariaDB and memory caching however for MySQL
@24khost: You're welcome.
I'd typically get rid of dbus-daemon and reduce the amount of gettys to 1. That'll save a few megs here and there. Use another shell like pdksh instead of bash. If you can offload Postfix, do it. Dropbear instead of sshd.
Statistically speaking, do you have a true need for 3 concurrent php processes? Maybe you can elimiante one or two depending on your systems' usage. Along the same line of thinking, do you truly need varnish?
My WHMCS is running off 128MB KVM with @prometeus but then again, it does not have thousands of customers accessing it per day. The total users who use it everyday are average 75-100 and its going great!!
Yeah @Asim it was some things that were running but I fixed it. Not a total linux newby but Debian is a different beast than centos.
Indeed, I dont like networking in centos at all.
use MyISAM instead of Innodb .. if you are not expecting row level locks .. also instead of lighttpd .. you can try nginx ..
Why would you go cheap on your billing software, it's the most valuable thing for your business and with these prices nowadays you're making it yourself pretty hard.
He's using WHMCS like 97% of the other hosts here...
Yeah, I was going to say that too.
Although I think he means "cheap", as in using a 512 MB VPS, instead of a dedicated server or something.
Though some host know enough linux/etc to be able to lock down whatever WHMCS misses.
In that same vein... why we all being so "Cheap" with solusvm?