Livecode Server with nginx
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Livecode Server with nginx
Do you have any standard configuration file to run LiveCode Server on a nginx server ?
-
- VIP Livecode Opensource Backer
- Posts: 92
- Joined: Mon Jul 06, 2009 4:53 am
Re: Livecode Server with nginx
I don't think it is possible to run LIvecode Server directly under nginx. nginx does not support cgi and I believe that LiveCode Server supports only gci. (Though I would be happy to be proved wrong.) I also don't believe that LiveCode Server has fast-cgi support either which could be used in conjunction with nginx.
I run cgi scripts on a web system fronted by nginx by forwarding the cgi requests to a lightweight web server (Cheyenne in my case). This works well and is easy to set up and you don't need to worry about load balancing as you do with fast-cgi. Simple cgi requests with a couple of simple database calls take less than 600 milliseconds on the system, so performance hasn't been an issue.
[I'm afraid I haven't configured LiveCode to run in this way, my client doesn't use LiveCode yet.]
I run cgi scripts on a web system fronted by nginx by forwarding the cgi requests to a lightweight web server (Cheyenne in my case). This works well and is easy to set up and you don't need to worry about load balancing as you do with fast-cgi. Simple cgi requests with a couple of simple database calls take less than 600 milliseconds on the system, so performance hasn't been an issue.
[I'm afraid I haven't configured LiveCode to run in this way, my client doesn't use LiveCode yet.]
Last edited by Peter Wood on Tue Jul 01, 2014 3:20 pm, edited 1 time in total.
Re: Livecode Server with nginx
Very interesting. Thanks for those informations. I didn't find any information about fast cgi support for LiveCode Server. I'm going to try.
Regarding your scheme (nginx - > Cheyenne) could you tell us why you did that, instead of using a classic Apache solution for instance ?
Regarding your scheme (nginx - > Cheyenne) could you tell us why you did that, instead of using a classic Apache solution for instance ?
-
- VIP Livecode Opensource Backer
- Posts: 9960
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Livecode Server with nginx
Fast CGI is normally dependent on threading. In a single-thread language like LiveCode you would likely find it frustrating, and almost certainly challenging in terms of system load.bangkok wrote:Very interesting. Thanks for those informations. I didn't find any information about fast cgi support for LiveCode Server. I'm going to try.
What is it about Nginx that makes it so compelling for your project? I wonder if there might be other means of getting what you're after.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Livecode Server with nginx
I was just curious. Nginx seems to be efficient, with low memory requirements, so I just wanted to experiment with LiveCode Server.FourthWorld wrote: What is it about Nginx that makes it so compelling for your project? I wonder if there might be other means of getting what you're after.
Peter Wood's scheme is intriguing though.
-
- VIP Livecode Opensource Backer
- Posts: 92
- Joined: Mon Jul 06, 2009 4:53 am
Re: Livecode Server with nginx
Apache is very big (especially in terms of memory usage). My client prefers taking a lightweight approach (me too). I believe that nginx is faster at serving static resources (html, images, javascript) than Apache and it certainly consumes less memory and resources. Cheyenne is a lightweight server written in Rebol. As our CGIs are also written in Rebol and it has some features specific to Rebol, it was the best choice for us.bangkok wrote:Regarding your scheme (nginx - > Cheyenne) could you tell us why you did that, instead of using a classic Apache solution for instance ?
Last edited by Peter Wood on Tue Jul 01, 2014 11:59 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 92
- Joined: Mon Jul 06, 2009 4:53 am
Re: Livecode Server with nginx
You can overcome the single-threaded issue to a great extent as nginx will forward requests to a range of ports. (Not true load balancing, it just loops through the list of ports). You still are left with working out how many instances of LiveCode Server to run and monitoring them. (And that is if LiveCode Server supports the Fast CGI protocol.)FourthWorld wrote: Fast CGI is normally dependent on threading. In a single-thread language like LiveCode you would likely find it frustrating, and almost certainly challenging in terms of system load.
What is it about Nginx that makes it so compelling for your project? I wonder if there might be other means of getting what you're after.
Peter
Last edited by Peter Wood on Wed Jul 02, 2014 12:00 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 9960
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Livecode Server with nginx
If you want really lean (though maybe more in features than system resources <g>) you could consider a server made entirely in LiveCode, like mchttpd:bangkok wrote:I was just curious. Nginx seems to be efficient, with low memory requirements, so I just wanted to experiment with LiveCode Server.FourthWorld wrote: What is it about Nginx that makes it so compelling for your project? I wonder if there might be other means of getting what you're after.
http://fourthworld.net/lc/mchttpd-4W.zip
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Livecode Server with nginx
Metacard... Many souvenirs. I've tried your stack with a LiveCode 5.5, it works !FourthWorld wrote: If you want really lean (though maybe more in features than system resources <g>) you could consider a server made entirely in LiveCode, like mchttpd:
http://fourthworld.net/lc/mchttpd-4W.zip
Re: Livecode Server with nginx
You could look at setting up Nginx with something like Thttpd. Nginx does not support CGI itself - it has to pass if off to a third party server.
That said, there is probably not going to be much difference in speed between Nginx and Apache as LiveCode is going parse scripts as pretty much the same speed regardless of the server used. Although Nginx is probably going to be more resource friendly.
If you are just wanting to experiement I would say go with Apache - its pretty simple to setup and seems to run pretty well - even on a small VPS and you can always change the hosting server at a later stage. Apache is probably also better documented in case you get stuck. It does seem to get a bit of bad reputation when it comes to load handling etc - but from my experience you do need quiet a load on the server before it acutally becomes a problem.
Cherokee is also an interesting looking alternative to Apache / Nginx and seems to be pretty good on the security side of things.
That said, there is probably not going to be much difference in speed between Nginx and Apache as LiveCode is going parse scripts as pretty much the same speed regardless of the server used. Although Nginx is probably going to be more resource friendly.
If you are just wanting to experiement I would say go with Apache - its pretty simple to setup and seems to run pretty well - even on a small VPS and you can always change the hosting server at a later stage. Apache is probably also better documented in case you get stuck. It does seem to get a bit of bad reputation when it comes to load handling etc - but from my experience you do need quiet a load on the server before it acutally becomes a problem.
Cherokee is also an interesting looking alternative to Apache / Nginx and seems to be pretty good on the security side of things.