Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 02:23 AM
hopehope_123
 
Posts: n/a
Default resource utilization / hardware selection

Hi Group ,

I want to ask your opinion about system resources usage .

My system is a datawarehouse. I have heavy usage of parallel query ,
full table scans. Tables with 60,000,000 rows exist , two or three
tables at this size are joined usually . My current system is redhat
linux itanium , oracle rac 9.2 with 2 nodes. Each node has 4 ia64 cpus
, 8gb. ram , 1 hba , and i use emc , raid10. The db size is 2TB. I use
ocfs files system . My db_file_multiblock_read_count is set to 64 .
With 16kb. block size, this means oracle requests 1MB. io from the os.
Due to a known bug with this version of redhat linux, although oracle
requests 1MB. io for full scans ( direct_path_Read , wait event p3
value=1MB. ) , the os splits this into multiple 32KB. requests. I can
also see this in iostat . Direct_io is enabled.No async io is
available.

Here is the second server : This is sun solaris , emc , 1 hba , 2cpu.
4gb. ram. This server comparing to the redhat , is less powerful in
terms of cpu and memory. But the io bug i mentioned above is not a
concern. Both direct_io and async are available.File system is ufs.

My question :

There is a table:
Table_a is 3gb. in size , has 20,000,000 rows both in redhat and sun
solaris.

1.
select /*+parallel(a,8)*/count(*) from table_a a

This is a simple sql,. it reads all table data from the underlying disk
system.

in redhat ,

this sql takes 2.min. During the execution , oracle shows 1MB. io
requests, direct_path_read, os iostat command shows 20MB. read per
second , each read is 32KB.
Disk utilization is high (>95)

in sun solaris:

it takes 1min. oracle shows again 1MB. io , but this time iostat shows
90MB. per read. each read is 1MB.

2. A real sql :

select /*+parallel(a,8)*/cust_id,count(*) from table_a a group by
a.cust_id

This is different than count. This time redhat is much better than sun
..

in redhat :

It takes 4 min. cpu utilization is %30


in sun :

25 min. cpus are 100% utilized.

When i monitor the group by execution both in v$session_wait and
v$sql_workarea_active , i see that first data is read by using the
direct_path read, than group by calculation is done.


The question is , when choosing a datawarehouse system , i consider ,
high io rate so HBA, emc , emc cache , fibre channel is important . But
a group by sql or hash join sql seems to use more cpu resources than io
.. Which one is better , more hbas , channels or more cpu resources in
order to run sqls faster.If io is the concern , sun server makes io
better than redhat so count sql takes less time . But group by runs
faster in redhat .

I am about making the decision of migrating redhat box to a sun box.
The new sun box may have 6CPUs ( dual core so 12 cpus) 2hba , but i
wonder whether the 6 cpus in new box can provide me a better
performance .



Thanks fpr your comments.

tolga

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 02:24 AM
Sybrand Bakker
 
Posts: n/a
Default Re: resource utilization / hardware selection

Comments embedded




On 16 Feb 2006 23:14:49 -0800, "hopehope_123" <hopehope_123@yahoo.com>
wrote:

>Hi Group ,
>
>I want to ask your opinion about system resources usage .
>
>My system is a datawarehouse. I have heavy usage of parallel query ,
>full table scans. Tables with 60,000,000 rows exist , two or three
>tables at this size are joined usually . My current system is redhat
>linux itanium , oracle rac 9.2 with 2 nodes. Each node has 4 ia64 cpus
>, 8gb. ram , 1 hba , and i use emc , raid10. The db size is 2TB. I use
>ocfs files system . My db_file_multiblock_read_count is set to 64 .
>With 16kb. block size, this means oracle requests 1MB. io from the os.
>Due to a known bug with this version of redhat linux, although oracle
>requests 1MB. io for full scans ( direct_path_Read , wait event p3
>value=1MB. ) , the os splits this into multiple 32KB. requests. I can
>also see this in iostat . Direct_io is enabled.No async io is
>available.
>
>Here is the second server : This is sun solaris , emc , 1 hba , 2cpu.
>4gb. ram. This server comparing to the redhat , is less powerful in
>terms of cpu and memory. But the io bug i mentioned above is not a
>concern. Both direct_io and async are available.File system is ufs.


