home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / DBPERF.ZIP / DBPERF.INF (.txt)
OS/2 Help File  |  1991-05-31  |  25KB  |  774 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. PURPOSE ΓòÉΓòÉΓòÉ
  3.  
  4. Provide a single point of reference for performance inspections. 
  5.  
  6.  ABSTRACT 
  7.  GOALS 
  8.  
  9.  
  10. ΓòÉΓòÉΓòÉ 1.1. ABSTRACT ΓòÉΓòÉΓòÉ
  11.  
  12. Most customers are happy with the performance of IBM's database engine once it 
  13. has been optimally tuned.  Getting to the optimal state, though, can be a 
  14. difficult prospect at best. Difficulties that contribute to this problem 
  15. include the complexity of the operating system, the wide range of performance 
  16. improvement techniques, and the lack of performance tools and documentation. 
  17. This document is intended to ease this pain by consolidating many performance 
  18. tips and techniques into a central forum. 
  19.  
  20.  
  21. ΓòÉΓòÉΓòÉ 1.2. GOALS ΓòÉΓòÉΓòÉ
  22.  
  23.   1. Reduce the time required to gather resources for performance tuning. 
  24.  
  25.   2. Provide general information detailing the relative costs and benefits of 
  26.      specific techniques that may be used to improve performance for the IBM 
  27.      OS/2 EE Database Manager. 
  28.  
  29.   3. Provide a comprehensive guide of performance improvement techniques for 
  30.      the IBM OS/2 EE Database Manager. 
  31.  
  32.   4. Provide general rules of thumb that apply to these techniques. 
  33.  
  34.  
  35. ΓòÉΓòÉΓòÉ 2. DATABASE DESIGN ΓòÉΓòÉΓòÉ
  36.  
  37.  INDEX STRUCTURE 
  38.  TABLE DESIGN 
  39.  SINGLE DATABASE 
  40.  
  41.  
  42. ΓòÉΓòÉΓòÉ 2.1. INDEX STRUCTURE ΓòÉΓòÉΓòÉ
  43.  
  44. The impact of indexes cannot be over emphasized.  In read-only situations, it 
  45. is usually worth while to create an index on fields which will be used for 
  46. joins or will otherwise appear in 'WHERE' or 'SORT' clauses of an SQL query. 
  47. Indexes should always exist on primary keys of larger tables. Creating 
  48. appropriate indexes can reduce response times by 90% or more in certain 
  49. situations.  In other situations, table access may not be required at all if 
  50. all of the fields needed by a query exist in the index. 
  51.  
  52. There are situations where creating indexes can degrade system performance. 
  53. Updating, deleting from, or adding to a table with indexes takes longer than 
  54. updating a table without indexes, once the record is found.  This is true 
  55. because the indexes must also be updated.  If a table is write-only or has more 
  56. writes than reads, then this may be a serious consideration. Most tables, 
  57. however, do not fit this description. 
  58.  
  59. Index performance has an interesting effect on imports.  It is much faster to 
  60. import a table, and then create the index than to create the index and then 
  61. import the table.  This is true because of the added overhead of updating the 
  62. index. 
  63.  
  64. The 'EXPLAIN' tool can be used to see if an index is used in a particular 
  65. query.  Through intelligent use of this tool and good table design, significant 
  66. performance improvements may be realized. 
  67.  
  68. Rules:
  69.  
  70.  1) Use appropriate indexes in columns referenced in 'WHERE',
  71.     'ORDER BY' clauses to speed reads.
  72.  
  73.  2) Use 'EXPLAIN' to see how indexes are used (static SQL only).
  74.  
  75.  3) Remove seldomly used indexes to improve updates, deletes, and
  76.     inserts.
  77.  
  78.  4) Import tables before creating indexes.
  79.  
  80.  
  81. ΓòÉΓòÉΓòÉ 2.2. TABLE DESIGN ΓòÉΓòÉΓòÉ
  82.  
  83. This area must be considered at application design time.  The idea here is to 
  84. minimize joins where possible.  Though separating tables may be a good idea to 
  85. reduce redundancy, sometimes it is worth while to merge these tables into one. 
  86. If it is known that two tables will be joined frequently and the two tables 
  87. could logically be thought of as a single table, then merging the tables could 
  88. save many costly joins in the future.  For example, consider two tables, person 
  89. and address.  It may make sense to separate these tables to reduce redundancy 
  90. if more than one persons may live at the same address. This would avoid the 
  91. same address from being entered several times. However, if most reports 
  92. required information from person and address (for example, home city and state, 
  93. and person's social security and employee numbers), then it may be better to 
  94. merge these tables into one. 
  95.  
  96. Rules:
  97.  
  98.  1) Normalize tables to decrease redundancy, and then
  99.  
  100.  2) Merge large tables that will be frequently joined.
  101.  
  102.  
  103. ΓòÉΓòÉΓòÉ 2.3. SINGLE DATABASES ΓòÉΓòÉΓòÉ
  104.  
  105. It is important to carefully limit the number of databases on a server. 
  106. Significant overhead is involved whenever multiple databases are opened on a 
  107. single server.  A far better strategy is to place all of the tables from 
  108. multiple databases within a single database. 
  109.  
  110.  
  111. Rules:
  112.  
  113.  1) When possible, have only a single database on a server.
  114.  
  115.  
  116. ΓòÉΓòÉΓòÉ 3. APPLICATION DESIGN ΓòÉΓòÉΓòÉ
  117.  
  118.  LOCKING 
  119.  COMMITS 
  120.  APPLICATION REMOTE INTERFACE (ARI) 
  121.  REMOTE DATA SERVICES ALTERNATIVES 
  122.  STATIC vs DYNAMIC SQL 
  123.  
  124.  
  125. ΓòÉΓòÉΓòÉ 3.1. LOCKING ΓòÉΓòÉΓòÉ
  126.  
  127. The idea here is to choose the best granularity possible for the sake of 
  128. concurrency.  A reading process and a writing process may not hold a lock on 
  129. the same object.  Processes may hold locks to read the same object. No two 
  130. processes may hold locks to write the same object.  Obviously, if some process 
  131. has a table write-locked, then no one can touch the table until the process 
  132. commits or rolls back.  As a general rule, then, in a multi-user system, it is 
  133. better to lock records than tables.  If the locked list parameter is not set 
  134. high enough, then locks will be upgraded to table locks, and significantly 
  135. impact concurrency. 
  136.  
  137. In a situation where concurrent access will not be a problem, then it is better 
  138. to take out a single table lock than row level locks, because there is less 
  139. overhead. 
  140.  
  141. Rules:
  142.  
  143.  1) In a multi user system, row level locking yields better
  144.     concurrency, thus better overall performance.
  145.  
  146.  
  147. ΓòÉΓòÉΓòÉ 3.2. COMMITS ΓòÉΓòÉΓòÉ
  148.  
  149. Managing commits involves two conflicting goals.  Commits do take a certain 
  150. amount of overhead, in the form of log maintenance and other things. Commits 
  151. do, however, free resources that may be used by other processes, most notably 
  152. locks.  It is important to understand that locks are accumulated on the system 
  153. tables even in read only SQL (selects) and even in the uncommitted read level 
  154. of isolation, so even in these situations it is important to commit, to free up 
  155. locks on system tables. 
  156.  
  157. Rules:
  158.  
  159.  1) Reduce database operations between commits
  160.     (ie increase commits) to increase concurrency.
  161.  
  162.  2) Never commit in the middle of a logical unit of work.
  163.  
  164.  3) Reduce the number of commits to improve the performance within
  165.     a single process when the concurrency impact may be tolerated.
  166.  
  167.  
  168. ΓòÉΓòÉΓòÉ 3.3. APPLICATION REMOTE INTERFACE (ARI) ΓòÉΓòÉΓòÉ
  169.  
  170. The Application Remote Interface is one of the most important, yet least used, 
  171. of all performance techniques.  It is used to execute a block of code on the 
  172. server.  When several different queries may be combined into a single procedure 
  173. to be executed on the server, system performance is improved in several ways. 
  174. First, communication costs are reduced. SQLCA's and SQLDA's must only be moved 
  175. to and from the server once. Second, the faster microprocessor on the server 
  176. may be utilized. Instructions that would be normally executed on the requester 
  177. are moved to the server, which is normally a vastly superior machine. 
  178. Finally, the intermediate control blocks required by Remote Data Services for 
  179. each SQL call do not need to be packed for every call.  This leads to further 
  180. savings of the requester CPU, and usually offsets the additional responsibility 
  181. of the server. 
  182.  
  183. To use the ARI, precompile, compile, and link the remote procedure to be called 
  184. into a DLL.  Place the DLL on the server, and use the database manager API to 
  185. call the remote procedure.  Data may be passed to and from the remote procedure 
  186. using SQLDA's. 
  187.  
  188. Rules:
  189.  
  190.  1) Use the ARI when several database calls may be packed into a
  191.     single function on the server.
  192.  
  193.  2) Use the ARI to take advantage of an underused server or to
  194.     offload an overused requester.
  195.  
  196.  
  197. ΓòÉΓòÉΓòÉ 3.4. REMOTE DATA SERVICES ALTERNATIVES ΓòÉΓòÉΓòÉ
  198.  
  199. For some platforms, Remote Data Services can not handle enough concurrent 
  200. connections to perform the required service.  This is true because each process 
  201. connecting to the database uses an additional 120KB-150KB of memory on the 
  202. server.  Eventually, memory runs out, and performance degenerates drastically. 
  203. There are several alternatives. 
  204.  
  205.  Consider a localized solution.  This may seem obvious, but in many situations, 
  206.  a local solution will suffice. 
  207.  
  208.  Use named pipes to pass requests to a service process on the server. This 
  209.  process can then talk to the database through a single connection on the 
  210.  server.  This solution has been used quite effectively by many customers. 
  211.  
  212.  Implement a scheduler on the server.  In this situation, there are several 
  213.  service processes on the server.  Each process is scheduled to be serviced by 
  214.  one of the available server. 
  215.  
  216.   Rules:
  217.  
  218.    1) Use Remote Data Services when the platform will work.
  219.  
  220.    2) Consider the above alternatives when it will not.
  221.  
  222.  
  223. ΓòÉΓòÉΓòÉ 3.5. STATIC vs DYNAMIC SQL ΓòÉΓòÉΓòÉ
  224.  
  225. The database manager supports two different types of SQL: static and dynamic. 
  226. Static SQL is bound before the program is executed, either at precompile time, 
  227. or bind time.  With static SQL, the statements that are to be run must be known 
  228. in advance.  Dynamic SQL is bound at run time.  It must be bound each time the 
  229. cursor for the statement is opened.  Obviously, it is better to pay the bind 
  230. penalty when the ".exe" file is created instead of when the program is 
  231. executed.  Therefore, when it is known which SQL statements will be run in 
  232. advance, it is better to use static SQL. 
  233.  
  234. An exception is that if an SQL statement contains a statement like "LIKE 
  235. :variable", then the optimizer does not have enough information to decide if an 
  236. index is usable.  If the like clause looks like "ABC%", then an index is in 
  237. fact usable, and would be used for dynamic SQL. 
  238.  
  239.  
  240. Rules:
  241.  
  242.  1) Use STATIC SQL when SQL statements are known in advance.
  243.  
  244.  2) For statements in the form "LIKE :var", use dynamic SQL.
  245.  
  246.  
  247. ΓòÉΓòÉΓòÉ 4. PS/2 HARDWARE CONFIGURATION ΓòÉΓòÉΓòÉ
  248.  
  249.  SPLITTING THE LOG AND DATABASE 
  250.  MEMORY 
  251.  PROCESSING POWER 
  252.  
  253.  
  254. ΓòÉΓòÉΓòÉ 4.1. SPLITTING THE LOG AND DATABASE ΓòÉΓòÉΓòÉ
  255.  
  256. Some performance improvements may be made based on the disk configuration. 
  257. Better performance can be achieved by placing the database and the database 
  258. logs on different physical hard disks.  This is true because some degree of 
  259. concurrency can be realized by accessing both drives at the same time. SCSI 
  260. devices can make the improvements even more pronounced.  If only one physical 
  261. drive is available, then it is better to place the logs and the database on 
  262. contiguous partitions or the same partition.  Also, the partition(s) should be 
  263. as close as possible to the center of the drive. For example, if a hard disk 
  264. were partitioned into drives C,D,E, and F, an acceptable configuration would be 
  265. to place the database on drive D and the log on drive E.  This will minimize 
  266. the lateral movement of the disk head. 
  267.  
  268. Rules:
  269.  
  270.  1) Place the database and the database log on different physical
  271.     hard disk drives when possible to maximize concurrency.
  272.  
  273.  2) If 1) is not possible, then place the database and log on
  274.     adjacent partitions, or the same partition.
  275.  
  276.  3) Place the database and log on partitions as close to the center
  277.     of the disk as possible.
  278.  
  279.  
  280. ΓòÉΓòÉΓòÉ 4.2. MEMORY ΓòÉΓòÉΓòÉ
  281.  
  282. If there is not enough memory on the server to adequately handle the number of 
  283. workstations, then performance will degenerate drastically as activity and the 
  284. number of database connections increases..  Each requester will use an 
  285. additional 120-150KB of memory. 
  286.  
  287. Rules:
  288.  
  289.  1) Make sure that the server has adequate memory resources to
  290.     handle the load expected of it.
  291.  
  292.  
  293. ΓòÉΓòÉΓòÉ 4.3. PROCESSING POWER ΓòÉΓòÉΓòÉ
  294.  
  295. Contrary to intuition, the database manager is a CPU intensive application. 
  296. Therefore, improvements to the CPU will usually have positive effects on 
  297. transaction through put.  There are exceptions, such as abnormally low 
  298. concurrency, or high update activity which may reduce the impact of a different 
  299. CPU on any given database server. 
  300.  
  301. Rules:
  302.  
  303.  1) Make sure that the server has adequate processing resources
  304.     to handle the load expected of it.
  305.  
  306.  
  307. ΓòÉΓòÉΓòÉ 5. PERFORMANCE RELATED FEATURES ΓòÉΓòÉΓòÉ
  308.  
  309.  RECORD BLOCKING 
  310.  ISOLATION LEVELS 
  311.  SQLLOO 
  312.  REORG/RUNSTATS 
  313.  
  314.  
  315. ΓòÉΓòÉΓòÉ 5.1. RECORD BLOCKING ΓòÉΓòÉΓòÉ
  316.  
  317. Record blocking can improve the performance of read-only queries which read 
  318. multiple database rows.  For such a query, when the requester does a single 
  319. fetch, a block of data is moved to the requester.  The requester then reads 
  320. from its private block instead of requesting additional rows from the server. 
  321. Record blocking is transparent to the user application. Record blocking is a 
  322. bind time parameter.  To ensure that record blocking is used only where it can 
  323. be effective, use the '/K=UNAMBIG' option when binding, and specify cursors 
  324. which will not be updated, deleted, or inserted as 'FOR FETCH ONLY'.  This 
  325. series of steps will ensure record blocking for all fetch transactions.  The 
  326. default is 'UNAMBIG' which uses record blocking for all cursors which are 
  327. fetch-only.  Record blocking is a way to significantly improve performance 
  328. without doing much work.  Gains will be most pronounced when many database rows 
  329. are expected to be returned from frequently used queries.  To ensure that 
  330. record blocking will be used for dynamic SQL, then the record blocking 
  331. parameter should be set to 'ALL' at bind time. 
  332.  
  333. Rules:
  334.  
  335.  1) Use record blocking whenever possible for FETCH cursors.
  336.  
  337.  2) Set the record blocking parameter to 'ALL' for dynamic SQL.
  338.  
  339.  
  340. ΓòÉΓòÉΓòÉ 5.2. ISOLATION LEVELS ΓòÉΓòÉΓòÉ
  341.  
  342. Isolation levels, from strongest to weakest, are Repeatable Read, Cursor 
  343. Stability, and Uncommitted Read.  Isolation levels, from fastest to slowest, 
  344. are Uncommitted Read, Cursor Stability, and Repeatable Read. If the isolation 
  345. levels required are not clearly understood, then it is best to err on the side 
  346. of caution and use the strongest isolation level. Otherwise, it is best to use 
  347. the weakest (and thus fastest), isolation level that can be tolerated.  It is 
  348. important to note that an uncommitted read could give me a value that was never 
  349. committed, and thus never existed for the purposes of the database! 
  350.  
  351. In general, the Repeatable Read will never yield inconsistent results. It 
  352. implements an industry standard locking scheme known as two phased locking. 
  353. Cursor Stability is acceptable unless there are dependencies between several 
  354. rows of the same table that must be preserved. Uncommitted Read is only 
  355. acceptable in situations which do not require consistent data, or in situations 
  356. in which it is known that the data being examined will not change. 
  357.  
  358. Rules:
  359.  
  360.  1) If isolation levels are not clearly understood, use the
  361.     Repeatable Read isolation level.
  362.  
  363.  2) Use the weakest, and thus fastest, isolation level that may be
  364.     tolerated by the application.
  365.  
  366.  
  367. ΓòÉΓòÉΓòÉ 5.3. SQLLOO ΓòÉΓòÉΓòÉ
  368.  
  369. SQLLOO (Lan Only Option) is a faster communication protocol than APPC. However, 
  370. SQL/LOO is not always a viable alternative.  LOO is the default communication 
  371. protocol for RDS. 
  372.  
  373. APPN may be as fast as SQLLOO for some applications.  APPN is available 
  374. separately from IBM as an OS/2 EE extension. 
  375.  
  376. Rules:
  377.  
  378.  1) When possible, use SQL/LOO as the communication protocol.
  379.  
  380.  
  381. ΓòÉΓòÉΓòÉ 5.4. REORG/RUNSTATS ΓòÉΓòÉΓòÉ
  382.  
  383. After significant insert, delete, and update activity, a database table may 
  384. become significantly fragmented, and the statistics used by the optimizer 
  385. outdated, forcing bad optimization strategies and overall performance 
  386. degradation.  Running statistics can update the optimizer statistics for a 
  387. table.  Reorganizing the table resolves the fragmentation problems.  It also 
  388. puts the database records in the order of a specified index, which 
  389. significantly improves performance when table scans are needed. 
  390.  
  391. Performance benefits of a 'Reorganize' will not be realized unless statistics 
  392. are run afterwards.  Running statistics, however, does not mandate a 
  393. reorganization.  Similarly, after a RUNSTATS, a rebind is necessary. 
  394.  
  395. Rules:
  396.  
  397.  1) When the system will be quiesced for a period of time, such as
  398.     overnight, reorganize the tables and run statistics.
  399.  
  400.  2) Reorganize and run statistics after a significant number of
  401.     deletes, which cause fragmentation.
  402.  
  403.  3) Run statistics after the size of a table significantly changes.
  404.  
  405.  4) Runstats and rebind dependant access plans after a reorg.
  406.  
  407.  
  408. ΓòÉΓòÉΓòÉ 6. METHODOLOGY ΓòÉΓòÉΓòÉ
  409.  
  410.  PERFORMANCE MANAGEMENT TOOLS 
  411.  SIMULATION/PROTOTYPING 
  412.  BENCHMARK AND TUNING METHODOLOGY 
  413.  
  414.  
  415. ΓòÉΓòÉΓòÉ 6.1. PERFORMANCE MANAGEMENT TOOLS ΓòÉΓòÉΓòÉ
  416.  
  417. In order to be able to make the best performing system possible, it is 
  418. important to have the best performance data possible.  The best way to gather 
  419. this data is from trace points placed within an application. The trace points 
  420. should record a unique identifier, the time that the trace point was 
  421. encountered, and any other pertinent information.  In order to get the most 
  422. information without impacting system performance, this information should be 
  423. written to shared memory, which could be dumped on demand.  The dump can then 
  424. be analyzed and recorded.  It is important to save data from old runs, so that 
  425. an accurate picture of an application's performance history may be assimilated 
  426. and the performance characteristics of all components of the current system 
  427. assessed. 
  428.  
  429. Rules:
  430.  
  431.  1) Build performance gathering tools into the application.
  432.  
  433.  2) Maintain an accurate and complete performance history.
  434.  
  435.  
  436. ΓòÉΓòÉΓòÉ 6.2. SIMULATION/PROTOTYPING ΓòÉΓòÉΓòÉ
  437.  
  438. One of the most common mistakes made in any field is assuming.  This is an 
  439. especially dangerous practice with OS/2 EE.  Because there are so many tightly 
  440. coupled variables, it is almost impossible to predict what the overall system 
  441. performance will be.  For this reason, it is important to prototype a working 
  442. benchmark system as quickly as possible.  A good benchmark will represent the 
  443. real world as closely as possible in as many areas as possible, including the 
  444. number of users, size and composition of database requests, the size of the 
  445. database, and the LAN topology and system configurations.  The prototype does 
  446. not have to LOOK like the final product, but merely to ACT like the final 
  447. product.  For this reason, many people use a script of some type.  Care should 
  448. be taken, though, to consider the amount of conflict that is to be expected in 
  449. the real world. For example, a script containing updates to the same record on 
  450. all machines would generate locking conflict that would not be expected in the 
  451. real world.  Similarly, if none of the data sets overlapped, the amount of 
  452. conflict could be artificially low.  Many people use some form of random number 
  453. stream which is recorded in a file, with a different stream on each machine. 
  454. This has the desired effect of being reproducible, and represents many real 
  455. world situations closely. 
  456.  
  457. Rules:
  458.  
  459.  1) Prototype early.
  460.  
  461.  2) Prototype often.
  462.  
  463.  3) Prototype late.
  464.  
  465.  4) Represent the real world as closely as is practical.
  466.  
  467.  
  468. ΓòÉΓòÉΓòÉ 6.3. BENCHMARK AND TUNING METHODOLOGY ΓòÉΓòÉΓòÉ
  469.  
  470. When tuning the database manager for performance, it is important to tightly 
  471. control the entire process.  There are several things to keep in mind.  First, 
  472. several performance runs must be made.  The initial run should be discarded, as 
  473. DLL's must be swapped in, and the DBM initialized. Afterwards, from two to five 
  474. runs should be made under identical conditions and the average of all runs 
  475. taken.  Second, only a single parameter should be changed between performance 
  476. runs.  This is the only way that the results of each benchmark can be 
  477. accurately assessed.  Finally, the parameters for which the largest gain is 
  478. expected should be changed first.  In this way, the system may be tuned until 
  479. some goal is reached, and the tuning process completed with the confidence that 
  480. the most significant parameters have been refined. 
  481.  
  482. Rules:
  483.  
  484.  1) Control the environment.
  485.  
  486.  2) Discard the first run.
  487.  
  488.  3) Average more than one run.
  489.  
  490.  4) Tune one parameter at a time, starting with 'heavy hitters'.
  491.  
  492.  5) Set realistic goals, and stop when the goals are realized.
  493.  
  494.  
  495. ΓòÉΓòÉΓòÉ 7. OS/2 EE CONFIGURATION ΓòÉΓòÉΓòÉ
  496.  
  497.  TURN TRACE OFF 
  498.  FILE SYSTEMS - HPFS vs FAT 
  499.  QUERY MANAGER ROW POOL 
  500.  SUGGESTED DATABASE MANAGER CONFIG PARAMETERS 
  501.  SUGGESTIONS FOR LOG CONFIGURATIONS 
  502.  SUGGESTED DATABASE CONFIG PARAMETERS 
  503.  
  504.  
  505. ΓòÉΓòÉΓòÉ 7.1. TURN TRACE OFF ΓòÉΓòÉΓòÉ
  506.  
  507. The OS/2 trace can significantly slow the system, sometimes by a factor of 2 or 
  508. 3.  If performance degenerates unexpectedly, first make sure that the OS/2 
  509. trace has not been turned on inadvertently. 
  510.  
  511. Rules:
  512.  
  513.  1) Make sure that the OS/2 Trace is not on.
  514.  
  515.  
  516. ΓòÉΓòÉΓòÉ 7.2. FILE SYSTEMS - HPFS vs FAT ΓòÉΓòÉΓòÉ
  517.  
  518. The OS/2 database manager cannot take full advantage of all features of the 
  519. High Performance File System.  This is particularly true of the cache. Since 
  520. data reliability is so important to the database manager, all log records must 
  521. be immediately written to the disk.  This defeats the purpose of the cache, 
  522. which tries to avoid disk activity by keeping frequently accessed information 
  523. in memory.  The database implements its own cache, called the buffer pool. 
  524. Even so, the database is slightly, but not significantly, faster on HPFS.  The 
  525. log is faster on FAT. 
  526.  
  527. Rules:
  528.  
  529.  1) Use HPFS for the database and FAT for the logs.
  530.  
  531.  
  532. ΓòÉΓòÉΓòÉ 7.3. QUERY MANAGER ROW POOL ΓòÉΓòÉΓòÉ
  533.  
  534. Query Manager scrolling performance can be improved by increasing the size of 
  535. the Query Manager row pool.  Beginning with release 1.2, Query Manager began 
  536. formatting an entire row of data, instead of just a screenfull of data.  This 
  537. made horizontal scrolling smoother, but required a larger row pool.  For this 
  538. reason, the default row pool is no longer adequate for many applications.  Note 
  539. that this impacts the scrolling performance in Query Manager only.  This is a 
  540. Query Manager startup parameter. 
  541.  
  542. Rules:
  543.  
  544.  1) To improve the vertical scrolling performance in Query Manager,
  545.     specify a larger row pool.
  546.  
  547.  
  548. ΓòÉΓòÉΓòÉ 7.4. SUGGESTED DATABASE MANAGER CONFIG PARAMETERS ΓòÉΓòÉΓòÉ
  549.  
  550.   - Shared segments: 802
  551.  
  552.     Since this is a 'high water mark' (ie the system takes only what it
  553.     needs, not to exceed 802), this parameter should be kept at the
  554.     maximum.
  555.  
  556.   - Databases: (number of databases)
  557.  
  558.     This parameter should be set to the number of DATABASES that may be
  559.     opened AT THE SAME TIME.  This parameter should not be set higher than
  560.     the required number.
  561.  
  562.   - Req I/O Block Size: 4096
  563.  
  564.     The default is OK here.
  565.  
  566.   - Srv I/O Block Size: 4096
  567.  
  568.     The default is OK here.
  569.  
  570.   - Remote Connections
  571.  
  572.     This is used to estimate the optimal communications buffer size.
  573.     If the number is too small, the system will function, but with
  574.     slightly lower performance.
  575.  
  576.  
  577. ΓòÉΓòÉΓòÉ 7.5. SUGGESTIONS FOR LOG CONFIGURATIONS ΓòÉΓòÉΓòÉ
  578.  
  579. A small number of large logs is better than a large number of small logs.  The 
  580. size of the logs required will depend on the application. Some general 
  581. information about logs would be appropriate to discuss here.  Logs in OS/2 1.2 
  582. are circular in structure.  The same log space is used over and over.  When a 
  583. piece of a log is no longer needed, the space is then reclaimed.  In this 
  584. process, secondary logs are reduced to a file of size zero.  Primary logs are 
  585. initialized.  This reclaim process is most likely to occur when the entire log 
  586. space (primary + secondary) is completely full.  At this point, users will see 
  587. a noticeable delay.  The bigger the log space, the longer the delay. The 
  588. primary logs should be large enough to handle most situations, but secondary 
  589. logs should be allocated to avoid secondary log initialization delays. 
  590.  
  591. Operations that require a large log space are reorgs and imports of large 
  592. tables.  Read-only transactions are not logged.  Update, delete, and insert 
  593. transactions are always logged. 
  594.  
  595. As discussed previously, for performance, it is better to have the logs on a 
  596. different physical hard disk than the database.  The database runs faster when 
  597. the log is placed on a FAT (non-HPFS) partition. 
  598.  
  599. Rules:
  600.  
  601.  1) Place the database on HPFS, and the LOG on a separate
  602.     physical FAT partition
  603.  
  604.  2) A small number of large logs is better than a large number
  605.     of small logs.
  606.  
  607.  
  608. ΓòÉΓòÉΓòÉ 7.6. SUGGESTED DATABASE CONFIG PARAMETERS ΓòÉΓòÉΓòÉ
  609.  
  610.   - buffer pages >= 250  (server only)
  611.  
  612.     This parameter is one of the most important parameters to consider when
  613.     tuning database performance.  If it is not large enough, performance
  614.     will be significantly degraded.  If the parameter is much too large,
  615.     then additional system resources will be used (memory).  It is more
  616.     important to have the parameter large enough than small enough.
  617.  
  618.   - deadlock check interval = (default)
  619.  
  620.     This parameter does not significantly impact system performance.  It
  621.     can be set to the default value and increased if deadlock is a problem.
  622.  
  623.   - Lock List Pages = 25
  624.  
  625.     This parameter will impact concurrency if it is too small.  If the
  626.     application is expected to hold many locks concurrently (ie long
  627.     transactions with Repeatable Read level of isolation; long transactions
  628.     that update, insert, or delete large numbers of records), then this
  629.     parameter must be increased.  Increase if concurrency problems show up.
  630.  
  631.   - Lock List Percent per Application = 6
  632.  
  633.     This parameter should be large enough for each connected application
  634.     to have access to the locks that it requires.
  635.  
  636.   - Max Open Files = 255  (high water mark)
  637.  
  638.   - Max Open Files Per Application = 25   (high water mark)
  639.  
  640.   - Application Heap = 5
  641.  
  642.     The application will fail with a specific return code if this parameter
  643.     is not set high enough.
  644.  
  645.   - Database Heap = 5
  646.  
  647.     The application will fail as above if this parameter is not high enough.
  648.  
  649.   - Communications Heap = (RQRIOBLK * m + 65535) / 65535 where m is the
  650.     maximum number of concurrently open cursors used by an application.
  651.  
  652.   - Sort List Heap = 2
  653.  
  654.     This should be increased if large tables are sorted or joined.  This is
  655.     also an important parameter to tune.
  656.  
  657.   - Statement Heap = (?)
  658.  
  659.     This parameter has no impact on runtime performance.  Only precompiler
  660.     performance is affected.
  661.  
  662.     Rules:  1) 'Buffer Pages' and Sort Heap are the most significant.
  663.  
  664.  
  665. ΓòÉΓòÉΓòÉ 8. APPENDIX ΓòÉΓòÉΓòÉ
  666.  
  667.  PERFORMANCE TECHNIQUES 
  668.  PERFORMANCE PARAMETERS 
  669.  
  670.  
  671. ΓòÉΓòÉΓòÉ 8.1. PERFORMANCE TECHNIQUES ΓòÉΓòÉΓòÉ
  672.  
  673. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  674. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  675. ΓöéTechnique          ΓöéImplementationΓöéExpected     ΓöéCost    ΓöéHeavy Γöé
  676. Γöé                   Γöé      Time    ΓöéPayoff       Γöé        ΓöéHitterΓöé
  677. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  678. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  679. ΓöéIncrease Memory    Γöé      Any     ΓöéHigh         ΓöéLow ($) Γöé Yes  Γöé
  680. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  681. ΓöéTurn Trace Off     Γöé      Any     ΓöéHigh (40-70%)ΓöéNone    Γöé Yes  Γöé
  682. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  683. ΓöéAp Remote InterfaceΓöé Early in Dev.ΓöéHigh (10-60%)ΓöéHigh    Γöé Yes  Γöé
  684. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  685. ΓöéRecord Blocking    Γöé      Any     ΓöéHigh (5-40%) ΓöéLow     Γöé Yes  Γöé
  686. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  687. ΓöéIndex Restructure  Γöé      Any     ΓöéHigh (0%-90%)ΓöéLow     Γöé Yes  Γöé
  688. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  689. ΓöéSplit Log/2 Drives Γöé      Any     ΓöéMedium(5-30%)ΓöéLow ($) Γöé Yes  Γöé
  690. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  691. ΓöéCommits            Γöé Development  ΓöéHigh         ΓöéHigh    Γöé Yes  Γöé
  692. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  693. ΓöéQuery Mgr Row Pool Γöé      Any     ΓöéHigh (5-60%) ΓöéLow     Γöé      Γöé
  694. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  695. ΓöéReorg/Runstats     Γöé In ProductionΓöéMedium       ΓöéMedium  Γöé      Γöé
  696. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  697. ΓöéPerformance Bnchmk Γöé      All     ΓöéHigh         ΓöéHigh    Γöé      Γöé
  698. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  699. ΓöéComm Mgr Xmit BlockΓöé      Any     ΓöéMedium       ΓöéMedium  Γöé      Γöé
  700. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  701. ΓöéTable Restructure  Γöé     Early    ΓöéMedium       ΓöéHigh    Γöé      Γöé
  702. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  703. ΓöéLocking            Γöé Development  ΓöéMedium       ΓöéHigh    Γöé      Γöé
  704. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  705. ΓöéSQLLOO             Γöé      Any     ΓöéLow          ΓöéLow     Γöé      Γöé
  706. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  707. ΓöéHPFS/FAT partitionsΓöé      Any     ΓöéLow  (2-5%)  ΓöéLow     Γöé      Γöé
  708. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  709. ΓöéIsolation Levels   Γöé Late in Dev. ΓöéLow          ΓöéMedium  Γöé      Γöé
  710. Γöé                   Γöé              Γöé             Γöé        Γöé      Γöé
  711. ΓöéStatic SQL         Γöé Development  ΓöéLow          ΓöéMedium  Γöé      Γöé
  712. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  713. Heavy hitters are parameters with high payoff/cost ratios.
  714.  
  715. Implementation Time deals with the point in the development cycle
  716. that is most appropriate for the implementation of the technique.
  717.  
  718.  
  719. ΓòÉΓòÉΓòÉ 8.2. PERFORMANCE PARAMETERS ΓòÉΓòÉΓòÉ
  720.  
  721. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  722. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  723. ΓöéParameter          ΓöéTradeoff          ΓöéExpectedΓöéSuggested  ΓöéHeavy Γöé
  724. Γöé                   Γöé(Give / Take)     ΓöéPayoff  Γöé  Value    ΓöéHitterΓöé
  725. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  726. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  727. ΓöéShared Segments    ΓöéNone              ΓöéLow     Γöé802        Γöé      Γöé
  728. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  729. ΓöéDatabases          Γöé# db's / memory   ΓöéLow     Γöé# databasesΓöé      Γöé
  730. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  731. ΓöéReq I/O block size Γöésize Xmit / memoryΓöéLow     Γöédefault    Γöé      Γöé
  732. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  733. ΓöéSrv I/O block size Γöésize Xmit / memoryΓöéLow     Γöédefault    Γöé      Γöé
  734. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  735. ΓöéRemote Connections Γöéspeed / memory    ΓöéLow     Γöé# remote cnΓöé      Γöé
  736. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  737. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  738. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  739. ΓöéLog File Size      Γöélog KB/DASD,speed ΓöéMedium  Γöéhigh       Γöé      Γöé
  740. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  741. ΓöéPrimary Logs       Γöélog KB/DASD,speed ΓöéMedium  Γöélow        Γöé      Γöé
  742. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  743. ΓöéSecondary Logs     Γöéinit time/run timeΓöéMedium  Γöénone       Γöé      Γöé
  744. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  745. ΓöéSoft Check         Γöéreclaim / speed   ΓöéLow     Γöédefault    Γöé      Γöé
  746. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  747. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  748. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  749. ΓöéBuffer Pages       Γöémemory/speed      ΓöéHigh    Γöé250        Γöé Yes  Γöé
  750. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  751. ΓöéDeadlock Check Int Γöéspeed/check time  ΓöéLow     Γöédefault    Γöé      Γöé
  752. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  753. ΓöéLock List Pages    Γöémemory/concurrencyΓöéMedium  Γöé25         Γöé Yes  Γöé
  754. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  755. ΓöéLock List % per AppΓöé                  ΓöéLow     Γöé100/num_apsΓöé      Γöé
  756. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  757. ΓöéMax Open Files     Γöé                  ΓöéNone    ΓöéDefault    Γöé      Γöé
  758. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  759. ΓöéMax Appl Open FilesΓöé                  ΓöéNone    ΓöéDefault    Γöé      Γöé
  760. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  761. ΓöéMaximum Appls      Γöémemory/# connectnsΓöéMedium  ΓöéNumber ConsΓöé      Γöé
  762. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  763. ΓöéApplication Heap   Γöé                  ΓöéNone    ΓöéDefault (*)Γöé      Γöé
  764. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  765. ΓöéCommunications HeapΓöémemory/ comm heap ΓöéNone    Γöésee text   Γöé      Γöé
  766. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  767. ΓöéSort List Heap     Γöémemory/speed      ΓöéHigh    Γöé6          Γöé Yes  Γöé
  768. Γöé                   Γöé                  Γöé        Γöé           Γöé      Γöé
  769. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  770. (*): (RQRIOBLK * m + 65535) / 65535
  771. ($): The solution will require additional hardware (GREENware).
  772.  
  773. Heavy hitters are parameters with high payoff/cost ratios.
  774.