UJP - 技術情報

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

     

ASE11.0.3.3#ESD6の共有メモリ設定

ASE11.0.3.3#ESD6の共有メモリ設定


0.更新履歴

  • 2001.09.11 新規作成

1.はじめに

 このドキュメントでは,ASE11.0.3.3#ESD6 for LinuxをRedHat 6.2上で稼動させている時のSybaseのメモリ設定について説明する.

2.メモリ設定を変更する

  • デフォルトのメモリ設定だと少ないので,拡張する.
  • 現在の設定を調べる.

1> sp_configure "total memory"
2> go
 Parameter Name       Default     Memory Used Config Value Run Value
 -------------------- ----------- ----------- ------------ -----------
 total memory                7500       15000        7500         7500
(return status = 0)
1> 

  • 現在は,7500ブロック×2K=約14MB.
  • これを,64MBにする. 64M=65536KB=32768Block.
  • 以下の様に,メモリ設定を変更する.

1> sp_configure "total memory",32768
2> go
00:2001/09/10 20:16:03.86 server  設定ファイル '/opt/sybase/SYBASE01.cf
g' は書き込まれました。以前のバージョンは '/opt/sybase/SYBASE01.017' に
名前が変更されています。
00:2001/09/10 20:16:03.86 server  設定オプション 'total memory' は、'sa
' により '7500' から'32768' へと変更されました。

 Parameter Name        Default     Memory Used Config Value Run Value
 --------------------- ----------- ----------- ------------ -----------
 total memory                 7500       15000       32768         7500
Configuration option changed. The SQL Server must be rebooted before th
e change in effect since the option is static.

(return status = 0)
1>

  • 設定変更の結果を反映するには,SQL Serverの再起動が必要になる.

1> shutdown
2> go
サーバが要求により SHUTDOWN しました。
SQL Server はこのプロセスを終了しています。

00:2001/09/10 20:19:04.32 server  SQL Server shutdown by request.
00:2001/09/10 20:19:04.32 kernel  ueshutdown: exiting
DB-LIBRARY error:
        SQL サーバからの予期しない EOF です。

bash$ pwd
/opt/sybase/install
bash$ ./startserver -f ./RUN_SYBASE01

  • すると,次のようなエラーが表示されて起動しない.

bash$ ./startserver -f ./RUN_SYBASE01
bash$ 00:2001/09/10 20:20:34.33 kernel  Using config area from pr
imary master device.
00:2001/09/10 20:20:34.33 kernel  Warning: Using default file '/o
pt/sybase/SYBASE01.cfg' since a configuration file was not specif
ied. Specify a configuration file name in the RUNSERVER file to a
void this message.
00:2001/09/10 20:20:34.34 kernel  os_create_region: can't allocat
e 63414272 bytes
00:2001/09/10 20:20:34.34 kernel  kbcreate: couldn't create kerne
l region.
00:2001/09/10 20:20:34.34 kernel  kistartup: could not create sha
red memory
bash$

  • OS上の共有メモリの確保ができなかったということになっている.
  • 共有メモリの内容をチェックする.

bash$ cat /proc/sys/kernel/shmmax
33554432
bash$

  • shmmax値はバイト単位なので,32554432Byte=32MBである.
  • これでは足りないので,共有メモリの内容を変更する.

bash$ su
Password:■■■■■■■■■■■■
[root@takaken install]# echo 67108864 > /proc/sys/kernel/shmmax
[root@takaken install]# cat /proc/sys/kernel/shmmax
67108864
[root@takaken install]# exit
exit
bash$

  • 再度起動してみる.

bash$ ./startserver -f ./RUN_SYBASE01
bash$ 00:2001/09/10 20:29:40.51 kernel  Using config area from pr
imary master device.
00:2001/09/10 20:29:40.51 kernel  Warning: Using default file '/o
pt/sybase/SYBASE01.cfg' since a configuration file was not specif
ied. Specify a configuration file name in the RUNSERVER file to a
void this message.
00:2001/09/10 20:29:40.51 kernel  Using 1024 file descriptors.
00:2001/09/10 20:29:40.51 kernel  Internal run-time model set for
 Linux
00:2001/09/10 20:29:40.51 kernel  SQL Server/11.0.3.3 ESD#6/P-FRE
E/Linux Intel/Linux 2.2.14 i686/1/OPT/Fri Mar 17 15:45:30 CET 2000
00:2001/09/10 20:29:40.51 kernel  (c) Copyright 1987, 2000.
00:2001/09/10 20:29:40.51 kernel  Sybase, Inc.  All rights reserved.

〜略〜

00:2001/09/10 20:29:41.16 server  Recovery complete.
00:2001/09/10 20:29:41.16 server  SQL Server's default sort order is:
00:2001/09/10 20:29:41.16 server        'bin_sjis' (ID = 50)
00:2001/09/10 20:29:41.16 server  on top of default character set:
00:2001/09/10 20:29:41.16 server        'sjis' (ID = 141).
bash$

  • 正しく起動した.
  • isqlで接続して,メモリ設定値を確認してみる.

bash$ isql -Usa -P -SSYBASE01 -Jsjis -zjapanese
1> sp_configure "total memory"
2> go
 Parameter Name       Default     Memory Used Config Value Run Value
 -------------------- ----------- ----------- ------------ -----------
 total memory                7500       65536       32768        32768
(return status = 0)
1>

3.sysctlコマンドを使って設定する

  • sysctlコマンドをつかって,カーネルパラメータを設定する.
  • sysctl -aで現在の設定を見る.

bash$ su
Password:
[root@takaken kernel]# /sbin/sysctl -a | grep shmmax
kernel.shmmax = 33554432
[root@takaken kernel]#

  • sysctl -wで設定を書き込んで,再度設定内容を確認する.

bash$ su
Password:
[root@takaken kernel]# /sbin/sysctl -a | grep shmmax
kernel.shmmax = 33554432
[root@takaken kernel]# /sbin/sysctl -w kernel.shmmax=67108864
kernel.shmmax = 67108864
[root@takaken kernel]# /sbin/sysctl -a | grep shmmax
kernel.shmmax = 67108864
[root@takaken kernel]# exit
exit
bash$

  • これでもechoと同じで,OSをリブートすれば消えてしまう.

4.sysctl.confに設定を書く

  • sysctl.confに,以下の様に記述すると,再起動後もカーネルパラメータの設定が保存される.

bash$ cat /etc/sysctl.conf
# Disables packet forwarding
net.ipv4.ip_forward = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Disables automatic defragmentation (needed for masquerading, LVS)
net.ipv4.ip_always_defrag = 0
# Disables the magic-sysrq key
kernel.sysrq = 0
kernel.shmmax=67108864
bash$ /sbin/sysctl -a|grep shmmax
error: permission denied on key 'net.unix.max_dgram_qlen'
error: permission denied on key 'vm.page-cluster'
error: permission denied on key 'vm.pagetable_cache'
error: permission denied on key 'vm.bdflush'
error: permission denied on key 'kernel.cap-bound'
kernel.shmmax = 67108864
bash$



広告スペース
Google