A front end won't really slow things down significantly (although you are adding another communication layer). You probably won't need to do it though unless you are, as Aaron suggests, needing load balance across multiple instances. Then Apache is an option as is nginx. Personally I haven't found a need to do that on an IBMi platform yet.



-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Kelly Cookson
Sent: 21 August 2015 18:24
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] Starting a node program so it keeps running without interactive jobs staying open.

Aaron,

Thanks again. I really appreciate the help.

I am a little curious about using Apache as a front-end (same as reverse proxy?) for a web server or a REST service running in NodeJS. Would setting up Apache as a reverse proxy diminish the speed associated with the NodeJS event loop? Would the Apache web server slow down requests getting put into the queue of the NodeJS event loop, or slow down the responses coming back from the NodeJS event loop?

I'm asking, not suggesting. I have no idea. It would be nice to know why it would slow things down or why it would not. Maybe it's not even a well formed question.

Thanks,

Kelly Cookson
IT Project Leader
Dot Foods, Inc.
1.217.773.4486 ext. 12676
kcookson@xxxxxxxxxxxx



-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Aaron Bartell
Sent: Friday, August 21, 2015 12:10 PM
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] Starting a node program so it keeps running without interactive jobs staying open.

In its simplest form you can do the following. Eventually you will want to add more options (i.e. start multiple instances on different ports for load balancing with a front-ending Apache/nginx instance).

SBMJOB JOB(QSH CMD('/dir/start.sh'))

---start.sh---
#!/usr/bin/sh
cd /dir
node sample.js


Aaron Bartell
litmis.com - Open Source and IBM i. No Limits.


On Fri, Aug 21, 2015 at 12:04 PM, Kelly Cookson <KCookson@xxxxxxxxxxxx>
wrote:

I have developed a "hello world" web server using JavaScript and
NodeJS. I am starting the web server using interactive sessions. I
open a 5250 session, then open an interactive qshell session, then run
the following
command:

node /mydirectory/sample.js

When the "hello world" web server is running, there are three jobs active:
1. My interactive 5250 session.
2. The qshell interpreter (QZSHSH)
3. A job that appears to be the node program (QP0ZSPWT).

But when I end the qshell session the node program (the QPOZSPWT job)
also ends. So my "hello world" web server is no longer running.

How do I get my "hello world" web server to run in NodeJS without me
having to leave an interactive qshell session open?

Thanks,

Kelly Cookson
IT Project Leader
Dot Foods, Inc.
1.217.773.4486 ext. 12676
kcookson@xxxxxxxxxxxx

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
mailing list To post a message email: WEB400@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.


___________________________________________
This email has been scanned by iomartcloud.
http://www.iomartcloud.com/


________________________________

NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.



--------------------------------------------------------------------------------


CoralTree Systems Limited
Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton
Hampshire
SO15 2EA
VAT Registration Number 834 1020 74.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.