ASE 12.5 for Linux Install 〜Step 7 メモリ関連の設定〜
ASE 12.5 for Linux Install
〜Step 7 メモリ関連の設定〜
0.更新履歴
1.はじめに
このドキュメントでは,RedHat Linux 7.2に,Sybase Adaptive Server Enterprisee
12.5 for Linuxをインストールする手順を示す.
2.メモリ設定を行う(max memory)
Sybaseが使用するメモリに関連するパラメータを設定する.
- Sybaseが使用するトータルメモリを設定する.
- Sybaseでは,このパラメータで設定した以上のメモリは使用しない.
- このパラメータは,カーネルパラメータの共有メモリ(kernel.shmmax)と連動している.
- ASE12.5からは,動的にメモリ使用量を調整できるようになっており,従来の"total memory"ではなく,"max
memory"パラメータを使用する.
- "max memory"で指定されたメモリ量は,起動時に確保されるわけではない.
- 現在のパラメータを確認する.
1> sp_configure "max memory"
2> go
Parameter Name Default Memory Used Config Value
Run Value Unit Type
------------------------------ ----------- ----------- ------------
----------- -------------------- ----------
max memory 61440 122880 61440
61440 memory pages(2k) dynamic
(1 row affected)
(return status = 0)
1>
|
- 2KBページで61440個割り当てられているので,現在120MBが設定されている.
- これを200MBに設定する. 200MBなので,200×512(1MB=512個×2KB)で102,400ブロック.
- BackupServerとSQLServerを終了し,終了したことを確認する.
1> shutdown SYB_BACKUP
2> go
Backup Server: 3.48.1.1: The Backup Server will go down immediately.
Terminating sessions.
1> shutdown
2> go
Server SHUTDOWN by request.
The SQL Server is terminating this process.
CT-LIBRARY error:
ct_results(): network packet layer: internal net library error:
Net-Library operation terminated due to disconnect
[root@gx150 sybase-12.5]# $SYBASE/$SYBASE_ASE/install/showserver
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
[root@gx150 sybase-12.5]#
|
- /etc/sysctl.confの設定を次のように書き直す.
[root@gx150 sybase-12.5]# cat /etc/sysctl.conf
# Disables packet forwarding
net.ipv4.ip_forward = 0
# Enables source route verification
net.ipv4.conf.default.rp_filter = 1
# Disables the magic-sysrq key
kernel.sysrq = 0
#kernel.shmmax=67108864
kernel.shmmax=125829120
[root@gx150 sybase-12.5]#
|
- OSを再起動する.
- sybaseユーザでログインし,カーネルパラメータの設定を確認する.
Red Hat Linux release 7.2 (Enigma)
Kernel 2.4.7-10 on an i686
login: sybase
Password:■■■■■■■■■■■■■■
Last login: Thu Jan 31 20:05:49 from takakenkaba.co.jp
bash-2.05$
bash-2.05$ /sbin/sysctl -a|grep shmmax
error: permission denied on key 'net.unix.max_dgram_qlen'
error: permission denied on key 'kernel.cad_pid'
error: permission denied on key 'kernel.cap-bound'
kernel.shmmax = 125829120
bash-2.05$
|
bash-2.05$ cd $SYBASE/$SYBASE_ASE/install
bash-2.05$ pwd
/opt/sybase-12.5/ASE/install
bash-2.05$ ls
RUN_gx150 RUN_gx150_mon auditinit gx150_back.log startserver
RUN_gx150_back SPR gx150.log showserver
bash-2.05$ startserver -f RUN_gx150 -f RUN_gx150_back
〜略〜
bash-2.05$ showserver
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
sybase 1395 1.6 14.5 50968 36788 ? R 20:38 0:00 /opt/sy
base-12.5/ASE/bin/dataserver -sgx150 -d/opt/sybase-12.5/database/sysde
vice/master.dat -e/opt/sybase-12.5/ASE/install/gx150.log -c/opt/sybase
-12.5/ASE/gx150.cfg -M/opt/sybase-12.5/ASE
sybase 1396 0.3 2.1 8860 5500 pts/1 S 20:38 0:00 /opt/sy
base-12.5/ASE/bin/backupse
rver -Sgx150_back -e/opt/sybase-12.5/database/log/backup.log -Ljapanes
e -Jsjis -N25 -C20 -M/opt/sybase-12.5/ASE/bin/sybmultbuf
bash-2.05$
|
- isqlで接続し,max memoryの値を確認する.
bash-2.05$ isql -Usa -Psybasepassword -Sgx150
Msg 2401, Level 11, State 2:
Server 'gx150':
Character set conversion is not available between client character set 'iso_1'
and server character set 'sjis'.
No conversions will be done.
Due to previous errors, the language for this session is being forced to
'us_english'.
1> sp_configure "max memory"
2> go
Parameter Name Default Memory Used Config Value
Run Value Unit Type
------------------------------ ----------- ----------- ------------
----------- -------------------- ----------
max memory 61440 204800 102400
102400 memory pages(2k) dynamic
(1 row affected)
(return status = 0)
1>
|
- 設定値と確保できるメモリ上限が設定されていることがわかる.
3.メモリ設定を行う(number of device)
- 初期設定時の,"number of device"を確認する.
1> sp_configure "number of device"
2> go
Parameter Name Default Memory Used Config Value
Run Value Unit Type
------------------------------ ----------- ----------- ------------
----------- -------------------- ----------
number of devices 10 #8 10
10 number dynamic
(1 row affected)
(return status = 0)
1>
|
- 以前のバージョンだと,この値を変更すると再起動が必要だったが,ASE12.5からは動的に変更できる!事が確認できる.(営業トーク風)
- とりあえず50個程度に変更したいので,増やした場合のメモリ使用量を確認する.
1> sp_helpconfig "number of device","50"
2> go
number of devices は、SQL Serverが使用できるデータベース・デバイス数を制御します。
これにはデータベース・ダンプに使用されるデバイスは含まれません。
Minimum Value Maximum Value Default Value Current Value Memory Used
Unit Type
------------- ------------- ------------- ------------- -----------
-------------------- ----------
1 256 10 10 #8
number dynamic
Configuration parameter, 'number of devices', will consume 24K of memory if
configured at 50.
Changing the value of 'number of devices' to '50' increases the amount of memory
ASE uses by 10 K.
(return status = 0)
1>
|
- 50に設定すると,24KBのメモリを消費するらしいので,ゴミなので50で設定する.
1> sp_configure "number of device",50
2> go
00:00000:00011:2002/01/31 21:04:22.70 server Configuration file '/opt/sybase-12.5
/ASE/gx150.cfg' has been written and the previous version has been renamed to '/op
t/sybase-12.5/ASE/gx150.036'.
00:00000:00011:2002/01/31 21:04:22.71 server The configuration option 'number of
devices' has been changed by 'sa' from '10' to '50'.
Parameter Name Default Memory Used Config Value
Run Value Unit Type
------------------------------ ----------- ----------- ------------
----------- -------------------- ----------
number of devices 10 #24 50
50 number dynamic
(1 row affected)
Configuration option changed. The SQL Server need not be rebooted since the
option is dynamic.
Changing the value of 'number of devices' to '50' increases the amount of memory
ASE uses by 18 K.
(return status = 0)
1>
|
- 50に設定したので,18KB増えて24KBになったと表示されている.
4.メモリ設定を行う:最大同時接続ユーザの設定
1> sp_configure "number of user connections"
2> go
Parameter Name Default Memory Used Config Value
Run Value Unit Type
------------------------------ ----------- ----------- ------------
----------- -------------------- ----------
number of user connections 25 3638 25
25 number dynamic
(1 row affected)
(return status = 0)
1>
|
- 25同時ユーザで設定されていて,3638KBのメモリを消費している.
- 300ユーザで検討してみる.
1> sp_helpconfig "number of user connections","300"
2> go
number of user connections は、SQL Serverに同時に接続できるユーザ・コ
ネクションの最大数を設定します。
Minimum Value Maximum Value Default Value Current Value Memory Used
Unit Type
------------- ------------- ------------- ------------- -----------
-------------------- ----------
5 2147483647 25 25 3638
number dynamic
Configuration parameter, 'number of user connections', will consume 39733K of
memory if configured at 300.
Changing the value of 'number of user connections' to '300' increases the amount
of memory ASE uses by 56844 K.
(return status = 0)
1>
|
- 300ユーザだと,39733KB(約39MB)追加消費するとある.
- 設定する.
1> sp_configure "number of user connections",300
2> go
00:00000:00011:2002/01/31 21:13:10.14 server Configuration file '/opt/sybase-12.
5/ASE/gx150.cfg' has been written and the previous version has been renamed to '/
opt/sybase-12.5/ASE/gx150.037'.
00:00000:00011:2002/01/31 21:13:10.14 server The configuration option 'number of
user connections' has been changed by 'sa' from '25' to '300'.
Parameter Name Default Memory Used Config Value
Run Value Unit Type
------------------------------ ----------- ----------- ------------
----------- -------------------- ----------
number of user connections 25 39733 300
300 number dynamic
(1 row affected)
Configuration option changed. The SQL Server need not be rebooted since the
option is dynamic.
Changing the value of 'number of user connections' to '300' increases the amount
of memory ASE uses by 56844 K.
(return status = 0)
1>
|