{"id":6153,"date":"2019-01-04T17:28:15","date_gmt":"2019-01-04T08:28:15","guid":{"rendered":"https:\/\/chat-messenger.com\/?p=6153"},"modified":"2025-09-25T14:35:09","modified_gmt":"2025-09-25T05:35:09","slug":"load-balancing","status":"publish","type":"post","link":"https:\/\/chat-messenger.com\/en\/manual\/camserver\/load-balancing","title":{"rendered":"CAMServer Redundancy and load balancing"},"content":{"rendered":"<p><style type=\"text\/css\"><!--\ntable, th, td {\n    border: none !important;\n}\n--><\/style><\/p>\n\n\n\n<h2>Redundancy and load balancing<\/h2>\n\n\n\n<p><code>CAMServer<\/code> With the Ultimate plan,<span class=\"swl-marker mark_blue\">Very easy in on-premise environment<\/span>Web and video servers can be made redundant and load-balanced. This allows services to continue even if one server goes down, and even if a large number of users use it, processing can be distributed and services can be provided without degrading performance.<\/p>\n\n\n\n<p>In addition, the distributed configuration <code>CAMServer<\/code> But real-time communication is possible. For example,<code>CAMServer1<\/code> The Client is connected to the<code>CAMServer2<\/code> Chat and web conferencing are possible with another Client connected to the<\/p>\n\n\n\n<p class=\"is-style-big_icon_point\">- Web conferencing load balancing is based on the number of active conferences and the number of participating users.<br>\u30fbThe number of simultaneous web conferences is simply<code>CAMServer<\/code>This cannot be achieved by simply increasing the number of nodes. It is also necessary to consider the network configuration so that all conferences are not relayed through the same VPN or central router.<\/p>\n\n\n\n<h2>Redundancy and load balancing configuration<\/h2>\n\n\n\n<p>You can configure the optimal environment according to your company&#039;s requirements and costs.<\/p>\n\n\n\n<h3>Small start configuration<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full\"><img width=\"1761\" height=\"1049\" src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2024\/05\/image-7.png\" alt=\"\" class=\"wp-image-10911\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<ul><li><strong>Storage:<\/strong>DB\/File is placed on CAMServer1 and referenced from CAMServer2. In this case, all users can share data in real time.<\/li><li><strong>backup<\/strong>: DB\/File data needs to be backed up to CAMServer2 daily.<\/li><li><strong>load distribution<\/strong>: Load balancing is possible by dividing the CAMServer accessed by department (or making it a standby system). Web conferences can always be load balanced.<\/li><li><strong>availability<\/strong>: DB connection settings when a failure occurs on Unit 1 <code>cam.serverDatePath<\/code> In the case of a disk failure,<span style=\"color: var(--color_text); font-family: var(--swl-font_family); font-size: var(--swl-fz--content,16px); font-weight: var(--swl-font_weight); letter-spacing: var(--swl-letter_spacing,normal); background-color: var(--color_content_bg);\">backup<\/span>was done<span style=\"color: var(--color_text); font-family: var(--swl-font_family); font-size: var(--swl-fz--content,16px); font-weight: var(--swl-font_weight); letter-spacing: var(--swl-letter_spacing,normal); background-color: var(--color_content_bg);\">Data up to the previous day is guaranteed.<\/span><\/li><li><strong>cost<\/strong>: The cheapest configuration. Start with a single unit and scale up according to the load.<\/li><\/ul>\n<\/div>\n<\/div>\n\n\n\n<h3>External Storage (NAS) Configuration<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full\"><img width=\"2151\" height=\"1046\" src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2024\/05\/image-8.png\" alt=\"\" class=\"wp-image-10912\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<ul><li><strong>Storage<\/strong>: Place DB\/File on a highly durable external Storage NAS with a RAID configuration and refer to both CAMServer1 and CAMServer2. Or specify a virtual NAS provided by the virtualization platform host OS.<\/li><li><strong>backup<\/strong>Even with a RAID configuration, daily backups of DB\/File data are necessary to take into consideration power supply\/chassis failures and human error.<\/li><li><strong>load distribution<\/strong>: Same as small start configuration.<\/li><li><strong>availability<\/strong>When a failure occurs,<a href=\"https:\/\/chat-messenger.com\/en\/manual\/install_verup\/cam-webapp\/\">Web App Version<\/a> If you use <code>cam.clusterHosts<\/code>Detects and enables automatic failover.<\/li><li><strong>cost<\/strong>Relatively inexpensive configuration.<\/li><\/ul>\n<\/div>\n<\/div>\n\n\n\n<h3>Redundant external storage configuration<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full\"><img width=\"2661\" height=\"1074\" src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2024\/05\/image-9.png\" alt=\"\" class=\"wp-image-10913\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<ol><li><strong>Storage<\/strong>: A configuration that uses redundant file sharing servers (Windows Server Failover Clustering + SAN, AWS S3 + rclone, etc.) and emphasizes high availability against disk failure.<\/li><li><strong>backup<\/strong>: Data is replicated automatically, so depending on the policy, backups may not be necessary. However, if you are concerned about human error (e.g. manually erasing a disk), backups are still necessary.<\/li><li><strong style=\"background-color: var(--color_content_bg); color: var(--color_text); font-family: var(--swl-font_family); font-size: var(--swl-fz--content,16px); letter-spacing: var(--swl-letter_spacing,normal);\">load distribution<\/strong><span style=\"background-color: var(--color_content_bg); color: var(--color_text); font-family: var(--swl-font_family); font-size: var(--swl-fz--content,16px); font-weight: var(--swl-font_weight); letter-spacing: var(--swl-letter_spacing,normal);\">: Same as small start configuration.<\/span><\/li><li><strong>availability<\/strong>: The web server is the same as the small start configuration. Automatic switching is possible even in the event of a failure due to disk or chassis failure.<\/li><li><strong>cost<\/strong>\uff1aThe implementation cost is high. AWS S3 can be built inexpensively, but it is not an option if on-premise is important.<\/li><\/ol>\n<\/div>\n<\/div>\n\n\n\n<h3>Load Balancer Configuration<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full\"><img width=\"2110\" height=\"1078\" src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2024\/05\/image-10.png\" alt=\"\" class=\"wp-image-10929\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<ul id=\"block-69008db6-8cd8-4d4e-b11d-b153c56e5de4\"><li><strong>Storage<\/strong>: You can choose between small start configuration, NAS, or SAN.<\/li><li><strong>backup<\/strong>: Same as small start configuration\/NAS\/SAN.<\/li><li><strong style=\"background-color: var(--color_content_bg); color: var(--color_text); font-family: var(--swl-font_family); font-size: var(--swl-fz--content,16px); letter-spacing: var(--swl-letter_spacing,normal);\"><strong>load distribution<\/strong><\/strong><span style=\"background-color: var(--color_content_bg); color: var(--color_text); font-family: var(--swl-font_family); font-size: var(--swl-fz--content,16px); font-weight: var(--swl-font_weight); letter-spacing: var(--swl-letter_spacing,normal);\">: Redundancy and load balancing are possible by placing a Load Balancer in front of the CAMServer.<\/span>note (supplementary information) symbol <a href=\"#lb-requirements\">Load Balancer configuration requirements details<\/a>Please also check:<\/li><li><strong>availability<\/strong>: When combined with a redundant external storage configuration, automatic failover is possible in all layers.<\/li><li><strong>cost<\/strong>: The implementation costs are high.<\/li><\/ul>\n<\/div>\n<\/div>\n\n\n\n<h2 id=\"load-balancing-settings\">Redundancy and load balancing settings<\/h2>\n\n\n\n<h3>Configuration Overview<\/h3>\n\n\n\n<p>To make the CAMServer redundant and load-balanced, install a CAMServer on each of the distributed servers,<code>CAMServer\/boot.ini<\/code> Add the following entry to the file<\/p>\n\n\n\n<div class=\"hcb_wrap\" data-no-translation=\"\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>cam.clusterHosts=camserver1;camserver2\ncam.clusterHostsDesc=camserver1 \u304c\u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u3001camserver2 \u306f\u5f85\u6a5f\u7cfb\u30b5\u30fc\u30d0\u3067\u3059\u3002\ncam.serverDatePath=\\\\disk\\CAMServer\\data\ncam.disableLANNetwork=true\n\n# \u30d3\u30c7\u30aa\u30b5\u30fc\u30d0\u306e\u5206\u6563\u8a2d\u5b9a\u3002\u300c\u30b5\u30fc\u30d0=\u30ce\u30fc\u30c9\u5206\u6563\u53c2\u52a0\u6570\u76ee\u5b89\u5024\u300d\u3067\u5b9a\u7fa9\u3002\ncam.videoDomains=camserver1=50;camserver2=50;camserver3=50<\/code><\/pre><\/div>\n\n\n\n<h3 id=\"clusterHosts\">cam.clusterHosts<\/h3>\n\n\n\n<p><code>cam.clusterHosts<\/code> is the host name (FQDN) of each distributed server. <code>;<\/code> Separate and list them.<\/p>\n\n\n\n<h4>To start CAMServer on port 443:<\/h4>\n\n\n\n<div class=\"hcb_wrap\" data-no-translation=\"\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>cam.clusterHosts=camserver1;camserver2 <\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\"><div class=\"wp-block-image is-style-border\">\n<figure class=\"alignleft is-resized\"><img src=\"\/images\/camserver_load-balancing_failover.png\" alt=\"\" width=\"357\" height=\"197\"\/><\/figure><\/div><\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p>If you separate CAMServers for each department, write the local host name (FQDN) at the beginning of the ini file of each CAMServer. The enumeration order affects the initial connection server and video server selection at startup.<a href=\"https:\/\/chat-messenger.com\/en\/manual\/install_verup\/cam-webapp\/\">Web App Version<\/a> By using this, it is possible to automatically switch servers in the event of a failure.<\/p>\n\n\n\n<p>*If SSO or passwordless authentication is not configured, you will have to log in again when switching.<\/p>\n<\/div>\n<\/div>\n\n\n\n<h4>To start CAMServer on port 8080:<\/h4>\n\n\n\n<div class=\"hcb_wrap\" data-no-translation=\"\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>cam.clusterHosts=camserver1:8080;camserver2:8080 <\/code><\/pre><\/div>\n\n\n\n<p>You can deploy an L7 load balancer in front of CAMServer and have CAMServer forward to port 8080, but the settings in that case are as above. In this case, failover is the responsibility of the load balancer, so camapp will not fail over. This is <code>cam.serverURLDomain<\/code>, ,<code>cam.clusterHosts<\/code> Compare domains and detect and control whether they have load balancers.<\/p>\n\n\n\n<h3>cam.clusterHostsDesc<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\"><div class=\"wp-block-image is-style-border\">\n<figure class=\"alignleft is-resized\"><img src=\"\/images\/camserver_load-balancing_clusterHostsDesc.png\" alt=\"\" width=\"370\" height=\"174\"\/><\/figure><\/div><\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p><code>cam.clusterHostsDesc<\/code> can change the comments in the description field of the distributed server.<\/p>\n<\/div>\n<\/div>\n\n\n\n<h3>cam.serverDatePath<\/h3>\n\n\n\n<p><code>cam.serverDatePath<\/code> Specify the location to save the DB and uploaded attachments. Specify a shared disk that can be accessed from distributed servers.<\/p>\n\n\n\n<p class=\"is-style-big_icon_memo\">*When specifying a shared disk and running a service <a rel=\"noreferrer noopener\" href=\"https:\/\/chat-messenger.com\/en\/manual\/camserver\/launch_camserver_as_windows_service\/#svc_osuser\/\" target=\"_blank\">OS user running the Windows service<\/a>Must be specified<br>If there is no shared disk, a sub CAMServer can be used as the main CAMServer's <code>CAMServer\/config<\/code> Storage can also be shared by specifying a folder.<\/p>\n\n\n\n<h3 id=\"videoDomains\">cam.videoDomains<\/h3>\n\n\n\n<p>Video server distribution settings. If you define it as follows, when the total number of participants in the rooms in the enumerated order exceeds 50, the conference room will be created on the next server.<\/p>\n\n\n\n<p><code>cam.videoDomains=camserver1=50;camserver2=50;camserver3=50<\/code><br><\/p>\n\n\n\n<p class=\"is-style-icon_info\">\u30fbCan be omitted if cam.clusterHosts is set<br>- This value does not indicate the maximum number of connections, but is merely a guideline for load balancing.<\/p>\n\n\n\n<h4>cam.disableLANNetwork<\/h4>\n\n\n\n<p>TCP\/UDP connections for LAN are not required in a redundant configuration, so please disable them.<\/p>\n\n\n\n<div class=\"hcb_wrap\" data-no-translation=\"\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>cam.disableLANNetwork=true<\/code><\/pre><\/div>\n\n\n\n<h2 id=\"Firewall\">Firewall communication permission for data synchronization between servers<\/h2>\n\n\n\n<ol><li>Real-time data updates (user presence status, messages, chat rooms, etc.) are synchronized between CAMServers, so communication between servers must be permitted via a firewall, etc.<\/li><li>TCP ports 9090, 9091, and 9092 for access to the DB master node<\/li><li>TCP 8080 port for server-to-server connection URL<ul><li>Defined in the ini file cam.clusterHosts <\/li><li>Example) cam.clusterHosts=camserver1:8080;camserver2:8080;camserver3:8080<\/li><\/ul><\/li><\/ol>\n\n\n\n<h2 id=\"lb-requirements\">Load Balancer detailed requirements<\/h2>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full is-resized is-style-shadow\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2024\/12\/image-9.png\" alt=\"\" class=\"wp-image-11408\" width=\"401\" height=\"291\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p>We will describe the detailed requirements for Load Balancer configuration.<\/p>\n\n\n\n<p class=\"is-style-icon_info\">L7\/L4 is supported, but session affinity is required. Please note that L7 can fix connections on a session basis, but L4 can only fix connections by IP. This section explains the configuration for L7.<\/p>\n<\/div>\n<\/div>\n\n\n\n<h4>1. SSL Termination<\/h4>\n\n\n\n<ol><li>Install an SSL certificate on the load balancer and perform SSL\/TLS decryption.<\/li><li>Communications from clients are accepted via HTTPS, and HTTP is used from the load balancer to the backend.<\/li><\/ol>\n\n\n\n<h4>2. Load Balancing Algorithm<\/h4>\n\n\n\n<ol><li>Round Robin Load Balancing<\/li><li>Cookie-based session maintenance (session affinity) is required, and it is necessary to check whether the system has the function to distribute access from the same client to the same node.<\/li><\/ol>\n\n\n\n<h4>3. Headers and additional processing forwarded to the backend server (8080)<\/h4>\n\n\n\n<p><code>X-Forwarded-Proto<\/code><br>Header item that identifies the request as https when LB forwards it to the backend server<\/p>\n\n\n\n<p><code>X-Forwarded-For<\/code><br>Header item that identifies the client&#039;s IP address when LB forwards it to the backend server<\/p>\n\n\n\n<p><code>Handling WebSocket Upgrade headers<\/code><br>Analyze the HTTP request and, if an Upgrade header is detected, trigger a switch to TCP.<\/p>\n\n\n\n<p class=\"is-style-icon_info\">Today&#039;s load balancers (AWS\/GCP\/Azure) have standard default settings.<\/p>\n\n\n\n<h3>4. Communication with the backend server<\/h3>\n\n\n\n<p>Communication from the load balancer to each CAMServer is done using the following protocols and ports.<\/p>\n\n\n\n<ul><li>Protocol: HTTP<\/li><li>Port number: 8080<\/li><li>Connection example: http:\/\/HOSTNAME:8080\/<\/li><\/ul>\n\n\n\n<h3>5. Health Check<\/h3>\n\n\n\n<ol><li>The load balancer periodically requests the next URL and determines it to be &quot;normal&quot; if the conditions are met.<\/li><li>Health Check URL: http:\/\/HOSTNAME:8080\/CAMServer\/healthCheck<\/li><li>Health check condition: HTTP status code: 200 Response body: {\u201cstatus\u201d:200}<\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>Regarding redundancy and load balancing, CAMServer&#039;s Ultimate plan allows you to easily [\u2026]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":""},"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/6153"}],"collection":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/comments?post=6153"}],"version-history":[{"count":9,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/6153\/revisions"}],"predecessor-version":[{"id":12264,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/6153\/revisions\/12264"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/media?parent=6153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/categories?post=6153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/tags?post=6153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}