Showing posts with label major. Show all posts
Showing posts with label major. Show all posts

Wednesday, March 28, 2012

performance differnce between 3027 and 3033

Hi,

I have found major differnces in performance between the two versions - specially with queries that should be answerd from cache if i execute multiple times...

Test Query - after the first execute it tooks

1 second with 9.0.3027 and 12 seconds at 9.0.3033.

Is this a bug in the last ctp - does this change back in the released SP2? or is the something bad in my models for the latest version

we used two equal machines - processed the db on 9.0.3033 and restored the backup on 9.0.3027

query looks like

select

{[4WochenSet]* [Zeit].[Tag].[Tag].Members} on axis(0),

Descendants([Immobilien].[Geographie].[Bundesland].&[Wien]&[AUT], [Immobilien].[Geographie].[PLZ],SELF) on axis(1)

from

Angebotsanalyse

where ([Measures].[Kaufpreis je Wohnflaeche MW], [Plattform].[Plattform].&[156],[Immobilien].[Immobilientyp].&[5])

LG, HANNES

Are there any calculations used by the query? How is the set [4WochenSet] defined? If you capture the performance counters under MSAS 2005:MDX during the query, do you see any significant difference in performance counter values between the two builds? For example, do you see a much larger increase in the value of the [Total calculation covers] performance counter in build 3033? If there is calculation involved in the query, such IIF, try connection string property "Cache Policy=9" to see if there is any difference in performance.

Jeffrey

|||

There are some calc, the measure [Kaufpreis je Wohnflaeche MW] is defined as

AVG(existing({[Immobilien].[Immobilie].[Immobilie].Members}),[Measures].[Kaufpreis je Wohnflaeche])

and the set is defined as

{Tail(except(

exists({[Zeit].[Zeit nach Wochen].[Woche].Members},[Zeit].[Abgeschlossen].&[True]),

exists({[Zeit].[Zeit nach Wochen].[Woche].Members},[Zeit].[Abgeschlossen].&[False])

),4)}

by this definition there are no if calculations, but the base measure [Measures].[Kaufpreis je Wohnflaeche] is defined as lastnonempty.

At the moment i test only using management studio - later i will test it with your sugestions.

Is this further optimized in the released version of SP2? so we do not need the setting?

LG, HANNES

|||

It's hard to tell what caused the performance degredation. But since there is no IIF and other calculation conditions, "Cache Policy=9" shouldn't make any difference.

Monday, March 12, 2012

Performance & Threading

Hi,

I am a web developer using c# and we use threading extensively across our website. I noticed that we appeared to be geting major speed degradation when seperate threads would make calls to the same SPC (with different params). After creating a few diferent test scenarios I ended up using a console application that allows me to spawn n threads to a SQL Server and then tells me the results.

We first saw this issue on SQL Server 2000 but we recently upgraded our stage server to SQL Server 2005 so I ran the tests there,

The Stage server is a 4CPU dual core opteron box, so there are 8 cores. There was very little activity on the server, no more than 1 or 2% cpu utilization.

The call was executed using: 'EXEC DBName.dbo.TestSPC' and dbo was the owner of the SPC. The SPC contained a simple select on the primary key, the table has about 19000 rows:

SELECT * FROM People WHERE id between 10000 and 20000

When the SPC is called serially, it takes (in ms):

188, 203, 188, 234, 219, 250, 172, 203 - total time including connections = 1766ms

If I send all 8 threads at the same time, each with thier own connection the results are:

922, 906, 922, 1016, 1000, 1203, 1172, 1047 - total time including connections = 1313ms

My questions are:

    Is this expected behaviour on an 8 core 2005 server? Why would the first thread take nearly 5 times longer to complete? I could understand some extra overhead, but 500% seems excessive. Running serially, is it usual for an SPC to vary in execution time as seen above. I ask this because if I execute a diferent SPC which is much more complex multiple times in a row in Query Analyzer, then I see variations from 800ms up to 5000ms on our stage server.

Thanks for looking.

Jim

What are the specs on the client box you are submitting the requests from? If you are spawning 8 threads on a single core box, obviously each thread's work is going to be serialized to some degree on the client box, so that may be part of it.

