Pradeep:

On Fri, 18 Jan 2008, Pradeep Padala wrote:

> Thanks for the clarifications Venu. I was measuring bandwidth by checking
> 'kstat -n' and as you mentioned, it's probably not accurate.
>
> Using 'netstat -k', I see that the bandwidth is capped correctly.

OK, while the stats may not be accurate, but the output from netstat
should not be very different from that calculated using kstat. netstat
gets the kstat values for vnic1, gets the increment over the last time you
read (via netstat) and gives the average input/output for that time duration.
Perhaps you are not computing the values from kstat -n correctly?
I believe netstat uses the following logic:

e.g for input:
        input kbps = diff in (rbytes64 in kb) since prev read / time since
                     last read;

similarly for output.

> The only
> problem I have now is to get the output of 'netstat -k' in plain text,
> instead of the curses based output. My python wrapper runs with out a
> terminal, as I mentioned to you in the other e-mail.

Could you check that you are using the kstat info. correctly in you
computation. Then, I guess, this should not be an issue.

>
> Please let me know when the new bits are available.

OK,

-venu

>
> Thanks again!
> Pradeep
>
>> -----Original Message-----
>> From: venugopal iyer [mailto:venu at sun.com]
>> Sent: Friday, January 18, 2008 12:12 PM
>> To: Pradeep Padala
>> Cc: crossbow-discuss at opensolaris.org
>> Subject: Re: [crossbow-discuss] Does capping network
>> bandwidth work in Crossbow?
>>
>>
>> Hi, Pradeep:
>>
>> On Thu, 17 Jan 2008, Pradeep Padala wrote:
>>
>>> Hi,
>>>
>>> I am trying to set bandwidth caps for two zones. I created
>> two vnics
>>> and assigned them to two zones 'exclusive'ly. Then, I used the
>>> following commands to set the bandwidth limits
>>>
>>> #dladm modify-vnic -b 100 1
>>> #dladm modify-vnic -b 900 2
>>>
>>> and I see that they are set correctly.
>>>
>>> # dladm show-vnic
>>>        device  speed
>>> vnic1   e1000g0 1000  Mbps      mac: 0:14:4f:8d:a9:bd
>> (fixed)  bw limit:
>>> 100 Mbps    cpus: 0
>>> vnic2   e1000g0 1000  Mbps      mac: 0:14:4f:8d:a9:be
>> (fixed)  bw limit:
>>> 900 Mbps    cpus: 0
>>
>> That's right.
>>
>>>
>>> I am measuring the bandwidth used by a zone, by calculating tx + rx
>>> bytes as seen by 'kstat -n vnic?'. Is this the right way to
>> measure it?
>>
>> I suspect that may  work. I think you might have earlier bits
>> that did bandwidth regulation in squeues (in IP). So, unless
>> the squeue always polls the vnic to get the no. of pkts per
>> the set limit, the numbers above might not give you the right
>> info. E.g packet that comes via an interrupt will update the
>> vnic counters and be sent upstream to the appropriate squeue,
>> which will enforce the limit. (This logic has changed and we
>> will be pushing out the latest bits on OpenSolaris shortly,
>> possibly in the next week. With the latest bits the above
>> method - kstat - should be fine; see
>> http://www.opensolaris.org/os/project/crossbow/Design_softringset.txt
>> for some info. about bandwidth control et. al.)
>>
>>
>>>
>>> I use httperf to connect to the webservers running in the
>> two zones,
>>> and I always see the bandwidth used by the zones exceeding
>> the limits
>>> often reaching 400Mbps (my workload is very network heavy).
>>>
>>> I tried using the -L option as specified in the dladm man page
>>>
>> (http://dlc.sun.com/osol/netvirt/downloads/20070214/dladm.1m.txt) to
>>> cap bandwidth, but I get an error.
>>>
>>> # dladm modify-vnic -b 100 -L 1
>>> dladm: unrecognized option '-L'
>>
>> -L is not needed for dladm.
>>
>>>
>>> I am not sure whether this is the right way to cap
>> bandwidth. Another
>>> way to do it, I believe, is to use flowadm and setup flows
>> with limited bandwidth.
>>> I thought that probably uses more protocol processing than
>> necessary,
>>> since I just want to cap the full vnic bandwidth.
>>>
>>
>> Yes, you should just be able to set the vnic limit, if that's
>> sufficient.
>>
>>
>>> Any ideas?
>>
>> Until the new bits are made available: I haven't used
>> httperf,  but you could try netperf and look at its results
>> just to check if the limit is being enforced.
>>
>>
>> -venu
>>>
>>> Pradeep
>>>
>>> _______________________________________________
>>> crossbow-discuss mailing list
>>> crossbow-discuss at opensolaris.org
>>> http://mail.opensolaris.org/mailman/listinfo/crossbow-discuss
>>>
>>
>
>

Reply via email to