我公司的 php 网站连接到 Advantage 数据库服务器,其中存储了所有必要的数据,例如用户、密码和客户注册表。
最近,我们开始在请求网页时遇到错误:
警告:SQL 错误:[扩展系统][Advantage SQL][ASA] 错误 6303:超出最大优势数据库服务器连接。 axServerConnect,SQLDriverConnect 中的 SQL 状态 HY000 位于 C:\...\www\... 在线...
它每天都变得至关重要,并且可能每周发生一次或每天两次,而没有明显的原因。
当网站崩溃时,数据库服务仍然可以与其他连接的应用程序正常工作,恢复 Web 服务的唯一方法是重新启动 apache Web 服务器。
在数据库服务器上,我们在 C:\Windows 文件夹中找到了 ads.ini 配置文件,其中我们使用“MAX_CONNECTIONS=1000”提高了最大连接设置,这与我们的需求相比确实很大。
如果我们也设置“RETRY_ADS_CONNECTS = 1”会有用吗?
我发现 R&D 在 2009 年 5 月确认了一个错误的帖子:
这是 Advantage 数据库的错误吗?
此问题已修复吗?在哪个版本中?
在哪里可以看到 apache 在 db 上打开的实际连接数?
每个php页面都会关闭页脚的广告连接,什么会导致连接超出?
预先感谢您的帮助。
-
环境信息
数据库:
Windows 2003 服务器上的 Advantage Database Server 10.10.0.6
Web 服务器:
Windows XP pro 上的 Apache/2.0.59 (Win32) mod_ssl/2.0.59 OpenSSL/0.9.8d PHP/4.4.7
在 phpinfo() 页面上,我们得到“Advantage Version”“8.00.0.0”。
为什么会这样?我们需要升级 php-advantage 扩展吗?
My company php web site is connected to an Advantage Database Server where are stored all necessary data such as users, passwords and customer registry.
Lately we started to get an error requesting web pages:
Warning: SQL error: [Extended Systems][Advantage SQL][ASA] Error 6303: Maximum Advantage Database Server connections exceeded. axServerConnect, SQL state HY000 in SQLDriverConnect in C:\...\www\... on line...
It's becoming critical day by day and it can happen once a week or twice a day without an apparent reason.
When website crashes, database service still working great with other applications connected and the only way to restore web service is to restart apache web server.
On database server we've got ads.ini configuration file in C:\Windows folder where we raised max connections setting with "MAX_CONNECTIONS=1000" which is really big compared to our needs.
Can it be useful if we set also "RETRY_ADS_CONNECTS = 1" ??
I found this post where R&D confirms a bug in may 2009:
Is this a bug with Advantage Database?
Has this been fixed? In wich release?
Where can i see the real number of connections open by apache on db?
Each php page closes ads connection on footer, what can cause connections to exceed??
Thanks in advance for help.
-
ENVIRONMENT INFO
Database:
Advantage Database Server 10.10.0.6 on Windows 2003 server
Web server:
Apache/2.0.59 (Win32) mod_ssl/2.0.59 OpenSSL/0.9.8d PHP/4.4.7 on Windows XP pro
On phpinfo() page we get "Advantage Version" "8.00.0.0".
Why this? Do we need to upgrade php-advantage extension?
发布评论
评论(1)
有很多问题,但我会尽力解决每个问题。
1) 6303 错误。使用 MAX_CONNECTIONS 是解决此问题的正确方法。
确保 MAX_CONNECTIONS 位于 [SETTINGS] 部分中
检查 Apache / PHP / ADS 驱动程序是否使用正确的 ads.ini 文件。您可以使用 Sysinternals 中的进程监视器来查看哪些 ads.ini 文件已成功打开。如果升级 PHP 驱动程序,您可以设置环境变量 adsini_path 以指向 ads.ini 所在的目录。
2) 设置 RETRY_ADS_CONNECTS=1 会有帮助。这也位于 ads.ini 的 [SETTINGS] 部分下。当 ADS 客户端收到网络错误(通常是 6000 类错误)时,客户端驱动程序会缓存该错误,随后的连接尝试将使用缓存的错误而不是重试。设置 RETRY_ADS_CONNECTS 将告诉 ADS 客户端忽略缓存的错误并重试连接
3) Bug:看起来这个问题已在 9.10.0.9 版本的驱动程序中修复,基于 http://devzone.advantagedatabase.com。
由于您运行的是 10.1 服务器,您可能会考虑更新到 10.1 客户端,其中也包含修复程序。 10.1 Advantage PHP 驱动程序
4)查看真实连接数
我建议使用存储过程 sp_mgGetConnectedUsers,您可以使用 ARC(Advantage Data Architect),但它可能很难进行分组、排序等。
由于您使用的是 10.1,因此您可以在查询中包含存储过程的结果,例如
您还可以使用其他字段来标识 PHP 应用程序,例如 UserName(服务器名称)、DictionaryUser(假设 php 应用程序使用唯一用户) , ApplicationID
5) PHPINFO 显示 Advantage PHP 客户端驱动程序的 Advantage 版本。由于上述原因,您可能需要升级客户端驱动程序。应该像交换 DLL 文件(ace32.dll、axces32.dll、adsodbc.dll 和 php_advantage.dll)一样简单,但我建议首先进行测试以确保获得一切。
Lots of questions, but I will try and address each.
1) 6303 Error. Using MAX_CONNECTIONS is the correct way to resolve this.
Make sure MAX_CONNECTIONS is in the [SETTINGS] section
Check if Apache / PHP / ADS driver is using the correct ads.ini file. You can use Process Monitor from Sysinternals to see what ads.ini file was opened successfully. If you upgrade your PHP driver you can set an environment variable adsini_path to point to the directory where the ads.ini lives.
2) Setting RETRY_ADS_CONNECTS=1 will be helpful. This also goes under the [SETTINGS] section of the ads.ini. When an ADS client receives a networking error (generally a 6000 class error) then the error is cached by the client driver and subsequent attempts to connect will use the cached error vs. retrying. Setting RETRY_ADS_CONNECTS will tell the ADS client to ignore the cached error and retry the connection
3) Bug: Looks like this was fixed in 9.10.0.9 version of the driver based on the release notes on http://devzone.advantagedatabase.com.
Since you are running a 10.1 server you may look at updating to a 10.1 client which will also contain the fix. 10.1 Advantage PHP Driver
4)See the real number of connection
I would recommend using the stored procedure sp_mgGetConnectedUsers, you can use ARC (Advantage Data Architect) but it can be difficult to group, order, etc.
Since you are using 10.1 you can include the results of the stored procedure in a query such as
You could also use other fields to identify the PHP application such as UserName (the server name), DictionaryUser (assuming the php application uses a unique user), ApplicationID
5) PHPINFO shows Advantage Version of the Advantage PHP client driver. You may want to upgrade the client driver for reasons mentioned above. Should be as simple as swapping DLL files (ace32.dll, axces32.dll, adsodbc.dll and php_advantage.dll), but I would recommend testing first to ensure you get everything.