There is no such thing as async_io possible on an ufs filesysyem.
You can easily verify this by trussing dbwr.

>
>My question :
>
>There is a table:
>Table_a is 3gb. in size , has 20,000,000 rows both in redhat and sun
>solaris.
>
>1.
>select /*+parallel(a,8)*/count(*) from table_a a
>
>This is a simple sql,. it reads all table data from the underlying disk
>system.
>
>in redhat ,
>
>this sql takes 2.min. During the execution , oracle shows 1MB. io
>requests, direct_path_read, os iostat command shows 20MB. read per
>second , each read is 32KB.
>Disk utilization is high (>95)


Not high, but disastrous.
Parallel query is only useful when you are striped your data across
multiple disks. Try removing the parallel hint, and it will be faster.


>
>in sun solaris:
>
>it takes 1min. oracle shows again 1MB. io , but this time iostat shows
>90MB. per read. each read is 1MB.


Maximum read ahead for ufs is 1 Mb. So nothing unusual.

>
>2. A real sql :
>
>select /*+parallel(a,8)*/cust_id,count(*) from table_a a group by
>a.cust_id
>
>This is different than count. This time redhat is much better than sun
>.
>
>in redhat :
>
>It takes 4 min. cpu utilization is %30
>
>
>in sun :
>
>25 min. cpus are 100% utilized.
>
>When i monitor the group by execution both in v$session_wait and
>v$sql_workarea_active , i see that first data is read by using the
>direct_path read, than group by calculation is done.
>
>
>The question is , when choosing a datawarehouse system , i consider ,
>high io rate so HBA, emc , emc cache , fibre channel is important . But
>a group by sql or hash join sql seems to use more cpu resources than io
>. Which one is better , more hbas , channels or more cpu resources in
>order to run sqls faster.If io is the concern , sun server makes io
>better than redhat so count sql takes less time . But group by runs
>faster in redhat .
>
>I am about making the decision of migrating redhat box to a sun box.
>The new sun box may have 6CPUs ( dual core so 12 cpus) 2hba , but i
>wonder whether the 6 cpus in new box can provide me a better
>performance .
>
>
>
>Thanks fpr your comments.
>
>tolga


Apparently you expect to resolve your tuning problems by throwing
hardware at the problem.
Please answer the following questions
- as this is the second time you post this story, and you have been
asked to post the execution plans, why don't you do so? This is an
Oracle newsgroup, not a car dealer.
- Are your statistics current?
- Did you gather system statistics?
- Or did you set the optimizer parameters appropiately?
- Are you aware you are forking off 16 query slaves for this query on
a box with 4 and 2 cpus for your second query?
- Are you aware those query slaves need to be coordinated?
- Did you stripe the data across 8 spindles?
- Aren't you just *creating* contention *by design*?
- So what do you expect of the outcome?
- Do you realize replacing the hardware for an untuned database is
probably not going to help you *at all*?




--
Sybrand Bakker, Senior Oracle DBA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-25-2008, 02:28 AM
Mladen Gogala
 
Posts: n/a
Default Re: resource utilization / hardware selection

On Thu, 16 Feb 2006 23:14:49 -0800, hopehope_123 wrote:

> I am about making the decision of migrating redhat box to a sun box.
> The new sun box may have 6CPUs ( dual core so 12 cpus) 2hba , but i
> wonder whether the 6 cpus in new box can provide me a better
> performance .


I have one question: your system seems to be I/O bound. You are describing
millions of rows, I/O sizes of 1MB and disks 95% busy. Why are you so
concerned about the number of CPU resources? Personally, I would be more
inclined to develop a typical transaction mix, formulate requirements,
develop a test and benchmark the systems. Also, if you have a comparable
company in the region, ask them what are they using and how satisfied they
are. Make vendor provide you with local references and then check those
references. If I were you, my main concern would be the number of I/O
requests per second that either configuration can complete. In addition to
that, there is a reason why Linux servers are so much cheaper then almost
anything else: the central bus, I/O architecture and memory management are
coming from the PC world. SUN minicomputer with Solaris will almost
certainly be better Oracle server then a Linux server with the same number
of CPU resources, due to the true minicomputer architecture and not an
architecture of a souped up workstation.
I don't understand why did you limit the choice to just SUN and Linux,
there are also vendors like IBM and HP-UX that can provide solutions in
the competing range. I must say that I admire both AIX 5.2L and HP-UX
boxes, they are incredibly stable and both companies have excellent
technical support. Given the latest P6 chip and HP woes with Itanic, over
which Carly Fiorina was fired, I'd be inclined to go with IBM. I had an
opportunity to work on P950 box and it was blindingly fast. I believe
that IBM is still king of the hill when it comes to performing lots of I/O.
Nothing else in the same price range comes even close.
Disclaimer:
I don't work for IBM and I never have worked for them.

