Professional Documents
Culture Documents
Linux Tuning For ASE and IQ
Linux Tuning For ASE and IQ
Linux Tuning For ASE and IQ
Q&A
Appendix
2 Sybase Confidential 8/11/10
A Few Session Notes ....
This is not a generalized ASE performance and
tuning session
Focus is more on Linux OS tunables that directly affect
ASE
No discussion of sp_configure parameters
Assumption is you have already tuned ASE for your
application :)
This is not a generalized Linux tuning session either
Only discusses those areas that directly affect
(improve) ASE performance
Recommendations are from RH benchmarking and SY
experience
YMMV when in doubt, benchmark!
http://www.redhat.com/rhel/resource_center/reference_architecture.html
180000
1 70000
160000
150000
140000
1 30000
1 20000
1 10000
100000
h ug epa ge s defa ult
Process on
C C C C S1C0
0 1 0 1
Memory Memory
S3 S4
S1 S2 S3 S4
Non-Interleaved (NUMA)
140000 9
120000 8.9
100000 8.8
KVM
Trans / min
60000 8.6
40000 8.5
20000 8.4
0 8.3
1 Guest 6 cpu 8G mem 2 Guest 6 cpu 8G mem
Guests
Sybase server with /proc/sys/vm/swappiness set to 10:
procsmemoryswapiosystemcpu
rbswpdfreebuffcachesisobiboincsussyidwa
8302422867243228069600238886377612862002024381326
17 0000
165055
163569
162110
1 60000
1 50000
1 40000
130000
12 0000
11 0000
1 00000
DEADLINE CFQ NOOP
RHEL5Direct_IOIOzoneEXT3,GFS,NFS
(Geom1M4GB,1k1m)
PerformanceinMB/sec
80
70
60
EXT_DIO
50
GFS1_DIO
40
NFS_DIO
30
20
10
0
ALL Initial Re Read Re Ran Ran Back RecRe Stride
I/O's Write Write Read dom dom ward Write Read
Read Write Read
1 35000 133322
1 30000
12 5000
12 0000
11 5000
11 0000
105000
100000
1 2
Xfs logbufs=8
Check ASE errorlog to make sure that direct I/O is being used on
filesystem-based devices
May have to explicitly enable; some versions of ASE
default to DSYNC when using filesystems
User Allocations
Reactivate
INACTIVE
ACTIVE FREE
(Dirty -> Clean)
User deletions
34 Sybase Confidential 8/11/10
Memory reclaim Watermarks
Free
All of RAM
List Do nothing
procsmemoryswapiosystemcpu
rbswpdfreebuffcachesisobiboincsussyidwa
00224571841078083350196000561136212008317
0022457184107808335019600001039198001000
0022457184107808335019600001021188001000
0022457184107808335019600001035204001000
0022457248107808335019600001008164001000
302242128160176143863600001030197015850
002243610656204344080028361027177032672
0022436106562043440800001026180001000
002243610720212344000080101018300991
memory
Default is 40%
Lower value means less dirty pagecache and smaller IO streams
Higher value means more dirty pagecache and larger IO streams
do_nothing
Many others available- iptraf, wireshark, etc
Sample use for some of these embedded in talk
47 Sybase Confidential 8/11/10
top - press h help,1-show cpus, m-memory, t-threads, > - column sort
top09:01:04up8days,15:22,2users,loadaverage:1.71,0.39,0.12
Tasks:114total,1running,113sleeping,0stopped,0zombie
Cpu0:5.3%us,2.3%sy,0.0%ni,0.0%id,92.0%wa,0.0%hi,0.3%si
Cpu1:0.3%us,0.3%sy,0.0%ni,89.7%id,9.7%wa,0.0%hi,0.0%si
Mem:2053860ktotal,2036840kused,17020kfree,99556kbuffers
Swap:2031608ktotal,160kused,2031448kfree,417720kcached
PIDUSERPRNIVIRTRESSHRS%CPU%MEMTIME+COMMAND
27830oracle1601315m1.2g1.2gD1.360.90:00.09oracle
27802oracle1601315m1.2g1.2gD1.061.00:00.10oracle
27811oracle1601315m1.2g1.2gD1.060.80:00.08oracle
27827oracle1601315m1.2g1.2gD1.061.00:00.11oracle
27805oracle1701315m1.2g1.2gD0.761.00:00.10oracle
27828oracle1502758466484620S0.30.30:00.17tpcc.exe
1root1604744580480S0.00.00:00.50init
2rootRT0000S0.00.00:00.11migration/0
3root3419000S0.00.00:00.00ksoftirqd/0
procsmemoryswapiosystemcpu
rbswpdfreebuffcachesisobiboincsussywaid
200548352420052423457600546315251303096
020169784020052439314400057850482108539941221463
300784420052457841090059330589463243144307321842
Vmstat10
procsmemoryswapiosystemcpu
rbswpdfreebuffcachesisobiboincsussywaid
200548352420052423457600546315251303096
02016623402005242345760057850482108539941221463
3023567873842005242345761875423745193589463243144307321842
Linux2.4.2127.0.2.ELsmp(node1)
avgcpu:%user%nice%sys%iowait%idle
0.400.002.630.9196.06
Device:rrqm/swrqm/sr/sw/srsec/swsec/srkB/swkB/savgrqszavgquszawaitsvctm%util
sdi16164.600.00523.400.00133504.000.0066752.000.00255.071.001.911.8898.40
sdi17110.100.00553.900.00141312.000.0070656.000.00255.120.991.801.7898.40
sdi16153.500.00522.500.00133408.000.0066704.000.00255.330.981.881.8697.00
sdi17561.900.00568.100.00145040.000.0072520.000.00255.311.011.781.76100.00
[root]sarnDEV
Linux2.4.2120.EL(localhost.localdomain)03/16/2005
01:10:01PMIFACErxpck/stxpck/srxbyt/stxbyt/srxcmp/stxcmp/srxmcst/s
01:20:00PMlo3.493.49306.16306.160.000.000.00
01:20:00PMeth03.893.532395.34484.700.000.000.00
01:20:00PMeth10.000.000.000.000.000.000.00
Tuning tools
ethtool View and change Ethernet card
settings
sysctl View and set /proc/sys settings
ifconfig View and set ethX variables
setpci View and set pci bus params for device
netperf Can run a bunch of different
network tests
/proc OS info, place for changing device
tunables
collection sort
--stop stop -t [percentage]
disk -d details
--
opannotate
event=:name:count -s /path/source
Example: -a /path/assembly
# opcontrol start
# /bin/time test1 &
# sleep 60
54 Sybase Confidential 8/11/10
oprofile opcontrol and opreport
cpu_cycles
#vmlinux2.6.9prep
CPU:Itanium2,speed1300MHz(estimated)
CountedCPU_CYCLESevents(CPUCycles)withaunitmaskof0x00(Nounitmask)count100000
samples%imagenameappnamesymbolname
909368968.9674vmlinuxvmlinuxdefault_idle
9698857.3557vmlinuxreread_spin_unlock_irq
7444455.6459vmlinuxreread_spin_unlock_irqrestore
4201033.1861vmlinuxvmlinux_spin_unlock_irqrestore
1464131.1104vmlinuxreread__blockdev_direct_IO
749180.5682vmlinuxvmlinux_spin_unlock_irq
652130.4946vmlinuxrereadkmem_cache_alloc
594530.4509vmlinuxvmlinuxdio_bio_complete
586360.4447vmlinuxrereadmempool_alloc
566750.4298scsi_mod.korereadscsi_decide_disposition
539650.4093vmlinuxrereaddio_bio_complete
530790.4026vmlinuxrereadbio_check_pages_dirty
530350.4022vmlinuxvmlinuxbio_check_pages_dirty
474300.3597vmlinuxvmlinux__end_that_request_first
472630.3584vmlinuxrereadget_request
433830.3290vmlinuxreread__end_that_request_first
402510.3053qla2xxx.korereadqla2xxx_get_port_name
359190.2724scsi_mod.koreread__scsi_device_lookup
355640.2697vmlinuxrereadaio_read_evt
328300.2490vmlinuxrereadkmem_cache_free
327380.2483scsi_mod.koscsi_modscsi_remove_host
Technology preview status until 5.1
56 Sybase Confidential 8/11/10
Profiling Tools: SystemTap
Technology: Kprobes:
In current 2.6 kernels
Upstream 2.6.12, backported to RHEL4 kernel
Kernel instrumentation without recompile/reboot
Uses software int and trap handler for instrumentation
Debug information:
Provides map between executable and source code
Generated as part of RPM builds
Available at: ftp://ftp.redhat.com
Safety: Instrumentation scripting language:
No dynamic memory allocation or assembly/C code
Types and type conversions limited
Restrict access through pointers
Script compiler checks:
Infinite loops and recursion Invalid variable access
57 Sybase Confidential 8/11/10
SystemTap: Kernel debugging
Tracepoints were added to RHEL5 kernel
trace_mm_filemap_fault(area>vm_mm,address,page);
trace_mm_anon_userfree(mm,addr,page);
trace_mm_filemap_userunmap(mm,addr,page);
trace_mm_filemap_cow(mm,address,new_page);
trace_mm_anon_cow(mm,address,new_page);
trace_mm_anon_pgin(mm,address,page);
trace_mm_anon_fault(mm,address,page);
trace_mm_page_free(page);
trace_mm_page_allocation(page,zone>free_pages);
trace_mm_pdflush_bgwriteout(_min_pages);
trace_mm_pdflush_kupdate(nr_to_write);
trace_mm_anon_unmap(page,ret==SWAP_SUCCESS);
trace_mm_filemap_unmap(page,ret==SWAP_SUCCESS);
trace_mm_pagereclaim_pgout(page,PageAnon(page));
trace_mm_pagereclaim_free(page,PageAnon(page));
trace_mm_pagereclaim_shrinkinactive_i2a(page);
trace_mm_pagereclaim_shrinkinactive_i2i(page);
trace_mm_pagereclaim_shrinkinactive(nr_reclaimed);
trace_mm_pagereclaim_shrinkactive_a2a(page);
trace_mm_pagereclaim_shrinkactive_a2i(page);
trace_mm_pagereclaim_shrinkactive(pgscanned);
trace_mm_pagereclaim_shrinkzone(nr_reclaimed);
trace_mm_directreclaim_reclaimall(priority);
trace_mm_kswapd_runs(sc.nr_reclaimed);
58 Sybase Confidential 8/11/10
SystemTap: Kernel debugging
Several custom scripts enable/use tracepoints
(see /usr/local/share/doc/systemtap/examples)
#!/usr/local/bin/stap
globaltraced_pid
functionlog_event:long()
{
return(!traced_pid||traced_pid==(task_pid(task_current())))
}
probekernel.trace("mm_pagereclaim_shrinkinactive"){
if(!log_event())next
reclaims[pid()]++
command[pid()]=execname()
}
//MMkerneltracepointsprologandepilogroutines
probebegin{
printf("Startingmmtracepoints\n");
traced_pid=target();
if(traced_pid){
printf("modeSpecificPid,tracedpid:%d\n",traced_pid);
}else{
printf("modeAllPids\n");
}
printf("\n");
}
probeend{
printf("Terminatingmmtracepoints\n");
printf("CommandPidDirectActivateDeactivateReclaimsFreed\n");
printf("\n");
foreach(pidinreclaims)