App works then stops with server error.

Unfortunately I’m not permitted to discuss our solution here.

Make sure you have libicu and libsoup installed.

Only in CGI mode?

Also, I noticed that the web app (standalone) freezing sometimes a few seconds (or more…) without apparent reason (browser side). Yet, it seems not to be problems on the network or the server. Does anyone else have this behavior?

[quote=198373:@olivier vidal]Only in CGI mode?

Also, I noticed that the web app (standalone) freezing sometimes a few seconds (or more…) without apparent reason (browser side). Yet, it seems not to be problems on the network or the server. Does anyone else have this behavior?[/quote]

I have seen it often in debug mode, and that got me worried. Then I placed the app online and it did not happen. Could it be because of the debugging hook ?

Thank you Michel. All your apps are in CGI mode? This may be due to the standalone mode or reverse proxy.

Indeed, I think the problem occurs more often in debug mode, but it also happens online, in reverse proxy.

[quote=198402:@olivier vidal]Thank you Michel. All your apps are in CGI mode? This may be due to the standalone mode or reverse proxy.

Indeed, I think the problem occurs more often in debug mode, but it also happens online, in reverse proxy.[/quote]

Yes, my apps online are in CGI mode.

I did not try standalone on the server yet.

[quote=198373:@olivier vidal]Only in CGI mode?

Also, I noticed that the web app (standalone) freezing sometimes a few seconds (or more…) without apparent reason (browser side). Yet, it seems not to be problems on the network or the server. Does anyone else have this behavior?[/quote]

I was speaking specifically to the server process stalling out. If your browser stalls out but the server is still fine then its either an issue with the Javascript framework or your connection or something client side. Perhaps your browser is going into a power savings mode and it stops going back/forth with the server. Would need more details to look into it but sounds different from what I was referring too.

[quote=198290:@Michel Bujardet]how do I automate the standalone app start when system boots ?
how do I make sure my standalone app is always alive ?[/quote]

Not sure this was answered…

Point 1/ On a Linux server reboots are easily handled with a @reboot cron job

Point 2/ I have a bash script that checks a few parameters on the running app eg memory, processor, users etc. It then decides weather or not to terminate the app and or restart it. The algorithm for this is quite crazy as it also includes load balancing but it would be fairly easy for anyone who can code to write a simple script to just reboot their app. This assumes people who are using your app can handle the inconvenience of an app shutting down on them and recover whatever it was they were doing.

[quote=199899:@Chris Musty]Not sure this was answered…

Point 1/ On a Linux server reboots are easily handled with a @reboot cron job

Point 2/ I have a bash script that checks a few parameters on the running app eg memory, processor, users etc. It then decides weather or not to terminate the app and or restart it. The algorithm for this is quite crazy as it also includes load balancing but it would be fairly easy for anyone who can code to write a simple script to just reboot their app. This assumes people who are using your app can handle the inconvenience of an app shutting down on them and recover whatever it was they were doing.[/quote]

Your reply is appreciated, Chris.

This is more or less exactly what I feared. It is far from evident, keeping in mind that most Xojo Web users may be quite savvy about Xojo coding, but kind of newbies to the intricacies of Linux.

I have operated my own web apps since the mid nineties using Perl, then I used Php. All I had to worry about was uploading and making sure permissions were right. Besides, access to the program was simply a path like anything HTML, pictures, sounds, kitchen sinks.

Using Xojo cgi builds is just the same : upload, and on Mac, no need even to check permissions. Fire an forget.

Standalone demands a run, at least from SSH, or cron. And access to the app is not a normal path, it needs a port.

I am quite convinced that standalone is much faster, but frankly, I do not need a Formula One racing car to go to the corner street market. Until I really must have the performances of standalone, I will probably do myself the favor of easy does it, and remain with CGI.

As an aside my script has terminated the app once this year. Considering the app was running in AWS I suspect something happened to the server the VM was on and incorrectly triggered a restart of the app. It was at 3:13am. I have been complimented on how stable the app is and its flawless performance recording well over 100 million transactions to the DB in the last 6 months. Maybe the formula one (standalone) performance is more stable? Its always my practice to make things as efficient as possible. I simply cannot complain.

[quote=198290:@Michel Bujardet]…

  • how do I automate the standalone app start when system boots ?
  • how do I make sure my standalone app is always alive ?
    …[/quote]

I use a little script to check whether my webapp is up and running and if not, then it will start it.
On a linux virtual server, I defined a cron-job which runs that script every other minute.

Save this text for instance to /opt, and allow the file to be executed (755, rwxr-xr-x)

#!/bin/bash if [[ ! `pidof -s mywebapp` ]]; then sudo mywebapp start fi

[quote=213015:@Oliver Osswald]I use a little script to check whether my webapp is up and running and if not, then it will start it.
On a linux virtual server, I defined a cron-job which runs that script every other minute.

Save this text for instance to /opt, and allow the file to be executed (755, rwxr-xr-x)

#!/bin/bash if [[ ! `pidof -s mywebapp` ]]; then sudo mywebapp start fi[/quote]

Thank you Oliver :slight_smile:

You’re welcome. BTW: of course you will need to provide the full path to your webapp. I have installed webmin on my virtual servers which makes it easy to define cron-jobs. But one can easily find command-line examples for defining cron jobs as well.

A script example with the path pointing to a license checking webapp:

#!/bin/bash if [[ ! `pidof -s license` ]]; then sudo /usr/lib/cgi-bin/license fi