Tuning SAP ASE On Linux
Tuning SAP ASE On Linux
Enterprise on Linux
A Technical White Paper
Information Anywhere
EXECUTIVE OVERVIEW
ARCHITECTURE OF ASE
Dynamic Performance
Security
Mission-Critical Computing
Advanced Data Management
Management Of External Non-Relational Content
ASE ON LINUX
Large File Support/64-bit File I/O
Asynchronous I/O
CONCLUSION
In the past 3 years, the Linux operating system has matured in availability,
reliability and manageability. It has evolved from merely hosting Web Servers,
File/Print Servers to running enterprise level business applications like database
engines, middleware and ISV applications. It continues to make strides in high
performance computing that is pioneering several cluster efforts on Linux. Major
distributors like Red Hat, SuSE, Red Flag, and United Linux are adding
enterprise-level features to their releases and support models by providing longer
release cycles, product roadmaps and enterprise-level testing.
In 1998, Sybase Adaptive Server Enterprise (ASE) 11.0.3.3 was the first
enterprise class database that was made available on Linux systems. Today,
Sybase has made Linux a core platform and is committed to continuing to support
Red Hat, United Linux and Red Flag into the future. In absolute alignment with
the Linux philosophy, Sybase ASE itself was designed from the ground up to be
easy to manage and to use hardware resources sparingly. Furthermore, ASE is
designed to support the demanding requirements of transaction-intensive,
mission-critical OLTP and decision support applications – the types of
applications that are rapidly moving to the Linux platform. ASE’s efficient query
optimization delivers unsurpassed levels of performance and scalability make
ASE the best enterprise-class database engine available on Linux.
The combination of Intel and Linux is driving down Total Cost of Ownership
(TCO) and is driving up Return On Investment (ROI). ASE is the best data
manager available to further lower the TCO and increase the ROI of business
applications on the Linux platform.
Dynamic Performance
With its unique tuning capabilities, ASE can adjust its cache of index pages and
data, reduce I/O costs, provide user priorities, control resources at the CPU level,
or limit resources for a query or batch. Quick and easy adjustments allow DBAs
to reconfigure the system without rebooting.
Security
Row-level storage security, is an optional feature of ASE which allows the DBA
to specify which rows in a table can be accessed by each user. SSL protocol can
be used for integrity checking and encryption mechanisms to protect data from
unauthorized access. In conjunction with SSL, digital certificates can be used to
identify and authenticate servers, while clients can be authenticated using the
existing username/password mechanism.
ASE 12.5.0.3 provides large file support (LFS) for both regular file system files
and raw devices. This removes the limitation of using only 2GB devices for data
or log. ASE 12.5.0.3 can support up to 8 Terabytes of data.
Asynchronous I/O
Asynchronous I/O allows a process to submit I/O request without waiting for the
completion. This allows Sybase ASE to submit asynchronous I/O request and
while the I/O request is processed Sybase ASE scheduler can pick up another
thread and schedule and run. By default, Sybase ASE 12.5.0.3 is shipped with
asynchronous I/O enabled. Sybase ASE 12.5.0.3 does transparent asynchronous
I/O depending on whether it is running on Red Hat 7.2 (Asynchronous I/O using
RT Posix threads) or Red Hat Advanced Server 2.1 (Kernel Asynchronous I/O).
To deliver higher performance, Sybase ASE uses buffer caches to cache database
pages instead of doing an actual physical I/O. ASE also tries to avoid
asynchronous I/O events outside of the critical path of a transaction. The general
optimization is to avoid I/O if possible; if it must be done, make the I/O
asynchronous and eliminate random I/O operations.
Asynchronous I/O allows a process to submit I/O request without waiting for the
completion. This allows Sybase ASE to submit asynchronous I/O request and
while the I/O request is processed can pick up another thread and schedule and
run. Unlike Oracle Sybase ASE 12.5.0.3 is by default shipped with asynchronous
I/O enabled.
Each I/O device in the system has an associated request queue, which provides
ordering and memory resources for managing I/O re-quests to the device. In
earlier versions of the kernel, all I/O request queues are protected by a single
io_request_lock, which can be highly contended on SMP machines with
multiple disks and a heavy I/O load. This forced all processes performing I/O to
compete for this single resource even when performing I/O to unrelated devices,
creating an artificial bottleneck that resulted in reduced overall system I/O
throughput. Red Hat Linux Advanced Server 2.1 has implemented a new, fine-
grained locking scheme for the block device subsystem, which includes a separate
The improved process scheduler as improved 400% over a 2-way system and
6000% over a 8-way system compared to standard Linux kernel.
The default value for LINUX kernel parameter “kernel.shmmax” is too low for
Sybase ASE to start. Reconfigure this parameter to the size of “max memory” that
Sybase ASE will be configured with. Sybase ASE “max memory” can be
configured up to 2.7GB
or
The “fs.aio-max-size” parameter specifies the maximum block size that one
single AIO write/read can do. Using the default value of 131072 (128K) will
chunk the AIO done by ASE for create, alter database command. Reconfigure this
value from 131072(128K) to 1048576(1MB). This can be done either of two
ways. Sybase recommendation is to use either one of them.
or
Lowering the mapped base will allow ASE to address up to 2.7GB of memory (as
against 1.7GB of memory).
Swap
We recommend that the minimum swap size be the size of physical memory
available in the box.
Elvtune
On systems that are consistently doing a large amount of disk I/O, tuning the disk
I/O elevators may be useful. This is a 2.4 kernel feature that allows some control
over latency vs throughput by changing the way disk I/O elevators operate.
This works by changing how long the I/O scheduler will let a request sit in the
queue before it has to be handled. Since the I/O scheduler can collapse some
request together, having a lot of items in the queue means more can be coalesced,
which can increase throughput. Changing the max latency on items in the queue
allows you to trade disk I/O latency for throughput, and vice versa.
The tool "/sbin/elvtune" (part of util-linux) allows you to change these max
latency values. Lower values means less latency, but also less throughput. The
values can be set for the read and write queues separately.
Substituting the appropriate device of course. Default values are 8192 for read,
and 16384 for writes.
To set new values of 512 for read and 8192 for example:
Note that these values are for example purposes only, and are not recommended tuning
values
The units of these values are basically "sectors of writes before reads are allowed". The
kernel attempts to do all reads, then all writes, etc in an attempt to prevent disk io mode
switching, which can be slow. So this allows you to alter how long it waits before
switching.
One way to get an idea of the effectiveness of these changes is to monitor the output of
`iostat -d -x DEVICE`. The "avgrq-sz" and "avgqu-sz" values (average size of request
and average queue length, see man page for iostat) should be affected by these elevator
changes. For example lowering the latency should cause the "avqrq-sz" to go down.
TCP Tuning
For servers that are serving up huge numbers of concurrent sessions, there are
some TCP options that should probably be enabled. In order to optimize TCP
performance for this situation, we recommend tuning the following parameters.
or
net.ipv4.ip_local_port_range=1024 65000
Increasing the amount of memory associated with socket buffers can often
improve performance.
The following configuration will reduce the amount of work the TCP stack has to
do, so is often helpful in this situation.
net.ipv4.tcp_sack=0
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_window_scaling=0
CONCLUSION
The features provided by Red Hat Advanced Server, the stability provided by
major distributors (SuSE, Red Hat, Red Flag and United Linux) and major
application vendors’ support elevate Linux Operating System to enterprise class.
The tips and techniques provided here along with the features provided by Red
Hat Advanced Server will make Sybase ASE run better on your systems running
Linux Operating System.