Why are Xojo Web Apps Single Core?

I realize that Web Apps run as single core apps. Why is that so? Wouldn’t web apps be able to scale better if they could use all the cores?

  1. keep the framework simpler.
  2. yes

Solution is normally to run several instances on a server with different URLs or ports.
And put some kind of balancer before them, e.g. the one included with my WebStarter Kit.

I’ll have to take a gander at your load balancer. I’ve been using NGINX on Amazon Lightsail… I know FileMaker Server is also single core.

Another thing I don’t understand is how multiple instances of Web Apps know how to run on different cores. Seems like one or many Web App instances could end up running on the same core.

FileMaker server is multi core!

For multiple instances the OS will put them usually on different cores automatically.

I don’t have any Windows info, but for Linux here is how I understand it (but I am not a linux engineer, someone correct me if I am wrong):

In linux the thread scheduler manages processor affinity (which core apps run on). In my experience it usually does a great job with Xojo apps. The thread scheduler can move a running process from one core to another if necessary so even though xojo apps are “single-core” that doesn’t mean they have to stay on one core the whole time. If you want to force a specific app to run one a specific core you can execute it using the taskset command like this

taskset -c 0 /path/to/xojo/app

…where “0” is the processor core you want it on. It is a zero-based list so cores 1-16 are 0-15, for instance.

I experimented a bit with this when I first started testing load-balancing and trying different architectures and I have found that the best thing to do is to simply start the web apps normally and let linux do it’s job. I only run the amount of instances I need to get the performance I am looking for, usually three or four, although I have different web apps (with multiple instances) running on the same box.

The framework is not set up to be run across multiple threads which it would need to be to have one instance running on many cores.

Not necessarily
Multiple instances is often more robust since a single instance crashing doesn’t bring them all down which is NOT necessarily true in a multi-threaded application. One thread crashing (literally crashing) can bring everything down in that app.
Many applications run multiple instances instead of one multi-threaded instance (apache etc)