-cw server option

Enables use of Address Windowing Extensions (AWE) on Windows for setting the size of the database server cache.

Syntax
{ dbsrv11 | dbeng11 } -cw ...
Applies to

Windows

Remarks

The amount of memory available for use as a database server cache is one of the key factors controlling performance. Because Windows supports Address Windowing Extensions, you can use the -cw option to take advantage of large cache sizes based on the maximum amount of physical memory in the system.

AWE caches are not supported on 64-bit SQL Anywhere database servers.

Operating system Maximum non-AWE cache size Maximum amount of physical memory supported by Windows
Windows 2000 Professional 1.8 GB 4 GB
Windows 2000 Server 1.8 GB 4 GB
Windows 2000 Advanced Server 2.7 GB1 8 GB
Windows 2000 Datacenter Server 2.7 GB1 64 GB
Windows XP Home Edition 1.8 GB 2 GB
Windows XP Professional 1.8 GB 4 GB
Windows Server 2003, Web Edition 1.8 GB 2 GB
Windows Server 2003, Standard Edition 1.8 GB 4 GB
Windows Server 2003, Enterprise Edition 2.7 GB1 32 GB
Windows Server 2003, Datacenter Edition 2.7 GB1 64 GB
Windows Vista Ultimate 2.7 GB2 4 GB
Windows Vista Enterprise 2.7 GB2 4 GB
Windows Vista Business 2.7 GB2 4 GB
Windows Vista Home Premium 2.7 GB2 4 GB
Windows Vista Home Basic 2.7 GB2 4 GB
Windows Vista Starter 2.7 GB2 1 GB

1 On Windows XP/200x, you must start the operating system using the /3GB option to use a cache of this size.

2 On Windows Vista, you must restart the operating system after running the following command as an administrator to use a cache of this size:

bcdedit /set increaseuserva 3072

When using an AWE cache, almost all of the available physical memory in the system can be allocated for the cache.

If you can set a cache of the required size using a non-AWE cache, this is recommended because AWE caches allocate memory that can only be used by the database server. This means that while the database server is running, the operating system and other applications cannot use the memory allocated for the database server cache. AWE caches do not support dynamic cache sizing. Therefore, if an AWE cache is used and you specify the -ch or -cl options to set the upper and lower cache size, they are ignored.

By default, 512 MB of address space is reserved for purposes other than the SQL Anywhere AWE cache (address space is the amount of memory that can be accessed by a program at any given time). While this amount is sufficient in most cases, you can change the amount of reserved address space using the -cm option.

On Windows Vista, only elevated database servers can use AWE memory. If you are autostarting a database server on Windows Vista, you must specify ELEVATE=YES in your connection string so that autostarted database server executables are elevated. See Elevate connection parameter.

To start a database server with an AWE cache, you must do the following:

  • On Windows Vista, you must run the database server as an administrator.
  • Have at least 130 MB of memory available on your system.
  • On Windows XP/200x, if your system has between 2 GB and 16 GB of memory, add the /3GB option to the Windows boot line in the "[operating systems]" section of the boot.ini file.

    On Windows Vista, if your system has between 2 GB and 16 GB of memory, you must run the following command as an administrator:

    bcdedit /set increaseuserva 3072

    On Windows XP/200x, if your system has more than 16 GB of memory, do not add the /3GB option to the Windows boot line in the [operating systems] section of the boot.ini file because Windows won't be able to address memory beyond 16 GB.

  • On Windows XP/200x, if your system has more than 4 GB of memory, add the /PAE option to the Windows boot line in the [operating systems] section of the boot.ini file.

    On Windows Vista if your system has more than 4 GB of memory, run the following command as an administrator:

    bcdedit /set pae ForceEnable
  • Grant the Lock Pages in Memory privilege to the user ID under which the server is run. The following steps explain how to do this on Windows XP.
    1. Log on to Windows as an administrator.
    2. Open the Control Panel.
    3. Double-click Administrative Tools.
    4. Double-click Local Security Policy.
    5. Open Local Policies in the left pane.
    6. Double-click User Rights Assignment.
    7. Double-click the Lock Pages In Memory policy in the right pane.
    8. Click Add User Or Group.

      The Select Users Or Groups window appears.

    9. Type the name of the user, and then click OK.
    10. Click OK on the Lock Pages In Memory window.
    11. Restart the computer for the setting to take effect.

If you specify the -cw option and the -c option on the command line, the database server attempts the initial cache allocation as follows:

  1. The AWE cache is no larger than the cache size specified by the -c option. If the value specified by the -c option is less than 2 MB, AWE isn't used.
  2. The AWE cache is no larger than all available physical memory less 128 MB.
  3. The AWE cache is no smaller than 2 MB. If this minimum amount of physical memory isn't available, an AWE cache isn't used.

When you specify the -cw option and do not specify the -c option, the database server attempts the initial cache allocation as follows:

  1. The AWE cache uses 100% of all available memory except for 128 MB that is left free for the operating system.
  2. The AWE cache is no larger than the sum of the sizes of the main database files specified on the command line. Additional dbspaces apart from the main database files aren't included in the calculation. If no files are specified, this value is zero.
  3. The AWE cache is no smaller than 2 MB. If this minimum amount of physical memory isn't available, an AWE cache isn't used.

When the server uses an AWE cache, the cache page size will be no smaller than 4 KB and dynamic cache sizing is disabled.

See Use the cache to improve performance.

See also
Example

The following example starts a server named myserver that starts with a cache size of 12 GB and loads the database c:\test\mydemo.db:

dbeng11 -n myserver -c 12G -cw c:\test\mydemo.db