General questions for newcomer

Hi all,

I came across Xojo a couple of years back but now with the prospect of supporting Android development in the near future, I decided to give this tool another go. I haven’t yet started developing nor purchased any licensing apart from some tutorials to get me familiarised. At the moment I am mainly a FileMaker developer. I wanted to ask here a few simple questions for Xojo Cloud:

  1. Can I add more than one app on a single server? For example I have a couple of small web apps that shouldn’t really need more than a Small instance cloud server and economically it would be really expensive to host them one for each server. If this is possible, does anyone have a few examples were they have used multiple apps on the same Xojo Cloud instance?

  2. Roughly how many users per web app per each of the 3 instance types in Xojo cloud would be a maximum? Of course it varies greatly per app and its complexity but if you could please give me some rough estimates that would be great.

  3. For any app on Xojo is it possible to add custom HTML code? Just like a webviewer in FileMaker, for those who are familiar with it as well.

Thanks

Christos

Yes, you can run multiple apps on a single server. Each app goes into its own folder. You’ll just need to make sure your combined apps don’t exceed the capabilities of the server.

There is no enforced limit. It just depends on how your app is built. Xojo apps only use a single CPU so offloading lengthy processes to helper Console apps can increase the load a web app can support.

Xojo has the WebHTMLViewer control for displaying whatever HTML you want. You can also embed special HTML and JavaScript using appropriate properties of the App class and control classes. Lastly you can use the WebSDK to integrate HTML/JavaScript controls into Xojo.

Thank you @Paul Lefebvre you have answered most of it!

I know there is no enforced limit for the number of users but I am looking for some rough estimates from experience. I promise I will not hold anyone liable for any figures provided :slight_smile: I just need some ballpark figures and certainly I understand there are many factors to be considered.

[quote=341281:@Christos Savva]Thank you @Paul Lefebvre you have answered most of it!

I know there is no enforced limit for the number of users but I am looking for some rough estimates from experience. I promise I will not hold anyone liable for any figures provided :slight_smile: I just need some ballpark figures and certainly I understand there are many factors to be considered.[/quote]
A typical default web app can handle 180-200 simultaneous connections. That’s not users/sessions though… it’s just the number of connected sockets at any given time. Each connected browser has one persistent connection and the possibility of a second connection whenever a user action occurs.

But as Paul mentioned, this also depends on your app. If it uses a lot of memory or CPU for certain actions, that affects all users. If we had a better idea of what you were thinking of in terms of an app, we might be able to give you a more guidance.

Edit: Fix the connection count.

Btw- you may be able to change the connection limit, I’ll have to check when I get to my desk.

Ok, so you can change the number of allowed simultaneous connections, just keep in mind that while an increase in sockets does mean that technically more users can connect, it also means more overhead for the session code. So if each of your sessions had a memory footprint of 3MB and you have 1000 users, you’d still need 3GB of free memory.

That said, to change the number of allowed connections, you should be able to simply put the following code in the App.Open event:

args.append("maxsockets=500")

The allowed command-line parameters are available here:
http://documentation.xojo.com/index.php/WebApplication

Though keep in mind that XojoCloud web apps always run as CGI and never as SSL (Apache takes care of that for you). That means that the MaxSecureSockets, SecurePort, SSLType and Certificate properties will do nothing on Xojo Cloud.

Greg, what is the default value for maxsockets?

Nevermind Greg. I found the default value on another doc page: http://documentation.xojo.com/index.php/WebApplication.SessionCount

The default is 200.

[just so that not everyone has to open the link and search for the answer there]

Greg,

I have had instances I’ve been trying to isolate where about 20-30 users (college students) log on to use my application simultaneously and will get kicked off the system. It doesn’t seem to happen if there are around 15 or less students. Do you think that the sudden surge in simultaneous logins and data connections could be overwhelming the maxsockets levels on my application?

I don’t have anything like the maxsockets statement in the post below. Do you think I should try putting one in?

I have watched it occur and there was plenty of free memory and the CPU never seemed stressed. Maybe this is the key? A single login causes a lot of data transactions that are all in the form of: Open DB connection->Perform Function->Close DB connection.

[quote=341287:@Greg O’Lone]Ok, so you can change the number of allowed simultaneous connections, just keep in mind that while an increase in sockets does mean that technically more users can connect, it also means more overhead for the session code. So if each of your sessions had a memory footprint of 3MB and you have 1000 users, you’d still need 3GB of free memory.

That said, to change the number of allowed connections, you should be able to simply put the following code in the App.Open event:

args.append("maxsockets=500")

The allowed command-line parameters are available here:
http://documentation.xojo.com/index.php/WebApplication

Though keep in mind that XojoCloud web apps always run as CGI and never as SSL (Apache takes care of that for you). That means that the MaxSecureSockets, SecurePort, SSLType and Certificate properties will do nothing on Xojo Cloud.[/quote]

[quote=341809:@Peter Stallo]Greg,

I have had instances I’ve been trying to isolate where about 20-30 users (college students) log on to use my application simultaneously and will get kicked off the system. It doesn’t seem to happen if there are around 15 or less students. Do you think that the sudden surge in simultaneous logins and data connections could be overwhelming the maxsockets levels on my application?

I don’t have anything like the maxsockets statement in the post below. Do you think I should try putting one in?

I have watched it occur and there was plenty of free memory and the CPU never seemed stressed. Maybe this is the key? A single login causes a lot of data transactions that are all in the form of: Open DB connection->Perform Function->Close DB connection.[/quote]
200 connections should easily handle 30 users. In fact, I’d expect at least 50 as most modern browsers limit their initial download to 4 simultaneous streams. I’d be more inclined to wonder if your “perform function” is somehow locking up and causing the other users to timeout and fail. Without knowing exactly what’s being done, this is all conjecture.

Well, at any given time, there might be a total of 35-75 other users just clicking along and performing routine functions. Then, an entire class of 30 students will be told “You may begin” by a teacher who is administering an exam. Then, within 60 seconds, they all login and begin and exam (which shows a flurry of database activity in MySQL, but no real stress on the server). I was wondering if the combined total of regular users and the sudden surge may cause it. It only seems to occur in instances of this ‘shotgun start’ for an exam.

how do I find the memory footprint of my apps?

I have an app that will help you with that. I will email it to you shortly.

Dim RAMused As Int64 = Runtime.MemoryUsed 'Runtime.MemoryUsed/1024 'convert to Kilobytes

I use this in my Web Apps:

[code]Public Function HardwareRAMUsed() as integer
// Shell Create
Dim ShellCmd As Shell
ShellCmd = New Shell

// Get the Process Info and get the 6th Value
ShellCmd.Execute(“ps aux | grep '” + App.ExecutableFile.Name + “’ | grep -v ‘grep’ | awk ‘{print $6}’”)
Dim Bytes As Integer
Bytes = Val( ShellCmd.Result )

// Shell Close
ShellCmd.Close

// Return the Bytes
Return Bytes
End Function
[/code]

Found a bug in the code above.

Bytes = Val( ShellCmd.Result )

Should be:

Bytes = Val( ShellCmd.Result ) * 1024

The method should also return an Int64 instead of Integer.

Peter did you ever find a cause for your issue?