hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Hosting Talk Tutorials : VPS Tutorials : VPS using too much RAM
Reply

Forum Jump

VPS using too much RAM

Reply Post New Thread In VPS Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 04-23-2007, 03:26 AM
mojtabaf mojtabaf is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 71

VPS using too much RAM


Hi

I have a VPS which is using xen technology.It's got 256mb of RAM and 512MB swap but when I got it, it was using more than 150MB of RAM.
I'm just running lighty and php-cgi .No more software(mysql , sendmail etc) with no CP.
How can I know what is using my RAM ?

how can I set the lighty and php to use swap memory since they don't use any swap?

Reply With Quote


Sponsored Links
  #2  
Old 04-27-2007, 05:58 AM
dbpalan dbpalan is offline
Junior Guru Wannabe
 
Join Date: Feb 2007
Posts: 34
Would you list all the tasks running (ps auxw)? The process list will provide you an idea what consumes most RAM from its columns VSZ and RSS. But it is hard to calculate the exact usage from the list.

VSZ is the "Memory Allocated" and RSS is the "Memory actually used". Linux is so clever that will identify if you have really "used" the RAM ("Use" means the application fill the allocated RAM with data) so that it can keep performance and swap at an excellent balance. Unfortunately the VPS plan may count you the VSZ for memory usage as your total usage.

What I fine tune my VPS:

1. Remove all unnecessary daemon
2. Fine tune MySQL (particularly disable innodb if not needed, and some cache options)
3. Fine tune Apache (dunno the case for lighttpd)
4. Fine tune PHP (eaccelerator options)

These actions reduce my RAM usage from 240MB to 95MB


Last edited by dbpalan; 04-27-2007 at 06:06 AM.
Reply With Quote
  #3  
Old 04-27-2007, 06:58 AM
mojtabaf mojtabaf is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 71
Hi Thanks for the reply.
I don't have mysql and I don't know anything about php eaccelerator.
Would you please send me a link to optimizing php?

Thanks
PHP Code:

