Openshift tomcat killed after one day - openshift

I have deployed a java web application in openshift using tomcat server.Application is running fine. But after 1-2 days automatically tomcat server gets killed.so i have to manually start the server.can any one tell me what is going wrong here.i'm using free account.
Thanks,
A.G.Ishara

Applications on the free account get idled automatically after 24 hours of no external http requests. The application should then automatically restart itself once a request is made.

Related

How to auto restart OpenShift deployment on a weekly/daily basis?

I'm having a flask app that fetches data from external source only at application startup.
I need to refresh app data, and the easiest way (without changing app logic) would be to daily restart deployment (scale pod to zero and up again).
Is this possible to achieve this in deployment configuration (DeploymentConfig)?
OpenShift version is v3.11.104.
Seems to be solvable with running an app using OpenShift Cronjob, configuring the Cronjob to be run every day, and setting ConcurrencyPolicy param to Replace.

Unable to Handle huge HTTP request

I am using Apache Tomcat Version 8, It contains 5-8 web application developed in J2EE with some frameworks i.e. Spring, Struts, most of them are developed in Servlet also there is database connection with them on same system. These application are running on Linux OS with Java 7.
Every time when I am restarting Apache tomcat server its able to handle certain amount of http request after that its unable to handle the request, every new request taking too much time and webpage connection time out.
I have tried many ways to solve this issue but failed. Also I have increase connection limits in Apache Tomcat as well as at OS level but no solution.
If anyone has any idea please guide me to solve this issue.
OR
Is there any other web server which can solve my issue?

GCP google instance group

I'm working on an architecture to deploy my webapp. I would like to use Google Managed Instance Groups because I have some strict requirements. I was wondering:
which is the best Web container to be deployed in a distributed environment?
I'm familiar with Tomcat, it's Tomcat OK to be deployed in an instance group?
my Webapp running on tomcat will generate logs that will be stored in the current machine hosting tomcat. How should I handle distributed application logs.
I don't want to lose information and I would like to have a single view of all log of my webapp even if distributed, Is it that possible?
Thanks
I have used tomcat in GCP for over a year and it has worked without problems with the load balancer. To solve the issue of the logs you must use an agent to save the logs in stackdriver https://cloud.google.com/logging/docs/view/service/agent-logs

Web server and MySQL server on different machines, causing latency on websites

I am currently running a virtualized environment for my web and db server. When I access the web server or the MySQL server individually, they are both fast. I also have websites running on the web server that do not require the db server and those all load quickly. However, when I access my hosted website that requires the web server to call from the db server, there is about a 5-7 second latency for every page load. This has been confirmed with both a very simple site and with a Word Press setup as well. Here is the config:
Web server - CentOS 6.5, Apache 2.2.15
DB server - CentOS 6.5, MySQL 5.1.73
My question is, are the servers continuously authenticating with one another (and thus causing latency) on every single db call? If that is the case, does anyone know how to permanently authenticate between the two?
I might be way off on this assumption and authentication could have nothing to do with it. I am completely open to any and all ideas at this point. Thank you very much.
V/R,
Tony
To me it seems to be a network issue.
and obviously the db-server will need authentication every time there is a hit.

Synchronization and time keeping of multiple applications

How would I implement a system that will keep 20 applications running on a closed network to stay synchronized whilst performing various tasks?
Each application will be identical, on an identical machine. These machines will have a socket connection to the master application that will issue TCP commands to the units such as Play:"Video1.mp4". It is vital that these videos are played at the same time and keep time with each other.
The only difference between each unit is that the window will be offset on the desktop, so that each one has a different view port on the application - as this will be used in a multi-projector set up.
any solutions/ideas would be greatly appreciated.
I did it some years ago. 5 computers running 5 instances of the same flash app. Evey app was displaying a "slice" of the same huge app and everything needed to be synchronized at fractions of seconds precision.
I used a simple Python script (running on a 6th machine) that was sending OSC messages on the local network. the flash apps were listening through FLOSC to this packets, and were sending to the Python script message about their status.
The stuff was running at the Withney Museum (NY) and at Palais de Tokyo (Paris), so I'm quite confident about the solution :) I hope it helps you
You have to keep tracking and latest updated data in your master application. you have to broadcast your newly updated data to all connected client to deliver updated data. after any update from any client you have to send updated data to all connected clients.
In FMS remote shared object is used to maintain data centrally across the network connected application via FMS. when any client is sending any updated OnSync Event is fired to all client application and data is sync with FMS Remote Shared Object. So this kind of Flow you have to develop for proper synchronization of data across network.
you can also use the RPC system to sync data between all connected application to the Master application. in that you have to init RPC to the client to Master application to send data update and Master application send RPC to all other client which are connected to the Master application.