Reply to topic
Memory Usage
decartwr


Joined: 14 Nov 2006
Posts: 4
Reply with quote
I have a Linux VPS with 256 Mb of RAM. When I restart the VPS, I'm immediately at 75% of system usage, and within a few minutes I'm at 90% (I'm looking at Virtuozzo -> Resources -> System Usage).

As this slowly continues to creep upwards, I start getting failures in various services (FTP, parts of PLESK).

I'm running 3 domains on this VPS, using PHP and mySQL.

1) Should I simply get more memory for this VPS, or
2) Should I change my configuration? Perhaps I'm running services I don't need?

Suggestions?
dbodner


Joined: 21 Dec 2005
Posts: 112
Location: Philadelphia, Pa
Reply with quote
Plesk itself runs off of a MySQL backend, so it tends to be more memory intensive than other control panels.

It's quite possible that an upgrade in RAM is in order. Even just upgrading to 512 MB, you typically see a large performance increase.

Before doing that, I would submit a ticket with support, and have them take a look at it. Typically what we'll do is install a script which logs the highest memory intensive apps every X amount of minutes, to try to determine some kind of consistency, and whether there's a configuration issue or just the result of using memory intensive apps.

Also, could you do a ps aux and paste the results here?
ps aux report
decartwr


Joined: 14 Nov 2006
Posts: 4
Reply with quote
Here is what ps aux had to say:
Code:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   1668   616 ?        Ss   Nov13   0:00 init
root      9740  0.0  0.0   1540   616 ?        Ss   Nov13   0:00 syslogd -m 0
named     9758  0.0  0.0  31352  3020 ?        Ssl  Nov13   0:00 /usr/sbin/named
root      9772  0.0  0.0   4324  1772 ?        Ss   Nov13   0:00 /usr/sbin/sshd
root      9780  0.0  0.0   2104   956 ?        Ss   Nov13   0:00 xinetd -stayali
root      9839  0.0  0.0   2228  1128 ?        S    Nov13   0:00 /bin/sh /usr/bi
mysql     9874  0.0  0.3 114876 26308 ?        Sl   Nov13   0:00 /usr/libexec/my
qmails    9937  0.0  0.0   1520   484 ?        S    Nov13   0:00 qmail-send
qmaill    9939  0.0  0.0   1476   456 ?        S    Nov13   0:00 splogger qmail
root      9940  0.0  0.0   1504   372 ?        S    Nov13   0:00 qmail-lspawn ./
qmailr    9941  0.0  0.0   1500   400 ?        S    Nov13   0:00 qmail-rspawn
qmailq    9942  0.0  0.0   1468   348 ?        S    Nov13   0:00 qmail-clean
root      9963  0.0  0.1  33344 15364 ?        Ss   Nov13   0:00 /usr/sbin/httpd
root      9995  0.0  0.1  19248  8972 ?        S    Nov13   0:00 /usr/sbin/httpd
root     10056  0.0  0.0  48016  5528 ?        Ss   Nov13   0:00 /usr/local/psa/
psaadm   10060  0.0  0.2  56784 20052 ?        S    Nov13   0:00 /usr/local/psa/
root     10097  0.0  0.0   2500  1080 ?        Ss   Nov13   0:00 crond
root     10104  0.0  0.0   4360  1256 ?        Ss   Nov13   0:00 /usr/sbin/sasla
psaadm   11500  0.0  0.2  54636 19936 ?        S    Nov13   0:00 /usr/local/psa/
psaadm   11517  0.0  0.2  56240 18356 ?        S    Nov13   0:00 /usr/local/psa/
apache   13480  0.2  0.2  40280 21692 ?        S    Nov13   1:25 /usr/sbin/httpd
apache   14151  0.2  0.2  39168 20604 ?        S    03:44   0:43 /usr/sbin/httpd
apache   14153  0.2  0.2  39376 20828 ?        S    03:44   0:43 /usr/sbin/httpd
apache   28487  0.2  0.2  39572 21024 ?        S    04:17   0:39 /usr/sbin/httpd
apache    9598  0.7  0.2  40204 21628 ?        S    07:23   0:18 /usr/sbin/httpd
root     21694  0.0  0.0   8680  2708 ?        Ss   07:58   0:00 sshd: root@ttyp
root     21722  0.0  0.0   2244  1304 ttyp0    Ss   07:58   0:00 -bash
root     23780  0.0  0.0   2336   804 ttyp0    R+   08:03   0:00 ps aux
dbodner


