Memory On OpenVZ
Oct 31, 2009How I can see how much guaranteed memory I have ? And how I can see how much guaranteed memory I have used ?
Additional how I can see how much bustable memory I have used or how much total memory my VPS is using.
How I can see how much guaranteed memory I have ? And how I can see how much guaranteed memory I have used ?
Additional how I can see how much bustable memory I have used or how much total memory my VPS is using.
When my OpenVZ VPS is running with lighttpd, RAM usage is very low, but when I switch to Apache, RAM usage goes all the way up to the max. I've had this happen to two VPSs already and can't figure out why this happens.
I also have two other VPSs, one Xen and one Virtuozzo and have no troubles with Apache.
Let say your VPS has 128MB of memory. My understanding would be that if you had, say, another 128MB of 'burstable' memory, that if another guest on the system wasn't using all it's memory, or if there was some spare on the system, then your VPS could use that.
But, how much memory does your VPS really think it has available? and what happens if the other VPS (or the system) decides it wants it memory back?
Does OpenVZ just start killing off your processes until it free's up enough memory?
How to limit memory for VE on openvz
Boys how to limit the memory Guaranteed of one VE in MB example:
128MB
256MB
512MB
1024MB
2048MB
How to set this to the VE?
Few months ago I bought new small VPS box (OpenVZ, 128 MB RAM) in order to place there a new monitoring node of my site monitoring system. Such small amount of RAM is a challenge for operating system optimisation techniques (OpenVZ doesn’t have “swap” as Xen does).
First of all I discovered that apache2-mpm-worker (Apache implementation that uses threads) consumes more memory (100MB) than the classic version that use separate processes (20MB). I had to switch to apache2-mpm-prefork version then.
Next unpleasant suprise: small Python app eats 100MB of virtual memory! I checked that virtual (not resident) memory is taken into account by VPS. I applied some tools to locate memory bottleneck, but without success. Next I added logs with current memory usage to track call that causes big memory consumption. I tracked the following line:
server = WSGIServer(app)
is guilty for high memory increase. After few minutes of googling I located problem: default stack size for a thread. Details:This line creates few threads to handle concurrent calls
Stack size is counted towards virtual memory
Default stack size is very high on Linux (8MB)
Every thread uses separate stack
=> multi threaded application will use at least number_of_threads * 8MB virtual memory!
First solution: use limits.conf file. I altered /etc/security/limits.conf file and changed default stack size. But I couldn’t make this change to alter Python scripts called from Apache (any suggestions why?).
Second (working) solution: lower default stack size using ulimit. For processes launched from Apache I altered /etc/init.d/apache2 script and added:
ulimit -s 256
Now every thread (in apache / Python application) will use only 128 kB of virtual memory (I lowered VSZ from 70 MB to 17 MB this way). Now I have additional space to enlarge MySQL buffers to make DB operations faster.
There’s even better place to inject ulimit system-wide: you can insert this call in:
/etc/init.d/rc
script. Then ulimit will be applied to all daemons (as Apache) and all login sessions. I reduced virtual memory usage by 50% this way.
Note: you may increase stack size on stack overflow errors. In my opinion 256 kb is safe option for most systems, you may increase if in doubt. Still memory savings are big.
We're in the process of setting up our new VPS Server, and we can create a VPS with 256MB memory and with 512MB memory fine, but when creating one with 1GB memory, we get the error:
Could Not Start Vps, Reason: Unable to fork: Cannot allocate memory: Not enough resources to start environment: Container start failed:
Even though the server has 4GB RAM and no other VPS's running. Any ideas?
Thanks.
[Edit]We now seem to get the problem for all our VPS's. I think it may be something to do with the Server not unallocating the memory, as we've provisioned and de-provisioned quite a few Servers
[openvz ]How to make for kernel of openvz to recognize 4GB of ram?
How to make for kernel of openvz to recognize 4GB of ram?
# uname -a
Linux xxxxxxxxxxx 2.6.18-92.1.13.el5.028stab059.3 #1 SMP Wed Oct 15 17:48:55 MSD 2008 i686 i686 i386 GNU/Linux
I have a VPS. And have had an issue both when it was 1Gig and now I recently downgraded it to 768m, because I am moving some sites to a dedicated.
However, the part I am having trouble grasping is that when I look at graphs from Munin, it will typically always show 200-400MB free memory (and free -m and top agrees with munin), but Munin shows 'committed' memory that is above the total Ram on the VPS and once the 'committed' ram exceeds the VPS limit, processes start failing.
So, why is 'committed' memory exceeding the RAM on my VPS, when Munin, free -m and top all show there is free memory available?
Code:
root@server [~]# free -m
total used free shared buffers cached
Mem: 768 449 318 0 0 0
-/+ buffers/cache: 449 318
Swap: 0 0 0
Here's a graph that munin produces that shows the 'committed' memory exceeding the total memory.
[url]
I just got a new server Dual E5520 with 6GB RAM, SAS 15k rpm raid10. It's running well. However, the memory usage is just around 2.5GB, even when I have more traffic. Here is the kernel info
Quote:
# uname -a
Linux server2.[url]2.6.18-128.1.10.el5 #1 SMP Thu May 7 10:35:59 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
Any idea that we can put more content into memory?
I just ordered a server from serverbeach that should have come with 2 GB but I see that this one comes with 8 GB
Unfortunately, I seem to be missing 7 GB of ram.
Installed Physical Memory: 8 GB
Total Physical Memory: 1 GB
Windows 2008 Server Web 32-bit
Now, being a 32-bit system, I should see 3-4 GB of ram right?
Any idea why only 1 GB is available for the OS?
[url]
I have a 512mb DV server with Mediatemple, which I am running 24 (ish) domains off (most of them static websites) and a teamspeak server. I would say MAX theres 10 users online at a time)
Now, I know its running out of memory because i get frequent QoS Alerts in plesk (kmemsize is apparently the memory size):
Oct 01, 2009 11:52:57 AMBlack zonekmemsize
I have attached my results (when I did top).
My questions are:
1. Should I be expecting to be out of memory running what I am?
2. Is there a way to see the problem domains (memory wise)?
3. Are there any ways I can reduce the memory? (I have followed this already:
[url]
4. Where is the memory usage coming from (I am finding it very hard to understand TOP)
Can anybody advise, or provide somewhere which advises on the pros/cons of OpenVZ and Xen virtualisation platforms?
View 14 Replies View RelatedWell which one?
Also if possible say why you prefer either OpenVZ or Xen.
I am being told that when a VPS in openvz hits the maximum ram assigned to it that openvz disables that vps.
Isn't the ram limit a hard limit that simply restricts the available ram to that container to XX ram?
Is this normal?
We are looking for a VPS to house a scala framework running on a JVM, from what I can gleen Xen would be the best route for us or is it possible that openVZ with enough dedicated ram would suffice, does anyone have a view on this?
View 6 Replies View RelatedJust how it actually works? I have a pretty good knowledge about Xen and Linux KVM (somewhat about VMware as well). Prior to joining WHT, I rarely heard about Virtuozzo and OpenVZ.
I'm just interested in RAM usage actually. I also read on some threads that you can oversell storage and net bandwidth as well? That just seems a little weird to me.
I also used a fairly good amount of Solaris Zones as well.
Example, if I have a 8GB box and I leave some, say 512MB, reserved for CT0. 8192-512=7680 (I know the ACTUAL RAM amount will NOT be 8192), that leaves 7680MB use for CTs. So technically in OpenVZ if you dice out dedicated 512MB VEs... you end up with 15 right?
So you are able to sell more than 15 VPSs on a 8GB server box? If also set all burstable RAM to 1GB for all VEs.
In Xen, when you set dedicated RAM it is taken away from dom0, period. That's all there is to it, no oversell (Xen 3.3+ you can use ballooning to overcommit RAM, I know).
Within CT in VZ, user is able to check beancounters to see the guaranteed/burstable RAM. Technically you can't lie to the users.
I researched around... when oversell in VZ and the RAM gets maxed out... VZ will try to slow/stop/kill processes in order to keep the guests happy, to me that's just dangerous. Why needs to kill processes for RAM saturation?
Anyone can shed some lights for me? Or point me to an article(s). It can be technical, I should be able to grasp.
I am trying to create some vps using openvz but after creating the vps with the Centos basic template 304mb i can't ping the ip and i can't view the centos welcome page in my browser (using ip and not domain, so i don't need to change there anything yet) and the most important is that i can't connect to the vps using ssh
I aks for many good users about my problem but i don' found a solution yet.
I ask my DC about ip's and they told me that the ip's are routed in my server.
I follow this instructions:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 2.8G 44G 6% /
/dev/sda3 198M 21M 168M 11% /boot
/dev/sda5 408G 2.4G 385G 1% /vz
tmpfs 1012M 0 1012M 0% /dev/shm
I follow this:
I disable selinux by editing /etc/sysconfig/selinux and changing the line to selinux=disabled
and then run:
I just login using ssh as root and run the folllowing commands.
Did i have to move to another directory to run them or ?
setenforce 0
wget[url]
Next i open /etc/grub.conf
vi /etc/grub.conf
and change default=1 to default=0
Then i add the ip's at the pool and create a plan and then create a vps without any errors but nothing.
I try with my DC resolvers or the 4.2.2.1 4.2.2.2 but nothing.
I alo add at the settings the gateway with no results at all.
After all i can't ping the ip that the vps got from the pool even ping it and not possible to connect to it using the ssh Sad
When you're creating VPS container, you can ssh with that IP and login with your username and password correct? But, what is the problem when I successfully created a VPS, and when trying ssh into it, I can't. Ok, here we go. I want to create a 2nd vps and will be using it as my DNS server. I enter a set of IPs into HyperVM's IPpool. First IP: x.x.x.178 Last IP: x.x.x.182 Resolv Entries (space Separated) : Gateway (IP): x.x.x.x.177 NetMask: 255.255.255.248
Then I created a vps resource plan. And then I created a VPS and it use the first IP from above. I want to connect to SSH and want to make it as my DNS server but seems the IP are not responding, it wasn't even live. So, what is the problem here? Where I did wrong? Just to let you know, I successfully created 1 VPS before that and it works without any hiccups. Got even whm/cpanel installed as well on it. The thing that I suspected is that my DC pulled the IPs off me and assigned them to other server. Waiting for their reply on this though.
What does OpenVZ / w HyperVM
Can I distribute VPS through?
When i using openvz to create VPS, and RHEL4 needed yum installed.
I don't know how to install yum on it.
i have dedicated server. i want install hypervm on this server my work is sell vps.
of your seems xen is better or openvz for my work?
server is :
Intel 2.13Ghz Quad-Core Xeon X3210 Dell PowerEdge 840, 1066MHz, 2x4 MB L2 Cache
4GB DDR2 RAM
2x250GB HDD
I'm trying to convince someone into a project. He's not sure if OpenVZ is well known.
Do you know of it?
recently I got a VPS from cheapvps.co.uk and so far so good. Im getting used to the VPS enviroment. I tried to follow several guides about how to secure with noexec and nosuid the /tmp and /var/tmp and it did not work.
in http : / / www . webhostingtalk .com/showthread.php?t=474681&highlight=tmp points it must be done from the hosting. Same is said in http : // kb . swsoft . com/article_130_648_en.html.
I asked the hosting to do it and they told me as I got an Unmanaged VPS they cant do it for me.
Do anyone know how can be done ? I dont want to use tmpfs as it uses main memory.
i am looking to get away from hostgators extremely overloaded servers and get a vps. I have been admining linux servers for a while although never as a web server, but think i can handle that aspect. I have done a huge amount of research but dont know which way to go. One of the things thats rough is the control panels, i like cpanel and have only used cpanel but many charge alot for it. I have been considering an xl-256 plan from vpsland.com. they are east coast (i am in NJ, west coast is out) and their xl plan is xen with swap. But its $15 for cpanel and that is too much, i was thinking of trying directadmin for $6. Is directadmin any good? I need spamassasin and that stuff of course. To me its crazy that openvz has no swap and the server will crash if you reach max ram like at vpslink.com. I really liked vpslink.com's phone support but the west coast thing is rough. I have been looking at http://www.ubiquityservers.com/vps/new-york.php these guys but its virtuozzo, but cpanel is cheap only $5 a month. bodhost.com seemed cheap at $8 for cpanel. then i found this which sounds great! especially since its close but i emailed them to ask if its xen or openvz and havent heard back in almost 12 hours which scares me for support. i like phone support but vpslink.com again was on the west coast. their cpanel was cheap though at $8. plus i dont know if i want managed ro not then i remembered this site, and remembered i had gotten alot of help hear before so i figured it be best to hear others experience and favorites, etc.
View 7 Replies View RelatedI am aiming to offer VPS based on OpenVZ. Have some questions, please help to answer
- in OpenVZ, is there any monitor script, that will release an email to say one VPS is down? Or will I need to use external monitoring?
- can I do the backup / restore of full VPS within OpenVZ? Can customers do it themselves?
- how hard to change the VPS configuration? For example, upgrading from 256MB RAM to 512MB RAM, or adding more CPU, space...?
- how about the IP control in OpenVZ? Let's say each VPS will have 2 IPs, so to prevent customers adding more IPs, I will need to setup VLAN, is that correct? How hard is it in OpenVZ?
- how about the ideal hardware for running OpenVZ? Saying SATA, or SCSI disks, how many RAM... for example
All these are free but which is best. What are the pros and cons? Have been using Virtuozzo and I love it but thinking about offering cheaper solutions with GPL software.
View 11 Replies View RelatedWhich one do you prefer more and why?
Virtuozzo is very expensive while OpenVZ is free and it is somehow another Virtuozzo, but made simpler?
On a recent Xen VPS trial, I noticed two kernel versions. "2.6.9-42.0.2.EL.xs148xenU" was being used, but 2.6.18X was installed (source & headers). While trying to set up OpenVPN, I noticed my modules.dep was missing. I could be wrong, but I was under the impression that I needed the Kern source in order to make the module dependencies. At any rate, I can't find the kernel versions in question and was wondering where / if they're provided for Xen users. (By the way, I was running CentOS 5)
View 5 Replies View RelatedIf I restart VPS (vzctl stop 1002 | vzctl start 1002 ) I can't join from ssh - not working, but remaining services start correctly: ftp, cpanel, etc.
View 9 Replies View RelatedHow do you create OS Templates on open VZ? We want to create on with CentOS + Webmin and one with cPanel. Anyone done this before?
View 5 Replies View RelatedDid you try vCpanel for openVZ?
it's a web-based control panel, not-free, it costs about $3/vps
Site: http://vcpanel.net/
any one have any review for it?