Skip to content

Commit b2204ec

Browse files
committed
In 24h sim, make no hard parse/full scan the default
1 parent d4c63c8 commit b2204ec

File tree

5 files changed

+60
-39
lines changed

5 files changed

+60
-39
lines changed

oltp/aw_declarations.rwl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# This file declares everything used by the
66
# various artificial workloads:
77

8+
# bengsig 16-nov-2023 - Fix hard/scan during 24h sim
89
# bengsig 8-aug-2023 - xc_badplan is a probability
910
# bengsig 1-aug-2023 - 24h simulation
1011
# bengsig 9-may-2023 - Gradual badplan and hardparse
@@ -265,7 +266,7 @@ $endif
265266
# Note that this is very aggressive unless you reduce awindex_query_weight to e.g. 10
266267
+ uniform(10,90)*(uniform(0.0,1.0)<xc_badplan)
267268
$endif
268-
$if s24hour $then
269+
$if s24hour and s24h_scan_prb > 0.0 $then
269270
+ (( myrunsec > s24h_scan_beg + s24h_scan_skp*s24h_scan_avg
270271
and
271272
myrunsec%normalrandom(s24h_scan_avg,s24h_scan_std) between s24h_scan_beg and s24h_scan_end

oltp/oe_handle_orders.rwl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0
33
# as shown at https://oss.oracle.com/licenses/upl/
44

5+
# bengsig 16-nov-2023 - Fix hard/scan during 24h sim
56
# bengsig 3-oct-2023 - Add parsefailure
67
# bengsig 31-jul-2023 - Add experimental 24h simulation
78
# bengsig 9-feb-2023 - Check against max_order-5e6
@@ -181,7 +182,7 @@ $else
181182
$endif
182183
double myrunsec := runseconds();
183184
integer do_hardparse := (
184-
$if s24hour $then
185+
$if s24hour and s24h_hard_prb > 0.0 $then
185186
uniform(0.0,1.0) < s24h_hard_prb
186187
and
187188
myrunsec > s24h_hard_beg + s24h_hard_skp*s24h_hard_avg

oltp/oltp.rwl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ rwl_daily_html := "daily.html";
369369
# s24hour := 0 # set to 1 to enable 24h simulation
370370
# These parameters tell what "day" and "night" is, i.e. when the "day" period
371371
# begins and ends (relative to runperiod), and how the ratefactor is
372-
# set during the two priods.
372+
# set during the two priods. If the defaults below are fine for you,
373+
# you only need to set s24hour.
373374
# s24h_high_beg := 0.30; # Factor applied to runperiod to indicate start of "day"
374375
# s24h_high_end := 0.85; # Factor applied to runperiod to indicate end of "day"
375376
# s24h_high_std := 0.05; # stddev of those, the lower, the more rapid the change is
@@ -384,24 +385,28 @@ rwl_daily_html := "daily.html";
384385
# s24h_hard_beg := 15.0; # runseconds() of begin hard parse
385386
# s24h_hard_end := 20.0; # runseconds() of end hard parse
386387
# s24h_hard_skp := 1; # How many to skip initially in the run
387-
# s24h_hard_prb := 0.8; # probability of actually doing hard parse
388-
# With these default values, there will be a hard parse with
388+
# s24h_hard_prb := 0.0; # probability of actually doing hard parse (try e.g. 0.8)
389+
# With the suggested s24h_hard_prb there will be hard parse
389390
# a probability of 80% and this will happen during a 5 second
390391
# period every 90s. The first 5s period will be starting 105s
391392
# (s24h_hard_beg+s24h_hard_skp*s24h_hard_avg) into the run.
393+
# If you are happy with the timing of the hard parse injection, just
394+
# set s24h_hard_prb to any value larger than 0.
392395
# The hard parse actually impacts the make_order and query_order transactions
393396

394397
# Another "issue" is to change from index lookup to full scan
395398
# s24h_scan_avg :=130.0; # approximate time between each
396399
# s24h_scan_std := 3.0; # the standard deviation
397400
# s24h_scan_beg := 35.0; # runseconds() of begin full scan
398401
# s24h_scan_end := 50.0; # runseconds() of end full scan
399-
# s24h_scan_skp := 0; # How many to skip initially in the run
400-
# s24h_scan_prb := 0.05; # probability of actually doing full scan
401-
# With these default values, there will be a full scan parse with
402+
# s24h_scan_skp := 0; # How many to skip initially in the run
403+
# s24h_scan_prb := 0.00; # probability of actually doing full scan (try e.g. 0.05)
404+
# With the suggested s24h_scan_prb, there will be full scan with
402405
# a probability of 5% and this will happen during a 15 second
403406
# period every 130s. The first 15s period will be starting 35s
404407
# into the run since s24h_scan_skp is 0.
408+
# If you are happy with the timing of the hard parse injection, just
409+
# set s24h_scan_prb to any value larger than 0.
405410
# The actual impact is on the awindex_query transaction
406411

407412
# The following parameters rarely changed

oltp/parameters.rwl

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0
33
# as shown at https://oss.oracle.com/licenses/upl/
44

5+
# bengsig 16-nov-2023 - Fix hard/scan during 24h sim
56
# bengsig 9-nov-2023 - support multiple application servers
67
# bengsig 6-nov-2023 - burst function
78
# bengsig 1-nov-2023 - burst can be repeated
@@ -207,14 +208,14 @@ double s24h_hard_std := 0.5; # the standard deviation
207208
double s24h_hard_beg := 15.0; # offset of begin hard parse
208209
double s24h_hard_end := 20.0; # offset of end hard parse
209210
integer s24h_hard_skp := 1; # How many to skip initially in the run
210-
double s24h_hard_prb := 0.8; # probability of actually doing hard parse
211+
double s24h_hard_prb := 0.0; # probability of actually doing hard parse
211212
# Each thread uses a bad plan (i.e. full scan) for some periods
212213
double s24h_scan_avg :=130.0; # approximate time between each
213214
double s24h_scan_std := 3.0; # the standard deviation
214215
double s24h_scan_beg := 35.0; # offset of begin full scan
215216
double s24h_scan_end := 50.0; # offset of end full scan
216217
integer s24h_scan_skp := 0; # How many to skip initially in the run
217-
double s24h_scan_prb := 0.05; # probability of actually doing full scan
218+
double s24h_scan_prb := 0.00; # probability of actually doing full scan
218219

219220
integer doawr := 1; # set to 0 if you don't want awr to be generated
220221

@@ -539,18 +540,26 @@ if show_changed_values then
539540
, runperiod * (s24h_high_end+2.0*s24h_high_std);
540541
printf "Rate low=%.0ftps, high=%.0ftps (stddev %.2f)\n"
541542
, xeqpsec*s24h_load_lo, xeqpsec*s24h_load_hi, s24h_load_std;
542-
printf "Hard parse %.1f%% first interval %.0fs-%.0fs then every %.0fs (stddev %.2f); marked red\n"
543-
, 100*s24h_hard_prb
544-
, s24h_hard_beg+(s24h_hard_skp*s24h_hard_avg)
545-
, s24h_hard_end+(s24h_hard_skp*s24h_hard_avg)
546-
, s24h_hard_avg
547-
, s24h_hard_std;
548-
printf "Full scan %.1f%% first interval %.0fs-%.0fs then every %.0fs (stddev %.2f); marked blue\n"
549-
, 100*s24h_scan_prb
550-
, s24h_scan_beg+(s24h_scan_skp*s24h_scan_avg)
551-
, s24h_scan_end+(s24h_scan_skp*s24h_scan_avg)
552-
, s24h_scan_avg
553-
, s24h_scan_std;
543+
if s24h_hard_prb > 0.0 then
544+
printf "Hard parse %.1f%% first interval %.0fs-%.0fs then every %.0fs (stddev %.2f); marked red\n"
545+
, 100*s24h_hard_prb
546+
, s24h_hard_beg+(s24h_hard_skp*s24h_hard_avg)
547+
, s24h_hard_end+(s24h_hard_skp*s24h_hard_avg)
548+
, s24h_hard_avg
549+
, s24h_hard_std;
550+
else
551+
printline "No hard parse injection";
552+
end if;
553+
if s24h_hard_prb > 0.0 then
554+
printf "Full scan %.1f%% first interval %.0fs-%.0fs then every %.0fs (stddev %.2f); marked blue\n"
555+
, 100*s24h_scan_prb
556+
, s24h_scan_beg+(s24h_scan_skp*s24h_scan_avg)
557+
, s24h_scan_end+(s24h_scan_skp*s24h_scan_avg)
558+
, s24h_scan_avg
559+
, s24h_scan_std;
560+
else
561+
printline "No full scan injection";
562+
end if;
554563
end if;
555564
printline "\nPooling information:";
556565
if pool_type = "sessionpool" or pool_type = "connectionpool" then

oltp/run.rwl

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0
33
# as shown at https://oss.oracle.com/licenses/upl/
44

5+
# bengsig 16-nov-2023 - Fix hard/scan during 24h sim
56
# bengsig 6-nov-2023 - burst function
67
# bengsig 1-nov-2023 - burst can be repeated
78
# bengsig 11-sep-2023 - max_sessionwait
@@ -122,24 +123,28 @@ if s24hour and procnumber = 1 then
122123
# the parameters may have changed if we redo oltpplot.
123124
file s24markers >= resultsdir "/r" runnumber/1000 "/" runnumber "/s24markers.plot";
124125
double mrkleft, mrklen;
125-
writeline s24markers, "# scan markers:";
126-
mrkleft := s24h_scan_beg+s24h_scan_skp*s24h_scan_avg;
127-
mrklen := s24h_scan_end-s24h_scan_beg;
128-
while mrkleft < runperiod loop
129-
fprintf s24markers,
130-
"set arrow from %.1f, graph -0.01 to %.1f, graph -0.01 lc rgb 'blue' heads size graph 0.005,90\n"
131-
, mrkleft, mrkleft+mrklen;
132-
mrkleft += s24h_scan_avg;
133-
end loop;
126+
if s24h_scan_prb > 0.0 then
127+
writeline s24markers, "# scan markers:";
128+
mrkleft := s24h_scan_beg+s24h_scan_skp*s24h_scan_avg;
129+
mrklen := s24h_scan_end-s24h_scan_beg;
130+
while mrkleft < runperiod loop
131+
fprintf s24markers,
132+
"set arrow from %.1f, graph -0.01 to %.1f, graph -0.01 lc rgb 'blue' heads size graph 0.005,90\n"
133+
, mrkleft, mrkleft+mrklen;
134+
mrkleft += s24h_scan_avg;
135+
end loop;
136+
end if;
137+
if s24h_hard_prb > 0.0 then
134138
writeline s24markers, "# hard parse markers:";
135-
mrkleft := s24h_hard_beg+s24h_hard_skp*s24h_hard_avg;
136-
mrklen := s24h_hard_end-s24h_hard_beg;
137-
while mrkleft < runperiod loop
138-
fprintf s24markers,
139-
"set arrow from %.1f, graph -0.02 to %.1f, graph -0.02 lc rgb 'red' heads size graph 0.005,90\n"
140-
, mrkleft, mrkleft+mrklen;
141-
mrkleft += s24h_hard_avg;
142-
end loop;
139+
mrkleft := s24h_hard_beg+s24h_hard_skp*s24h_hard_avg;
140+
mrklen := s24h_hard_end-s24h_hard_beg;
141+
while mrkleft < runperiod loop
142+
fprintf s24markers,
143+
"set arrow from %.1f, graph -0.02 to %.1f, graph -0.02 lc rgb 'red' heads size graph 0.005,90\n"
144+
, mrkleft, mrkleft+mrklen;
145+
mrkleft += s24h_hard_avg;
146+
end loop;
147+
end if;
143148
s24markers := null;
144149
end if;
145150

0 commit comments

Comments
 (0)