<div dir="ltr"><div dir="ltr">Hi  </div><div dir="ltr">I've successfully tested your second option: the one with external load balancer (on Kubernetes). If the load balancer supports some flavor of "sticky" routing (ngix it does with cookies), sessions can be used. However if, for any reason, mgserver stops, all active sessions are lost. But in any case, since mapguide doesn't support sessions replication you couldn't do better :)</div><div dir="ltr"><br>I think Berkley db was not a lucky choice at design time... do you think it it feasible to change it with something else? for example Mongodb o other noSql? if library and session repository will be external, much of architectural issues with mapguide could be addressed...<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno lun 4 ott 2021 alle ore 10:07 Jackie Ng <<a href="mailto:jumpinjackie@gmail.com">jumpinjackie@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>WARNING: Lots of theory and hypotheticals below. Definitely requires experimentation.</div><div><br></div><div>You may or may know this, but MapGuide does have a built-in load balancer. Unfortunately, it is not very well documented nor has it been extensively battle-tested so it is understandable if you never knew such a feature exists.</div><div><br></div><div>If you want to try using MapGuide's load balancer, you need to have webconfig.ini point to the IP addresses of the participating MapGuide Server nodes. You can refer to this RFC for the configuration details (<a href="https://trac.osgeo.org/mapguide/wiki/MapGuideRfc3" target="_blank">https://trac.osgeo.org/mapguide/wiki/MapGuideRfc3</a>)</div><div><br></div><div>This should give you an architecture that resembles this crude ASCII diagram below:</div><div><br></div><div><font face="monospace">+-----------+       +-----------+<br>| mapagent  +--+--->| mgserver1 |<br>+-----------+  |    +-----------+<br>               |<br>               |    +-----------+<br>               +--->| mgserver2 |<br>               |    +-----------+<br>               |<br>               |    +-----------+<br>               +--->| mgserver3 |<br>                    +-----------+</font><br></div><div><br></div><div>The key takeaway here is that the mapagent and mgserver do not have to reside physically on the same machine. These tiers can reside on separate machines.</div><div><br></div><div>So in a cloud context, the mapagent would be public-facing while the mgserver nodes would be provisioned within the mapagent's VPC. The weakness of this architecture besides the untested nature of the MG load balancer is that your mapagent is a single point of failure. I'm sure there could be ways to address this at an architectural level, but nothing comes to mind at the moment.</div><div><br></div><div>Here's another possible alterative architecture, but requires taking this into consideration: Can your MapGuide application get away with *not* using sessions?</div><div><br></div><div>What you lose from not using sessions:</div><div><ul><li>Session repository access</li><li>Temporary layers and operations that create or operate on such layers (eg. Buffer, Dynamic Theming)</li><li>QUERYMAPFEATURES for mouse-driven selections. With 4.0, we have APIs in place so you should be able to implement a stateless version of this API if needed.</li></ul><div>What you gain from not using sessions:</div></div><div><ul><li>Zero server memory overhead and burden from having to maintain and cleanup active sessions</li><li>Substantially simpler horizontal scaling. You can go with a hypothetical load-balanced architecture that resembles something like this crude ASCII diagram below</li></ul></div><div><font face="monospace"><br></font></div><div><font face="monospace">+-----------------------+          +-----------+       +-----------+<br>| nginx / load balancer +----+---->| mapagent1 +------>| mgserver1 |<br>+-----------------------+    |     +-----------+       +-----------+<br>                             |<br>                             |     +-----------+       +-----------+<br>                             +---->| mapagent2 +------>| mgserver2 |<br>                             |     +-----------+       +-----------+<br>                             |<br>                             |     +-----------+       +-----------+<br>                             +---->| mapagent3 +------>| mgserver3 |<br>                                   +-----------+       +-----------+</font><br></div><div><br></div><div>As long as mgserver1/2/3/n are provisioned with the same data, you should be able to hit your mapagent at the [nginx/load-balancer] node and it should be able to distribute the requests across. This kind of architecture assumes your data/repository is effectively read-only as you can't author/create resources in a load-balanced manner. You will have to author this repository in a separate single-node MG installation and apply it to mgserver1/2/3 though the MapGuide package mechanism.</div><div><br></div><div>If you're thinking about cloud, you should also think about the "pets vs cattle" dichotomy. In this case, you should think of the mapagent + mgserver pair as "cattle", something that is expendable, it can be easily spun up and easily killed to be replaced with another spun up instance if it is misbehaving. By making your data/repository read-only, you can simplify spinning up a mapagent/mgserver pair with the following provisioning process.</div><div><ol><li>"Install" MapGuide server and webtiers via the InstantSetup package</li><li>Use the included MgInstantSetup utility to set up paths and port numbers</li><li>Assuming you're using the 4.0 previews:</li><ol><li>Load in your packages from the command-line with mgserver (eg. mgserver.exe loadpackage path/to/package/file.mgp)</li><li>Optionally change the password for Administrator and other user accounts from the command-line also with mgserver</li></ol><li>Start the mgserver</li></ol></div><div>Now if you're not constrained by Windows / .net and can use Linux then you can explore the big-league stuff with docker containers and orchestrating it all through something like Kubernetes. That's another major topic on its own, so it may not be something you want to pursue.</div><div><br></div><div>Hope this helps give you some more ideas.</div><div><br></div><div>- Jackie</div><div><br></div><div><br></div><div><br></div>You wrote:<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">Hi,</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><br></pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">I have been thinking what is the best architectural solution to implement an</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">ASP.Net/mapguide scalable solution at AWS Cloud. </pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"></pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">Today I have a windows server EC2 instance running the web server and</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">mapguide. To be able to use EC2 autoscaling, I have to deal with user</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">sessions outside the web server, maybe a ElastiCache as an <a href="http://ASP.NET" target="_blank">ASP.NET</a> Session</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">Store. </pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"></pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">But I also have to deal with mapguide sessions outside EC2, maybe put them</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">in Amazon Elastic File System ?</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"></pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">I want to explore other options of architecture and open this discussion.</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">How you guys are using mapguide in a cloud enviroment ?</pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"></pre></div><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)">Liglio Cavalcante</pre></div></blockquote><div><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><br></pre><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><br></pre><div dir="ltr"><div dir="ltr"><div></div></div></div></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><font size="1"><i>Please Note: I no longer create new posts or post replies to any OSGeo mailing list through nabble. As a result, you most likely won't see this message appear on nabble's view of any OSGeo mailing list and may only see this message through mailing list archives or depending on your mailing list subscription settings, through daily message digests or automated notifications from the mailing lists.</i></font></div></div></div>
_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapguide-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><font face="courier new, monospace">Riccardo Pucci</font></div><div><span style="color:rgb(0,0,0);background-color:rgb(245,245,245)"><font face="courier new, monospace">Geoweb Italia S.r.l.</font></span><br></div></div></div></div>