Also, are the times listed based on times reported from your client application or the server? To see how the server is actually handling each request, I'd recommend running a server-side SQL trace to capture the duration, reads, writes, and resource usage on the server, not on the client...you should notice that regardless of the times reported on the client, the times to execute the procedures on the server are relatively static after the initial compilation, optimization, etc. of the procedure. Times reported on the client could include network latencies, client latencies, etc.

Also, in your scenario above, when using multiple threads you mention that each thread uses it's own connection...do the times include creation of the connection in addition to execution and response to the query itself? If so, in the single-threaded attempt are you doing the same (i.e. creating/destroying connection on each execution attempt)?

Finally, an obvious possible issue in the multi-threaded scenario is blocking on the server...each simultaneous request to access the same records on the server will be blocked until the previous request(s) have been processed...you'd want to monitor the server to see if spids are getting blocked by others during the execution...note that blocked time is included in trace duration data, so that could be misleading if it's an issue...

|||

What are the specs on the client box you are submitting the requests from? If you are spawning 8 threads on a single core box, obviously each thread's work is going to be serialized to some degree on the client box, so that may be part of it.

Those times were done using terminal server directly on the SQL box. It was quicker from our Stage IIS server which is a 2 cpu HT machine (3.0ghz I believe).

Also, are the times listed based on times reported from your client application or the server? To see how the server is actually handling each request, I'd recommend running a server-side SQL trace to capture the duration, reads, writes, and resource usage on the server, not on the client...you should notice that regardless of the times reported on the client, the times to execute the procedures on the server are relatively static after the initial compilation, optimization, etc. of the procedure. Times reported on the client could include network latencies, client latencies, etc.

I did this when I was testing from other boxes and the time diferences were negligable. However this was on the box itself, so there were no other factors such as client speed, or network latency that I can think of.

Also, in your scenario above, when using multiple threads you mention that each thread uses it's own connection...do the times include creation of the connection in addition to execution and response to the query itself? If so, in the single-threaded attempt are you doing the same (i.e. creating/destroying connection on each execution attempt)?

Connection creation times have already been removed. In single threaded mode, and in multi-threaded mode, each operation has it's own connection, although in single threaded mode, it will reuse the same connection from the conneciton pool. However these are purely times using a SQLAdapter on an open connection, as I also have a time reading on how long each connection takes to open. The code for the fill is.

DateTime fillStart = DateTime.Now;
SqlDataAdapter adp = new SqlDataAdapter(sql, conn);
DataSet ds = new DataSet();
adp.Fill(ds);
DateTime fillEnd = DateTime.Now;

Finally, an obvious possible issue in the multi-threaded scenario is blocking on the server...each simultaneous request to access the same records on the server will be blocked until the previous request(s) have been processed...you'd want to monitor the server to see if spids are getting blocked by others during the execution...note that blocked time is included in trace duration data, so that could be misleading if it's an issue...

What you mentioned here is what I thought would happen, the first thread would return in the same time and then subsequent threads would return faster than in single threaded mode, but not in the same time as 1 thread + connection + thread creation time. I dont understand why the first thread the box receives is held up by 400% of its execution time.

I will run another trace on the server whilst running the console directly from the server, I will add the options you mentioned above: duration, reads, writes, and resource usage on the server, plus I will add locks. I will also run perfmon at the same time to see what is going on on the box.

Thanks for your help, I'll post more results in a few hours.

|||

You've also got to look at caching, IO capabilities, memory and network. You are selecting 10,000 records that is a huge number, and will undoubtedly lead to a level of blocking. What transaction isolation level is being used to access the data, this can change the amount of blocking that will occur.

In a good design you should not see that level of disparity, which suggests you are hitting some limit, which I would suggest is due to the amount of data.

Friday, March 9, 2012

Performance - Best Practices

Hello,

I am having some pretty major performance issues with a cube I've built. My goal for this post is to give specifics related to the data and Analysis Services hardware to try and get some feedback from the community on whether or not I am having valid expectations performance-wise.

Hardware:

-Two dual-core Xeon 2.8GHz processors
-3GB RAM

Data:

The data is retail transaction data which is at the line item level. The most recent years have 50-60 million rows and I am partitioning by year. In addition, each transaction has related discount and tender (payment) data. The tender data has approximately 15-20 million rows per year while the discount data has approximately 10-15 million rows per year.

In my cube, each of these tables have their own separate fact group. I am pulling data from all three fact groups to create quite a few calculated members which build on each other to finally arrive at calculations such as GAAP Sales, sales for a particular product type, etc.

I believe I have my hierarchies and relationships set up correctly in my dimensions. In addition I have aggregations designed on each partition at about the 40% level.

Am I having reasonable expectations that data should be able to come back fairly quickly? I have some reports which take 10-15 minutes that bring back quite a lot of data for the whole company across the last two years. However, even some simple slicing and dicing in the cube browser can be slow. What is interesting to me is that even if I drop my time dimension on the rows axis before adding any measures or other dimensions, it can take 20 seconds or more to respond. All the while when reports are running or when I am browsing the cube myself, the CPU (all 8 in Task Manager [dual dual-core processors]) are spiking at 100%.

While I believe I can get some good responses from MS folks and MVPs for my own benefit, I think any thoughtful posts will benefit the community as a whole by setting performance expectations and pointing out potential pitfalls. I have found that there are not a ton of good resources out there on performance, so I appreciate any tips anyone can offer.

Thanks!
Todd

Dear Todd,

May be you can find useful information from this blog:
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!907.entry

For best practices in SSAS 2005, you can find it in presentation from TechEd 2006 (BIN 316):
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!906.entry

Best Regards,
|||

Hello. You have some good links to information posted here already regarding aggregations. I would only advice you to start with checking your attribute relations in your user hierarchies. This is mentioned in Chris Webbs blog.

Mosha has a good post here regarding MDX and performance: http://www.sqljunkies.com/WebLog/mosha/archive/2006/11/05/non_empty_behavior.aspx

You should also be aware of performance issues with using several measure groups in a cube. Here is a good blog post about this: http://prologika.com/CS/blogs/blog/archive/2006/06/28/1331.aspx

HTH

Thomas Ivarsson

Performance - Best Practices

Hello,

I am having some pretty major performance issues with a cube I've built. My goal for this post is to give specifics related to the data and Analysis Services hardware to try and get some feedback from the community on whether or not I am having valid expectations performance-wise.

Hardware:

-Two dual-core Xeon 2.8GHz processors
-3GB RAM

Data:

The data is retail transaction data which is at the line item level. The most recent years have 50-60 million rows and I am partitioning by year. In addition, each transaction has related discount and tender (payment) data. The tender data has approximately 15-20 million rows per year while the discount data has approximately 10-15 million rows per year.

In my cube, each of these tables have their own separate fact group. I am pulling data from all three fact groups to create quite a few calculated members which build on each other to finally arrive at calculations such as GAAP Sales, sales for a particular product type, etc.

I believe I have my hierarchies and relationships set up correctly in my dimensions. In addition I have aggregations designed on each partition at about the 40% level.

Am I having reasonable expectations that data should be able to come back fairly quickly? I have some reports which take 10-15 minutes that bring back quite a lot of data for the whole company across the last two years. However, even some simple slicing and dicing in the cube browser can be slow. What is interesting to me is that even if I drop my time dimension on the rows axis before adding any measures or other dimensions, it can take 20 seconds or more to respond. All the while when reports are running or when I am browsing the cube myself, the CPU (all 8 in Task Manager [dual dual-core processors]) are spiking at 100%.

While I believe I can get some good responses from MS folks and MVPs for my own benefit, I think any thoughtful posts will benefit the community as a whole by setting performance expectations and pointing out potential pitfalls. I have found that there are not a ton of good resources out there on performance, so I appreciate any tips anyone can offer.

Thanks!
Todd

Dear Todd,

May be you can find useful information from this blog:
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!907.entry

For best practices in SSAS 2005, you can find it in presentation from TechEd 2006 (BIN 316):
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!906.entry

Best Regards,
|||

Hello. You have some good links to information posted here already regarding aggregations. I would only advice you to start with checking your attribute relations in your user hierarchies. This is mentioned in Chris Webbs blog.

Mosha has a good post here regarding MDX and performance: http://www.sqljunkies.com/WebLog/mosha/archive/2006/11/05/non_empty_behavior.aspx

You should also be aware of performance issues with using several measure groups in a cube. Here is a good blog post about this: http://prologika.com/CS/blogs/blog/archive/2006/06/28/1331.aspx

HTH

Thomas Ivarsson