VMware Cloud Community
DaveMiller8
Contributor
Contributor
Jump to solution

Huge differences in answer time of hosts (get-stat)

Hi there

I'm not quite sure, if this is really a PowerCLI problem, or if it's more a general problem with our hosts/db...

In our environment we are experiencing huge differences in the answer time of our hosts, when we use the get-stat command.

We have a script, which gets the average memory and cpu stats of our hosts. This script often takes between 6 and 18 hours to complete. So I tested some things with the use of measure-command. This is what I did:

measure-command {$MemoryStats = Get-Stat -Entity $vmhost -Stat mem.usage.average -Start $todayMidnight.AddDays(-1) -Finish $todayMidnight.AddDays(-0)}

The discrepancies between the answer time of the hosts are huge, have a look at this:

TotalSeconds : 114.4278341

TotalSeconds : 79.5122725

TotalSeconds : 79.1924794

TotalSeconds : 16.5746661

TotalSeconds : 10.8026917

TotalSeconds : 17.3287688

TotalSeconds : 7.6420299

TotalSeconds : 51.3721898

TotalSeconds : 7.3596556

TotalSeconds : 11.5114361

TotalSeconds : 85.1261401

These are only some of our hosts... we have a lot more, but I think it shows the main problem...

I'm using the newest version of PowerCLI but unfortunately only PowerShell 1.0 (because of some circumstances in our environment I can't update to PS 2.0).

Does anybody have a suggestion on this topic ? I really need some input...

Thanks in advance

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Let's hope the DB migration improves the response times considerably.

A tip, you can get the statistical data for multiple hosts in 1 call to Get-Stat.

You use the Group-Object cmdlet on the returned data to split out the results per host.

See my PowerCLI & vSphere statistics – Part 4 – Grouping for some examples.

This one get-stat call for all the hosts will be considerably faster than individual calls to get-stat for each host !

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

This looks more like a problem with your vCenter database engine.

Is your vCenter database on a standalone database server ?

Or is the database server also hosting other databases ?

Can you run some type of 'profiles' on the database server ? Perhaps that could show you why the long response times.

Do you consistently see the same execution time for the same host data ?

In other words, if you retrieve the data for host x, is it always the same execution time ? Or does the response time vary as well ?

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

DaveMiller8
Contributor
Contributor
Jump to solution

Thank you luc for your response

Yes, our database Server does also host other databases... we thought, that this could be a problem and we already created a standalone database server for our vCenter. We are going to migrate our db... When we took a close look at our vCenter db with our db experts, he told us, that our db looks pretty bad.

Yes, it's all the time the same servers with long response time, but the response time varies as well. For example a host that took140 seconds before, now only took 90 seconds and another host took 18 seconds before and now about 9 seconds...

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Let's hope the DB migration improves the response times considerably.

A tip, you can get the statistical data for multiple hosts in 1 call to Get-Stat.

You use the Group-Object cmdlet on the returned data to split out the results per host.

See my PowerCLI & vSphere statistics – Part 4 – Grouping for some examples.

This one get-stat call for all the hosts will be considerably faster than individual calls to get-stat for each host !

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DaveMiller8
Contributor
Contributor
Jump to solution

Yes, let's hope so. Thanks for the tip, I already read your blog, but I haven't read this article.

0 Kudos
nnedev
VMware Employee
VMware Employee
Jump to solution

Hi Dave,

We're aware of some performance issues in Get-Stat cmdlet. They will be fixed in a future release.

To improve the performance of the cmdlet try to specify as much parameters as you can. This way the cmdlet will skip automatic parameter assigning(involving more calls to the server).

In your example you can specify -IntervalSecs parameter and I believe this will slightly improve the performance.

Regards,

Nedko Nedev

PowerCLI Development Team

Regards, Nedko Nedev PowerCLI Development Team
DaveMiller8
Contributor
Contributor
Jump to solution

Hi Nedko

I took a look at the interval (when -intervalsecs is not specified) and it was 1800 secs. Now I added -intervalsecs 1800 and see what the difference is (I used again measure-command and compared also the results and they are the same):

Without -intervalsecs specified __________With -intervalsecs specified

TotalSeconds : 76.7606007 __________TotalSeconds : 2.6409633

TotalSeconds : 77.4667637 __________TotalSeconds : 16.1442987

TotalSeconds : 79.5103963 __________TotalSeconds : 4.0577091

TotalSeconds : 78.3530192 __________TotalSeconds : 2.4647943

TotalSeconds : 14.3048966 __________TotalSeconds : 1.4930618

TotalSeconds : 9.3387234 __________TotalSeconds : 1.8392572

TotalSeconds : 14.7482335 __________TotalSeconds : 1.3584882

TotalSeconds : 11.1760584 __________TotalSeconds : 1.6814993

TotalSeconds : 58.7474607 __________TotalSeconds : 4.3316693

TotalSeconds : 13.4183964 __________TotalSeconds : 2.3485293

TotalSeconds : 18.3904378 __________TotalSeconds : 1.5389207

TotalSeconds : 64.3119682 __________TotalSeconds : 6.8901407

In my opinion is this already pretty awesome... Thank you very much !

0 Kudos