[mapguide-commits] r4599 - in trunk/MgDev: Common/MapGuideCommon/Services Oem/ACE/ACE_wrappers/ace Server/src/Common/Manager Server/src/Core Web/src

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Feb 16 11:59:55 EST 2010


Author: brucedechant
Date: 2010-02-16 11:59:53 -0500 (Tue, 16 Feb 2010)
New Revision: 4599

Modified:
   trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp
   trunk/MgDev/Oem/ACE/ACE_wrappers/ace/config.h
   trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp
   trunk/MgDev/Server/src/Core/Server.cpp
   trunk/MgDev/Web/src/webconfig.ini
Log:
Fix for trac ticket 1272 - Change ACE WFMO reactor used by Windows to the ACE SELECT reactor
http://trac.osgeo.org/mapguide/ticket/1272

Notes:
- Changed the ACE reactor used on Windows to the same one as used on Linux


Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp	2010-02-16 05:19:20 UTC (rev 4598)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionStack.cpp	2010-02-16 16:59:53 UTC (rev 4599)
@@ -42,11 +42,16 @@
         MgConfigProperties::SiteConnectionPropertyPort, sitePort,
         MgConfigProperties::DefaultSiteConnectionPropertyPort);
 
+    // Note: The comment below only applies if using the ACE WFMO reactor on Windows.
+    //       The ACE config.h file has been updated to use the ACE SELECT reactor on 
+    //       Windows which is the default reactor used on Linux.
+    //       ie: #define ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL
+    //
     // Assign an appropriate number of connections for each connection type.  On Windows
     // we are limited to 62 connections and will typically have one mapagent and one
     // API process running.  Limiting the number of connections to 20 per process should give
     // adequate headroom to handle CLOSE_WAIT states.  Twelve actively processing client connections
-    // should easily saturate an eight core machine.
+    // should easily saturate a quad core machine depending on load.
     if (port == adminPort)
     {
         // Pull max connections from admin section.  Default to 2 admin connections if not present.

Modified: trunk/MgDev/Oem/ACE/ACE_wrappers/ace/config.h
===================================================================
--- trunk/MgDev/Oem/ACE/ACE_wrappers/ace/config.h	2010-02-16 05:19:20 UTC (rev 4598)
+++ trunk/MgDev/Oem/ACE/ACE_wrappers/ace/config.h	2010-02-16 16:59:53 UTC (rev 4599)
@@ -1,4 +1,5 @@
 #ifdef WIN32
+#define ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL
 #define ACE_HAS_WCHAR
 #define ACE_USES_WCHAR
 #include "ace/config-win32.h"

Modified: trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp	2010-02-16 05:19:20 UTC (rev 4598)
+++ trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp	2010-02-16 16:59:53 UTC (rev 4599)
@@ -936,10 +936,14 @@
     m_totalConnections++;
 
 #ifdef _WIN32
-    // The limit for the current Windows ACE reactor is 62.
+    // The ACE SELECT reactor does not have the same handle limit as the ACE WFMO reactor.
+    // The code below is left as is, but commented out in case the ACE WFMO reactor is ever used in the future.
+
+    // The limit for the default Windows ACE WFMO reactor is 62 handles this is due to the 64 handle limit of 
+    // the Windows WaitForMultipleObjects() API, but ACE uses 2 handles internally leaving only 62 handles for the application.
     // The only reason the value 55 is chosen is because it is slightly under this value and
     // so we can log an error as the # of active connections approaches the current ACE reactor limit.
-    // TODO: This error logging will need to be revisited if a different ACE reactor is used on Windows.
+/*
     if(m_totalActiveConnections.value() > 55)
     {
         STRING strActiveConnections = L"";
@@ -951,6 +955,7 @@
         // We are dangerously close to exceeding the safe # of active connections for the current ACE reactor
         MG_LOG_ERROR_ENTRY(message.c_str());
     }
+*/
 #else
     // Linux uses a different ACE reactor and so this error message doesn't apply.
 #endif

Modified: trunk/MgDev/Server/src/Core/Server.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/Server.cpp	2010-02-16 05:19:20 UTC (rev 4598)
+++ trunk/MgDev/Server/src/Core/Server.cpp	2010-02-16 16:59:53 UTC (rev 4599)
@@ -726,6 +726,12 @@
         if(svc_handle_)
         {
             report_status(SERVICE_RUNNING);
+
+            // By default the executeable is the thread owner, but when this is being run as a 
+            // service the Windows Service Control Manager becomes the default thread owner.
+            // We need to make this thread the owner of the ACE reactor because this is a 
+            // requirement of the ACE SELECT reactor.
+            ACE_Reactor::instance()->owner(ACE_Thread::self());
         }
         #endif
 

Modified: trunk/MgDev/Web/src/webconfig.ini
===================================================================
--- trunk/MgDev/Web/src/webconfig.ini	2010-02-16 05:19:20 UTC (rev 4598)
+++ trunk/MgDev/Web/src/webconfig.ini	2010-02-16 16:59:53 UTC (rev 4599)
@@ -66,6 +66,10 @@
 #
 # Property Name                    Description
 # -----------------------------------------------------------------------------
+# MaxConnections                   The maximum allowed concurrent connections for this port.
+#                                  Default value of 2 is for a typical load when the web 
+#                                  is connected to a quad core server machine.
+#
 # Port                             The port to use for administration operations
 #
 #                                  WARNING: If you change the port # here you
@@ -74,6 +78,7 @@
 #                                           file.
 #
 # *****************************************************************************
+MaxConnections                     = 2
 Port                               = 2810
 
 [ClientConnectionProperties]
@@ -82,6 +87,10 @@
 #
 # Property Name                    Description
 # -----------------------------------------------------------------------------
+# MaxConnections                   The maximum allowed concurrent connections for this port.
+#                                  Default value of 12 is for a typical load when the web 
+#                                  is connected to a quad core server machine.
+#
 # Port                             The port to use for client operations
 #
 #                                  WARNING: If you change the port # here you
@@ -90,6 +99,7 @@
 #                                           file.
 #
 # *****************************************************************************
+MaxConnections                     = 12
 Port                               = 2811
 
 [SiteConnectionProperties]
@@ -100,6 +110,11 @@
 # -----------------------------------------------------------------------------
 # IpAddress                        The IP address of the site server
 #                                       0 < Length <= 255
+#
+# MaxConnections                   The maximum allowed concurrent connections for this port.
+#                                  Default value of 6 is for a typical load when the web 
+#                                  is connected to a quad core server machine.
+#
 # Port                             The port to use for site operations
 #
 #                                  WARNING: If you change the port # here you
@@ -109,6 +124,7 @@
 #
 # *****************************************************************************
 IpAddress                          = 127.0.0.1
+MaxConnections                     = 6
 Port                               = 2812
 
 [AgentProperties]



More information about the mapguide-commits mailing list