Passenger daily restarts nodejs app on CloudLinux - application-restart

I have a nodejs application running on Apache server (Cloud Linux). The problem is that Passenger restarts the nodejs app daily at midnight, even if users are connected to the web application. I didn't find any cron asking to restart. Here is the Passenger log which is logged daily at midnight:
Checking whether to disconnect long-running connections for process 5519, application [...] (production)
Is there a way to prevent this daily restart?
Or at least to change the restart time?

Related

when web application deployed in On-Perm Kubernetes though it is deployed in more than one pod it is taking more time to respond

I have the web application which is deployed in Windows IAS server and the Api is taking less time to respond but when the same application deployed in On-Perm Kubernetes though it is deployed in more than one pod it is taking more time to respond, why it is taking more time?

What happens to processes when an EBS backed EC2 instance is stopped and restarted?

I'm running an application that is a web app and the backend for an ios app as well as a database in an ec2 instance. Will these processes resume if I stop, resize, and restart my instance? Will I need to go in and run startup scripts?
Any help is appreciated, I'm confused by the AWS documentation as to exactly what happens.
It's just like turning your laptop off and then back on. If you have configured the services to start automatically on boot then they will restart, if you haven't configured them to start automatically on boot then they won't.
This is a function of the software you have installed and configured on the EC2 instances, and whatever Operating System your EC2 instance is running. You won't find much about this in the AWS documentation because it isn't really Amazon specific.

Why Windows system having Cassandra Server is hanging?

For testing purpose, I have installed Cassandra Single Node server in my windows 64-bit System where the Cassandra Server running Continuously as a Service. After 2 or 3 Days of Continuous run, my System is getting hanged which does not allows any operations at all. But Cassandra Server is serving requests from Client applications with out creating any problem. What is the reason for this problem and How to solve this issue?

How to deploy sinatra application on myown private server?

i am new to sinatra application. i developed my first application with sinatra. Now, i want to deploy this application on my own private server. My own private server is Linux server and all required config (i.e., ruby, sinatra, passenger ) installed.
So, i would like to know how to deploy it?
Here's our company's basic setup for Ruby microservices APIs:
1) Put your Ruby apps in a special folder
We like /srv/applications/
2) Choose a port for your application
Don't use the default port. I prefer ones in the 2000 series (E.g., 2000, 2010, 2020, ...) for Ruby apps.
3) Setup a reverse proxy to access your application on that port
Depending on your server, there are lots of Tutorials for Apache or Nginx.
That way /user-api will redirect to your port. Ex. myserver.com/user-api goes to myserver.com:2020
4) Run your application
If you're not using bundler, use bundle to run the app. To run on a specific port, use "bundle exec rackup -p "
You should then be able to access the application. If you run into trouble, some common problems include 1) the port is being blocked to the outside world, 2) you tried to access it before the app was running and now you still get 503s even though the app is running (restart your webserver to fix it).
Bonus - running your app as a Unix service
This has enormous benefits. If you can run the Ruby app with another supervisor level app, then you can automatically start it on reboot, automatically restart the app on failures (which can lead to flapping when you have catastrophic problems).
Originally we used Monit which is typically used for service monitoring but can actually start/stop/restart (start on boot) for a service.
Now we use foreman and upstart. I highly recommend this pairing, as app supervision is the textbook use case for Upstart. You can skip using Foreman if you have a vanilla configuration, but it is incredibly useful if you need to start other services, set environment variables, etc.

Run faye server on production server

I want to use Faye on production server. how can I start faye server automatically or as a daemon process.
Because when I start faye server using SSH it shutdown as i close ssh connection. Please guide me its really urgent.
I can run faye server on local but how I can rub this on live site.
It gets stopped probably because you're running it in your session, and once that session is closed it receives a SIGHUP signal and quits.
A quick test to determine if that's really your problem is to log in, execute
nohup your_server_startup_command > /dev/null 2>&1 &
logout, and see if the server still runs. THIS IS NOT A PERMANENT SOLUTION THOUGH!
The normal way for a server is to create a management script in init.d, and then use the service management app of your Linux distro to have the service started in the appropriate runlevels. In OpenSUSE you'll use YAST for that, in Ubuntu there's sysvconfig.
There are subtle differences between Linux distros, have a look here to get a general idea of how an init.d script is supposed to look, or here for an absolute bare-bones example.
I use faye as my message server currently.
Perhaps you would want to make faye as a daemon.
I use this for my faye app.
http://rubygems.org/gems/daemons
just
gem install daemons
and edit ur own rake file or a plain ruby to run daemon up. that's all
There are lots of daemon tools for ruby.
You can also combine faye with sinatra or thin,
but it's a little bit hassle when you can use daemons and fire it up in 3 mins. :)
Using Foreman + Upsart should be the best way to do it.

Resources