--
http://www.mgogala.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 02:29 AM
hopehope_123
 
Posts: n/a
Default Re: resource utilization / hardware selection

Hi Sybrand ,

-There is no such thing as async_io possible on an ufs filesysyem.
-You can easily verify this by trussing dbwr.

Okay , i mean threaded io . This is a method which simulates kernel
async io which is only available on raw devices . For ufs , some number
of threads are spawned , i can see the related system create thread
call in truss output .(i can also see this after the kaio read system
call is failed .) It can be argued whether this type of aio has any
benefit .


-Not high, but disastrous.
-Parallel query is only useful when you are striped your data across
-multiple disks. Try removing the parallel hint, and it will be faster.


I have tested this:

SQL> set timing on
SQL> set autotrace on
SQL> select /*+PARALLEL(T,8) FULL(T)*/ count(*) from
MERKEZ.mrk_musteri_TELEFON
T;

COUNT(*)
----------
46545797

Elapsed: 00:04:42.02

Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3053 Card=1)
1 0 SORT (AGGREGATE)
2 1 SORT* (AGGREGATE)
:Q182157
7000
3 2 PARTITION RANGE* (ALL)
:Q182157
7000
4 3 PARTITION HASH* (ALL)
:Q182157
7000
5 4 TABLE ACCESS* (FULL) OF 'MRK_MUSTERI_TELEFON' (Cos
:Q182157 t=3053 Card=28170840)
7000
2 PARALLEL_TO_SERIAL SELECT /*+ PIV_SSF */
SYS_OP_MSR(COUNT(*)) FROM (SELECT /*+ NO_EXPAND ROWID(A2)
3 PARALLEL_COMBINED_WITH_PARENT
4 PARALLEL_COMBINED_WITH_PARENT
5 PARALLEL_COMBINED_WITH_PARENT


Statistics
----------------------------------------------------------
7461 recursive calls
3 db block gets
424453 consistent gets
401403 physical reads
804 redo size
494 bytes sent via SQL*Net to client
652 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
178 sorts (memory)
0 sorts (disk)
1 rows processed

This parallel sql takes 4:42 min. with 401403 disk reads.


The nonparallel version of the same sql:

SQL> set autotrace on;
SQL> set timing on;
SQL> select /*+noPARALLEL(T) FULL(T)*/ count(*) from
MERKEZ.mrk_musteri_TELEFON T;

COUNT(*)
----------
46545797

Elapsed: 00:10:11.64

Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=24418 Card=1)
1 0 SORT (AGGREGATE)
2 1 PARTITION RANGE (ALL)
3 2 PARTITION HASH (ALL)
4 3 TABLE ACCESS (FULL) OF 'MRK_MUSTERI_TELEFON' (Cost=2
4418 Card=28170840)





Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
420260 consistent gets
401107 physical reads
2291832 redo size
494 bytes sent via SQL*Net to client
651 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

This takes 10 min. with 401107 disk reads

During this test , there exists no other users connected to the db.

For the parallel sql , iostat , vmstat , sar shows:

avg-cpu: %user %nice %system %iowait %idle
2.15 0.00 1.80 0.00 96.05

Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s wkB/s
avgrq-sz avgqu-sz await svctm %util
sdp2 43501.50 0.00 885.60 1.30 51122.40 1.30 25561.20
0.65 57.64 114.44 129.43 1.13 100.00



22:52:33 CPU %user %nice %system %idle
22:52:43 all 17.00 0.00 15.25 991.75
22:52:53 all 19.65 0.00 16.55 987.80
22:53:03 all 22.30 0.00 14.53 987.17
22:53:13 all 17.12 0.00 13.28 993.60