Joined: 21 Dec 2005
Posts: 112
Location: Philadelphia, Pa
Reply with quote
Doesn't look like there's anything there that's extraneous. Create a ticket in support, have them look at it. At the least they can install the script I mentioned so they can pin down which apps are using the most memory consistently.
additude


Joined: 10 Oct 2005
Posts: 5
Reply with quote
I had something like this happen on my server and it ended up being a "possible" breakin and my server was being used to send spam.

But my problem was the excessive emails outgoing and bouncing back.
nathacof


Joined: 24 Oct 2006
Posts: 93
Location: Bear, DE
Reply with quote
I've read that Linux will report memory usage higher than the amount of memory actually in use. It appears as if a lot of your RAM is in use, but at times it could be that the VPS is actually using it's free RAM for buffers. A better method of determining your memory performance would be to check the amount of swap space that is used.

This can be accomplished on the command line by running the command "free". This is the output from my shared server:

-bash-3.00$ free
total used free shared buffers cached
Mem: 4149144 4106484 42660 0 487840 3357560
-/+ buffers/cache: 261084 3888060
Swap: 2040212 160 2040052
-bash-3.00$

As you can see used memory is almost 100% of the total memory, but swap space is only using 160/2040052. So I would say that this server has a sufficient amount of RAM.
dbodner


Joined: 21 Dec 2005
Posts: 112
Location: Philadelphia, Pa
Reply with quote
The problem with that is the report from free on a VPS will be for the entire node, not your individual instance. At least I believe that's the way Virtuozzo will handle it.
decartwr


Joined: 14 Nov 2006
Posts: 4
Reply with quote
If we accept that Unix is using RAM for file-related purposes, does it give that up when a process needs RAM? For example, if a process running FTP needs RAM, can it get it, will Unix yield up a buffer in order to satisfy that request? My problem was services actually not working properly. I increased the RAM, and that fixed the problems.

Thus, I didn't feel like I merely had a reporting problem. I had stuff failing.

Do I have to tell Unix not to use so much space for buffers?
nathacof


Joined: 24 Oct 2006
Posts: 93
Location: Bear, DE
Reply with quote
The problem with that is the report from free on a VPS will be for the entire node, not your individual instance. At least I believe that's the way Virtuozzo will handle it.


Doh!
01mysite


Joined: 16 Mar 2007
Posts: 2
Reply with quote
Virtuozzo runs all VPS instances (called VE for Virtual Environment) on the same kernel as the hardware node. Each instance has its own Apache configuration, MySQL configuration, processes, etc. I think you need stop some services on your VPS.

-------------------------------------------
software reviews
whitesites


Joined: 05 Jul 2004
Posts: 157
Location: Houston, TX
Reply with quote
256 VPS doesn't give you alot of room. Even though I am on a windows VPS and not a linux, I figured out this the hard way. If you want to run smarterstats, smartermail, mySQL I would try to keep those on a remote machine, or even a shared hosting account. If you want to save some memory move starterstats to you local developer machine, and have it retrieve the logs via FTP. this will free up at least 50 Megs on your VPS. Then reduce the number of threads smartermail uses and this will reduce the memory consumption for this. MySQL amazingly leaves a very small footprint in your memory. Only other solution is to upgrade to a 512 or 1G VPS
Keith


Joined: 05 Oct 2005
Posts: 17
Reply with quote
Agreed. Not sure on what the general thought is, but 256MB is nowhere enough to run a functional vps account. At times I wonder why we even host these, even so much with the Windows vps accounts. If you can get a vps that has 512MB or even 1GB, do it. You'll be happy that you did.
dbodner


Joined: 21 Dec 2005
Posts: 112
Location: Philadelphia, Pa
Reply with quote
Entirely depends on what you're looking to run. If you're looking to setup a VPS to be a "website in a box", with the webserver, database backend, email, dns, and a control panel, then yeah, there's no shot. (one might argue that running all of those services on one box regardless of the power of the server is a bad idea in and of itself, but that's a different discussion). However, I do think a 256 MB VPS serves a purpose. For example, if someone's looking to run a DNS server by itself, a 256 MB VPS with no control panel could handle a decent amount of traffic with ease. If you're looking to run one or two websites off of a 256 MB VPS, you're best bet is to go without a control panel, run DNS somewhere else, and limit it to Apache/PHP/MySQL and you have a chance. If you're looking to host multiple sites and provide a hosting service to customers, a 256 MB VPS is going to leave you seriously disappointed.
Memory Usage
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic