Pascal
2007-Jun-09 09:10 UTC
[Xen-users] vcpu performance : 1 vcpu for all guets or 4 vpcu ?
Hello all ;) Tell I have a Xeon server with 4 vcpus If on this box I have some guets, tell 10, what is the best solutions : - Set all guests to 1 vcpu ? - Set all guests to 4 vcpus ? I well understand that if I set a guest with 4 vcpus and all others only with one vpcus, then the one with 4 vcpus will have more "cpu time" available than others guests. But in case I''d like to have an equal cpu "share" between all guests, which is the best solution : - set 1 vcpu for all - set 4 vcpu for all Thanks a ton Pascal _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Timo Benk
2007-Jun-09 09:33 UTC
Re: [Xen-users] vcpu performance : 1 vcpu for all guets or 4 vpcu ?
Pascal wrote:> Tell I have a Xeon server with 4 vcpus > > If on this box I have some guets, tell 10, what is the best solutions : > - Set all guests to 1 vcpu ? > - Set all guests to 4 vcpus ?In my understanding, if you set all guests to 1 vcpu, each guest can utilize one (p)cpu at most, but most likely the credit-scheduler will put each guest on a separate (p)cpu, thus all guests are able to run at the same time. If you set all guest to 4 vcpus, each guest can utilize all four (p)cpus at most, but all guests will share these (p)cpus. Which solution is best depends on the workload, and imho there is no "best way" for all situations. If all guests are at 100 percent cpu, but the guests are not able to utilize all four vcpus because there is only one process consuming most of the cpu time, you won''t gain any profit of using four vcpus and it may be better to use only on vcpu. Greetings, -timo -- Timo Benk - Jabber ID: timo@jabber.de - ICQ ID: #488595326 PGP Public Key: http://www.m28s01.vlinux.de/timo_benk_gpg_key.asc _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tim Post
2007-Jun-10 08:03 UTC
Re: [Xen-users] vcpu performance : 1 vcpu for all guets or 4 vpcu ?
On Sat, 2007-06-09 at 11:10 +0200, Pascal wrote:> Hello all ;) > > Tell I have a Xeon server with 4 vcpus > > If on this box I have some guets, tell 10, what is the best > solutions : > - Set all guests to 1 vcpu ? > - Set all guests to 4 vcpus ? > > I well understand that if I set a guest with 4 vcpus and all others > only with one vpcus, then the one with 4 vcpus will have more "cpu > time" available than others guests.It can be hard to contain and deal with sudden onslaughts of I/O requests from guests. Our recipe has been to reserve at least 1/2 core for dom-0, then give each guest 2, balancing them over the remaining 3 vcpu''s. I have a whole CD full of little ''nasties'' written in perl that show up in /tmp on shared servers, usually because of weak php scripts. While you won''t ''see'' the strain a few unruly guests can put on I/O for all guests on dom-0, you''ll surely see it in the other guests, especially if your using off the shelf cheap drives.> But in case I''d like to have an equal cpu "share" between all guests, > which is the best solution : > - set 1 vcpu for all > - set 4 vcpu for allHow much ram are you giving your guests on average? There''s only but so much someone can do with 256 MB regardless of how this value is set. There *are* exceptions to this, especially if someone is determined to cause a disruption. Common disruptions tend not to bother any other guests but the one running it, the isolation is very good, but things do happen. If your guests have substantial amounts of memory (512 MB <), There really isn''t one "good" way to do it. Going by the domain name of your e-mail address, I *strongly* suggest not using all equal credit, or reserving at least one core that the guests can''t touch. You just never know what someone is bound to upload. It may work perfectly for you. It all depends on who your hosting. What sucks is having to reboot dom-0 uncleanly and watch 30+ guests fsck themselves, just because of a bot infestation on a few servers. I don''t see this nearly as much with Xen 3.1 as I did with 3.0 -> 3.0.4, but it still does happen from time to time. I also stopped using ext3 and switched to jfs for all of my guests, this noticeably reduced sluggishness and breakage due to many guests demanding I/O at once. I wish I could give you a magic formula :)> Thanks a ton > PascalHope this is of some help. --Tim> _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tim Post
2007-Jun-11 09:34 UTC
Re: [Xen-users] vcpu performance : 1 vcpu for all guets or 4 vpcu ?
On Mon, 2007-06-11 at 06:59 +0200, Pascal wrote:> Hi Tim > > Thanks a lot for this long answer ;) > > We''ve done some tests and it seems good to have 1 core reserved for > dom0, the other balancing through vcpu to all guests. >Or at least 1/2 of one core. It really depends on the I/O needs of your guests. I have one server that has nearly 50 load balancing guests running on it. It uses software that never touches disk once resident and running. It could easily hold 50 more.> Maybe one more question.Sure :)> We are working on a solution to count the guest trafic by month and > maybe to limit the bandwidth used by every guests. > > For the trafic, we are currently trying to play with rrdtool + a > script that does something like this and write these data in a mysql > database : > ifconfig -a vif34.0 | grep ''RX bytes'' | cut -d : -f 2 | cut -d '' '' -f > 1 > > For the bandwidth limit there is of course TC > > Just by curiosity, did you implement one of these solutions ? > Do you have others idea, is there some control panel or existing > script which do that ? > > Thanks > > > PascalTry reading from /proc/net/dev directly. That pipe invokes many things that allocate much more memory than is actually needed. Line editors have *no* idea how big stdin is going to be, so they need to allocate a lot of memory that is just wasted for 15 - 30 mins for such a menial task. Ideally, back end stuff on dom-0 tries its best not to do that, since contiguous chunks of RAM can be hard to come by in such small spaces. Ideally, such a solution would e-mail (or otherwise notify) your clients when they reached about 80% of that quota. Floats in simple shell scripts are a pain, I recommend you use C or python. Bash is very bloated for this particular use. Every invocation of /bin/sh puts a gazillion things in memory you''ll never use. You could try other bourne-ish shells, but most of them don''t support arrays which you''d want for this. If you don''t know python or C, try grawk. http://dev1.netkinetics.net/hg/utils.hg/grawk.c .. in place of grep / awk / cut grawk "^\ \ eth0" ''$2,$9'' /proc/net/dev produces the two values I think that you want with a single invocation. Of course, substitute eth0 for the vifname. That repo also contains non blocking highly abuse-able http and ftp services you may find of use. Please reply-to-all or CC the list so everyone can benefit from the answers to your questions :) Best, --Tim _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users