procs memory swap io system
cpu
r b w swpd free buff cache si so bi bo in cs us
sy id
0 8 1 12384 1168976 234272 1798800 1 1 2 1 2 0
1 0 0
0 8 1 12384 1168976 234272 1798800 0 0 22746 62 5122 5058
2 2 96
0 8 0 12384 1168976 234272 1798800 0 0 22921 15 5106 5079
2 2 96



for nonparallel sql:

11:11:42 PM CPU %user %nice %system %idle
11:11:52 PM all 18.95 0.00 14.40 990.65
11:12:02 PM all 18.95 0.00 13.12 991.92
11:12:12 PM all 18.52 0.00 13.50 991.98


avg-cpu: %user %nice %system %iowait %idle
1.70 0.00 1.50 0.00 96.80

Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s wkB/s
avgrq-sz avgqu-sz await svctm %util

sdp2 20787.00 0.00 670.70 2.00 21457.60 2.00 10728.80
1.00 31.90 0.89 1.33 1.32 89.07


procs memory swap io system
cpu
r b w swpd free buff cache si so bi bo in cs us
sy id
0 1 0 564032 833040 129936 4278928 1 0 0 0 0 0
1 0 0
0 1 0 564032 833040 129936 4278928 0 0 11982 16 6465 10554
2 2 97
0 1 0 564032 833040 129936 4278928 0 0 12014 15 6389 10535
2 2 96
0 1 0 564032 833040 129936 4278928 0 0 12412 127 6524 10811
2 2 96


For both these cases , here is my comment and understanding :

For both case , cpus are idle . Parallel query utilized the disks 100
% , has 1.13 msec service time , 129.43 msec await . ( wait in disk
queue) 1.13 msec. service time seems to me a very good value for the
emc . High await shows that lots of io reuqests are sent to the emc and
they wait their turn in queue.

Nonparallel sql also have 1.32 msec service time , very low 1.33 await
.. This time i think , since there is only one oracle process that
requests data , the await time is low. Since the number of io requests
are not high , all of them are processed . The disk are utilized at
89.07 percent.

So what these results show to me that , parallel sql altough utilized
the disks 100% runs faster than the nonparallel sql . So utilizing the
disks for more than 95 is not a bad thing , for this case , which
everything is idle (cpu-memory) and slaves wait more data from the
disks. If i optimize the emc part better , such as striping to more
disks , the await value may be decreased.


Do you agree with me?


-Please answer the following questions

Yes, sure.

- as this is the second time you post this story, and you have been
asked to post the execution plans, why don't you do so? This is an
Oracle newsgroup, not a car dealer.

I have posted in this mail.

- Are your statistics current?

Yes. Also , both sqls uses full table scans , no index , and i also put
hint.


- Did you gather system statistics?
yes

- Or did you set the optimizer parameters appropiately?
If you consider setting db_file_multiblock_read_count or parallel query
parameters , i can say that those parameters are set correct.


- Are you aware you are forking off 16 query slaves for this query on
a box with 4 and 2 cpus for your second query?
Yes i am aware. Running a sql with 8 parallel degree does not put any
load into the cpu. So why does not do this? Yes i have 4 cpus , but if
i see that cpu resources are idle , i think i can use this resource.
Since sar or vmstat show that cpu util is very low , i think i can add
more parallelism. On the other hand , running this sql by using 4
slaves instead of 8 takes more time .

- Are you aware those query slaves need to be coordinated?
Yes. I monitor sar -q in order to see the cpu queue. Nothing high there
.. If there is a way to measure whether oracle parallel query slaves
coordination is bottleneck or not , i can check this.



- Did you stripe the data across 8 spindles?
yes
- Aren't you just *creating* contention *by design*?
I dont think so
- So what do you expect of the outcome?


- Do you realize replacing the hardware for an untuned database is
probably not going to help you *at all*?
I dont believe that my db is untuned. But ,based on the above optimizer
plans and other outputs , i am open to all advices. I dont only
monitor the os part , i check both db and os .
Mainly I try to optimize random seq.scans and try to use the server
resources as efficient as possible. I can replace the hardware , add
more cpus for example. But since my 8 way parallel query only utilizes
2 percent of the 4 ia64 cpus , adding 4 more cpus does not change
anything.


Kind Regards,
tolga

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:33 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834