How To Limit Memory For VE On Openvz
Oct 30, 2008How 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?
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?
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.
How to configure the Guaranteed and Burst CPU LIMIT on openvz?
200Mhz -> Guaranteed
400Mhz -> Burstable
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?
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
in the user_beancounters below Which is responsible for memory limit? And Which the unit(bytes, kb, Mb, Gb)?
# cat /Proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
100: kmemsize 2780345 5144991 11055923 11377049 0
lockedpages 0 0 256 256 0
privvmpages 33433 68587 262144 262144 40404
shmpages 640 656 21504 21504 0
dummy 0 0 0 0 0
numproc 41 70 240 240 0
physpages 17144 46756 0 2147483647 0
vmguarpages 0 0 33792 2147483647 0
oomguarpages 17144 46756 536870912 2147483647 0
numtcpsock 27 35 360 360 0
numflock 6 8 188 206 0
numpty 1 2 16 16 0
numsiginfo 0 28 256 256 0
tcpsndbuf 207948 270556 1720320 2703360 0
tcprcvbuf 204424 1665268 1720320 2703360 0
othersockbuf 19424 57300 1126080 2097152 0
dgramrcvbuf 0 261888 262144 262144 2605
numothersock 21 51 360 360 0
dcachesize 0 0 3409920 3624960 0
numfile 927 1748 9312 9312 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 47 47 128 128 0
If I have a two sites that, combined, get about 125,000 page views monthly (that comes out to about 4,000 page views daily). The sites are powered by Wordpress, and it is being used as a CMS, it's not a blog. There are a number of plug-ins in use, on each site, about 10 or so. Each site also has a vBulletin forum in use, although there are rarely more than 10 concurrent connections, if even that many (total of 400 members, only 150 of which are active -- combined stats for both sites).
Currently the PHP memory limit is set to 16M. I'm wondering how high it could or SHOULD go? Granted, I would not want to ask for more than what is available. Would the site speed improve if it was upped to say 128M? Let's pretend that I have a 512MB VPS SLM (no burst). It would have Linux+Apache+Plesk.
Is that enough of a VPS? Would I need to go to 640MB, 768MB, or even 1GB of RAM? Budget is an issue, so "yeah sure, go larger" is not an easy decision. It's also stupid to buy what's not actually needed. Maybe 256MB-384MB would be good enough?
Now then, what if I wanted to use this on a Windows IIS6 system instead? Let's say that I decided to add an ASP.NET wiki or blog to one of the sites. Clearly, that would demand more RAM, and I think Windows itself likes to eat more RAM. The Windows box would also have either Plesk 8.6 or Plesk 9. What's the difference in base RAM use that should be accounted for?
Virtuozzo is desired for either solution, be it Linux or Windows.
My current situation is shared, Windows 2003 Plesk, for these particular sites, and these two specific sites are loading really slow sometimes. Other times I get partial loads, error 500, or pure "unavailable" issues. Other sites, same machine, just fine.
Even the vBulletin forums on the same domains load okay and fast, but the Wordpress sites crawl. It is IIS6, so use of WP-Cache/etc is pretty much impossible. I tried another cache, and it works -- but only for maybe 2 hours at a time, then something happens to it, and the cache quits. It's enabled, but it just stops functioning properly.
My shortlist of the moment includes KickassVPS, FutureHosting, and EuroVPS, for whatever new VPS plan that needs to be gotten. I've been watching the VPS offers threads for the past two weeks. I'm leaning hard to FutureHosting, for this one project, because of the Seattle NOC, since one of the site admins is close geographically, and he always has trouble with the current site's location (other side of the globe, for him).
I'm hoping some of the WHT experts have some good answers for this. I've been researching this for a while, both on WHT and off, but I can't seem to get a clear answer from reading alone.
what tools are available for Fedora 4 that allow an admin to set limits on how much memory and cpu usage clients can use. I have plesk 8 but I can't seem to find anything related to it in there, and I set up webmin as well,
View 2 Replies View RelatedHow can I limit my dedicated server's resources ? For example, one of reseller provider's limits :
Quote:
Resellers may not use more than 2% CPU daily, 3% memory daily, run more than 10 simultaneous processes per user, allow any process to run for longer than 30 seconds CPU time, run any process that consumes more than 20% of available CPU at any time, or run any process that consumes more than 16 MB of memory. Databases are limited to 16 max user connections with a max query time of 8 seconds. Cron jobs must not execute more than once every 15 minutes and will be niced to 15 or greater.
From where or how can I configure these limits?
I know bluehost.com "sort of" does this. If you use more then x % of the total CPU or memory of the server, then your account will be limited automatically.
(A page is displayed saying that the page you're trying to view can't be displayed because it is using too much resources.)
I know bluehost.com "sort of" does this. If you use more then x % of the total CPU or memory of the server, then your account will be limited automatically.
(A page is displayed saying that the page you're trying to view can't be displayed because it is using too much resources.)
why, or when this happened, but all of a sudden the PHP Memory Limit for all of my domains is 64M? I used to have it set to 128. How to change this setting so that all domains have the ability to go to 128M ?
View 5 Replies View RelatedI am trying to increase the PHP memory limit for all Plesk hosted sites.
I've updated the 'memory_limit' setting in /etc/php.ini
Then I ran
Code:
/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
/usr/local/psa/admin/sbin/httpdmng --reconfigure-server
Checking a phpinfo() page on hosted sites I see that this setting has not been effective.
Checking some /var/www/vhosts/system/domain.com/etc/php.ini also shows the old setting, and I can see that these files have not been updated.
I note that all these domain php.ini files have been modified earlier today, all at the same time, so presumably some process did regenerate them earlier. All these files hae the "DO NOT MODIFY ..." heading
I realise that I can go the the domain in Plesk GUI and save the PHP settings to force an update, but is there anyway to force the regeneration of all of these files via CLI?
Is any way to change hard disk memory limit for created subscription ? It is 4 Gb I have to increase it to 8 Gb.
View 1 Replies View Related[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?