Is anyone else using an upstart script to manage the edgemicro node process?

Not applicable

We're deploying edgemicro into an environment where we expect all the processes to have some sort of service management, e.g. to restart if it dies unexpectedly. I've created an upstart script to do this, which uses the edgemicro start CLI.

Is anyone else doing this? Interested in what traps you might have fallen into. Some I've fallen into:

  • Using an appropriate exec statement so the spawned node process PID is tracked properly
  • Edgemicro reports started even if there was an error opening the listening port (because edgemicro is still running due to the PID not being tracked properly - see point above)
  • Needing to set limit nofile explicitely in the upstart script (machine default way too low)
  • Directing edgemicro start stdout and stderr to a file to be able to see what's going on.
  • unprivileged user might not have access to the SSL key (still no good solution for this other than ensuring the has read access)
0 4 321
4 REPLIES 4

Not applicable

We toyed around with 4 or 5 different methods of "deamonizing" edge micro.


In the end we sort of tossed our hands up and moved to a RHEL 7.x disto and used systemd.

This worked REALLY well for our test lab. So well that I felt sort of sill for having waste my time with other tools that only sort of worked. The amazing thing was that systemd even worked for the old version of edge micro that required the multiple processes... systemd automagically tracked that for us.

Note that I never did anything with SSL because the use case we were chasing after did not require it at the time.

I had a BUNCH of OS network and system optimizations we needed to put in place to get any respectible performance out of a single instance of edge micro though... nofile was only the beginning if I remember.

I'm stuck with CentOS 6.5 at the moment so no systemd unfortunately. Would much prefer that road, but alas...

Would really appreciate it if you could share any of the OS network and system optimizations to get edgemicro performing even somewhat respectably.

Thanks!

our open file max is set globally to be.. unlimited on our VM & Cloud servers, so I didnt set that.

I did set a bunch off other stuff though:

#configure network settings to allow for high traffic and large number of connections
sudo sysctl net.ipv4.ip_local_port_range="15000 61000" 
sudo sysctl net.ipv4.tcp_fin_timeout=10
sudo sysctl net.ipv4.tcp_tw_recycle=1
sudo sysctl net.ipv4.tcp_tw_reuse=1
sudo sysctl net.ipv4.tcp_max_syn_backlog=2048 
sudo sysctl net.core.netdev_max_backlog=2000
sudo sysctl net.core.somaxconn=1024
sudo ifconfig eth0 txqueuelen 5000

note that with this setting, fin/wait will time out at 10 seconds, forcing a rather rapid recycle in 10 seconds - so if you have ANY long waiting open connections without IO going across thiem this wont work for you.

I cant publish my performance data with these settings on basic microservices, but with these settings and the fixed versions of microgateway, we saw good performance at 800-1200 req/sec. We did not take into account coordinated omission problems - which I suspect exist due to the nature of Node.

Not applicable

@Benjamin Goldman - Ben can you share the systemd file that you're using?

,

Ben,

Can you provide an example of the systemd file you've used.

@Benjamin Goldman