USER       PID 
%CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1   2052   684 
?        Ss   Apr26   0:00 init [3]                                                                                                    
root         2  0.0  0.0      0     0 ?        S    Apr26   0:00 [migration/0]
root         3  0.0  0.0      0     0 ?        SN   Apr26   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S    Apr26   0:00 [watchdog/0]
root         5  0.0  0.0      0     0 ?        S<   Apr26   0:00 [events/0]
root         6  0.0  0.0      0     0 ?        S<   Apr26   0:00 [khelper]
root         7  0.0  0.0      0     0 ?        S<   Apr26   0:00 [kthread]
root         9  0.0  0.0      0     0 ?        S<   Apr26   0:00 [xenwatch]
root        10  0.0  0.0      0     0 ?        S<   Apr26   0:00 [xenbus]
root        16  0.0  0.0      0     0 ?        S<   Apr26   0:00 [kblockd/0]
root        17  0.0  0.0      0     0 ?        S<   Apr26   0:00 [cqueue/0]
root        21  0.0  0.0      0     0 ?        S<   Apr26   0:00 [khubd]
root        23  0.0  0.0      0     0 ?        S<   Apr26   0:00 [kseriod]
root        79  0.0  0.0      0     0 ?        S    Apr26   0:00 [pdflush]
root        80  0.0  0.0      0     0 ?        S    Apr26   0:00 [pdflush]
root        81  0.0  0.0      0     0 ?        S<   Apr26   0:00 [kswapd0]
root        82  0.0  0.0      0     0 ?        S<   Apr26   0:00 [aio/0]
root       224  0.0  0.0      0     0 ?        S<   Apr26   0:00 [kpsmoused]
root       271  0.0  0.0      0     0 ?        S<   Apr26   0:00 [kmirrord]
root       283  0.0  0.0      0     0 ?        S<   Apr26   0:00 [kjournald]
root       316  0.0  0.0      0     0 ?        S<   Apr26   0:00 [kauditd]
root       345  0.0  0.1   2136   540 ?        S<s  Apr26   0:00 /sbin/udevd -d
root       938  0.0  0.1   1716   584 
?        Ss   Apr26   0:00 syslogd -m 0
root       941  0.0  0.1   1656   408 
?        Ss   Apr26   0:00 klogd -x
rpc        961  0.0  0.1   1792   552 
?        Ss   Apr26   0:00 portmap
rpcuser    981  0.0  0.1   1804   728 
?        Ss   Apr26   0:00 rpc.statd
root      1006  0.0  0.1   4952   548 
?        Ss   Apr26   0:00 rpc.idmapd
dbus      1024  0.0  0.2   2724   864 
?        Ss   Apr26   0:00 dbus-daemon --system
root      1085  0.0  0.2   5200   944 
?        Ss   Apr26   0:00 /usr/sbin/sshd
root      1095  0.0  0.2   5236  1116 
?        Ss   Apr26   0:00 crond
root      1114  0.0  0.1   2220   440 
?        Ss   Apr26   0:00 /usr/sbin/atd
68        1124  0.0  0.7   4824  3124 
?        Ss   Apr26   0:00 hald
root      1125  0.0  0.2   2992   972 
?        S    Apr26   0:00 hald-runner
root      1139  0.0  0.2   2420  1040 xvc0     Ss   Apr26   0
:00 /bin/bash /sbin/autologin --
root      1141  0.0  0.2   2768  1088 xvc0     S    Apr26   0:00 su root
root      1142  0.0  0.5   5024  1996 xvc0     S
+   Apr26   0:00 -bash
lighttpd  1387  0.0  1.4  16768  5728 
?        Ss   Apr26   0:00 /usr/bin/php-cgi
lighttpd  1389  0.0  1.4  16764  5728 
?        Ss   Apr26   0:00 /usr/bin/php-cgi
lighttpd  1390  0.0  1.4  16764  5728 
?        Ss   Apr26   0:00 /usr/bin/php-cgi
lighttpd  1391  0.0  1.4  16768  5732 
?        Ss   Apr26   0:00 /usr/bin/php-cgi
root      3711  0.0  0.6   8184  2468 
?        Ss   03:00   0:00 sshdroot@pts/
root      3713  0.0  0.5   5024  2040 pts
/0    Ss+  03:01   0:00 -bash
root      4205  0.0  0.5   8048  2356 
?        Ss   05:10   0:00 sshdmojtabaf [priv]
mojtabaf  4207  0.0  0.3   8196  1436 ?        S    05:10   0:00 sshdmojtabaf@pts/2
mojtabaf  4208  0.0  0.5   5024  2012 pts
/2    Ss   05:10   0:00 -bash
root      4240  0.0  0.3   4808  1192 pts
/2    S    05:11   0:00 su
root      4241  0.0  0.5   5028  2032 pts
/2    S+   05:11   0:00 bash
lighttpd  4271  0.0  4.5  21360 17728 
?        S    05:11   0:05 /usr/sbin/lighttpd -/etc/lighttpd/lighttpd.conf
root      4280  0.0  0.5   8048  2336 
?        Ss   05:20   0:00 sshdmojtabaf [priv]
mojtabaf  4285  0.0  0.3   8196  1480 ?        S    05:21   0:00 sshdmojtabaf@notty
mojtabaf  4287  0.0  0.2   4332  1172 
?        Ss   05:21   0:00 /usr/libexec/openssh/sftp-server
root      4305  0.0  0.5   8048  2360 
?        Ss   05:23   0:00 sshdmojtabaf [priv]
mojtabaf  4307  0.0  0.3   8048  1416 ?        S    05:23   0:00 sshdmojtabaf@pts/3
mojtabaf  4308  0.0  0.5   5020  2004 pts
/3    Ss   05:24   0:00 -bash
root      4340  0.0  0.3   4808  1188 pts
/3    S    05:24   0:00 su
root      4341  0.0  0.5   5024  2028 pts
/3    S+   05:24   0:00 bash
root      4399  0.0  0.5   8044  2356 
?        Ss   05:38   0:00 sshdmojtabaf [priv]
root      4402  0.0  0.5   8048  2332 ?        Ss   05:39   0:00 sshdmojtabaf [priv]
mojtabaf  4404  0.0  0.3   8196  1440 ?        S    05:39   0:00 sshdmojtabaf@notty
mojtabaf  4405  0.0  0.2   4324  1168 
?        Ss   05:39   0:00 /usr/libexec/openssh/sftp-server
mojtabaf  4422  0.0  0.3   8044  1408 
?        S    05:39   0:00 sshdmojtabaf@pts/4
mojtabaf  4423  0.0  0.5   5020  2004 pts
/4    Ss   05:39   0:00 -bash
root      4453  0.0  0.3   4812  1196 pts
/4    S    05:39   0:00 su
root      4454  0.0  0.5   5024  2028 pts
/4    S+   05:39   0:00 bash
lighttpd  4910  0.4  1.5  18040  6084 
?        S    06:39   0:04 /usr/bin/php-cgi
lighttpd  4917  4.2  1.5  17988  6028 
?        S    06:50   0:11 /usr/bin/php-cgi
lighttpd  4918  1.7  1.5  18180  6236 
?        S    06:51   0:03 /usr/bin/php-cgi
lighttpd  4919  0.5  1.5  17488  6120 
?        S    06:53   0:00 /usr/bin/php-cgi
root      4920  0.0  0.5   8044  2356 
?        Ss   06:53   0:00 sshdmojtabaf [priv]
mojtabaf  4922  0.0  0.3   8044  1408 ?        S    06:54   0:00 sshdmojtabaf@pts/5
mojtabaf  4923  0.1  0.5   5020  2008 pts
/5    Ss   06:54   0:00 -bash
root      4953  0.0  0.3   4808  1188 pts
/5    S    06:54   0:00 su
root      4954  0.3  0.5   5028  2024 pts
/5    S    06:54   0:00 bash
root      4977  0.0  0.2   4232   968 pts
/5    R+   06:55   0:00 ps auxw 

Reply With Quote
Sponsored Links
  #4  
Old 04-27-2007, 11:31 AM
mistwang mistwang is offline
Web Hosting Guru
 
Join Date: Nov 2003
Posts: 304
It is a pretty clean linux box, process 1387-1391 should be killed, those are orphan FCGI PHP processes left by previous lighttpd instance. You need to clean it up manually from time to time.

__________________
LiteSpeed Web Server by http://www.litespeedtech.com
Best PHP and Ruby On Rails hosting platform,
Completely Apache interchangeable
Compatible with all hosting control panels.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?