drupal 7 cron issue - drupal-7

"Attempting to re-run cron while it is already running" in drupal website hosted over two servers behind a load-balancer. The cron is eventually successful but I wonder why/how it is invoked multiple times. The problem is multiple crons slow down the site.

If you use multi-servers, you have to redefine crontabs and you'll be abble to switch from 1 server to the other with your cron tabs.
If you don't redefine them, DP will execute all crontabs twice (because 2 servers)

Related

DotNetNuke "Web Server Updated" event viewer message stopped scheduling process

I have scheduled one DNN scheduling process in Host=>Schedule section and it can take 3 to 4 hours to completed. But process can't able to completed because of "Web Server Updated" message popping up randomly in event viewer section and it restarts my application. It stopped scheduling process and forcing to restart scheduler. I'm using DNN version 07.03.02.
Do anyone knows what is the reason of this "Web Server Updated" message. Do I contact my hosting provider? OR Is it DNN problem?
Please review below screen shots.
https://www.dropbox.com/s/fjni9an5ajwghcq/2017-04-03%2011_16_44-Journal.png?dl=0
https://www.dropbox.com/s/kzhzv6tcvrq3z7b/2017-04-03%2011_16_44-Journal_1.png?dl=0
This issue would be due to the worker process restarting. DNN Inserts the "Web Server Updated" log entry at the start of the application.
For processes running that long, I'd recommend moving them outside of DNN due to the inherent nature of web applications. But if it is mandatory that it stay inside make sure that you have Always On enabled in IIS. I'd also recommend using a monitoring or similar solution to ensure you have traffic all the time, at least every 10-15 minutes before the 20 minute process shutdown.
Note: Even with the best configuration possible, it is NOT guaranteed that your process will run for 3-4 hours without interruption.

Any way to run multiple Google App Engine local instances for appengineFunctionalTest?

Background
From the docs, at https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
I see that by putting my functionalTests in /src/functionalTests/java does the following:
Starts the Local GAE instance
runs tests in the functionalTests directory
Stops the Local instance after the tests are complete
My Issue
For my microservices, I need to have 2 local servers for running my tests. 1 server is responsible for a lot of auth operations, and the other microservices talk to this server for some verification operations.
I've tried
appengineFunctionalTest.dependsOn ':authservice:appengineRun'
this does start the dependent server, but then it hangs and the tests don't continue. I see that I can set deamon = true and start the server on a background thread, but I can only seem to do that in isolation.
Is there a way to have a 'dependsOn' also be able to pass parameters to the dependent task? I haven't found a way to make that happen.
Or perhaps there is another way to accomplish this.
Any help appreciated

Postgresql Auction Application - Timer

I'm making a simple auction application as part of a project.
As is the case with auctions, their timer needs to be counting down (or other kind of time related update) even no one is actively using said application, so I wouldn't be updating them using scripts.
Is there any way to do that from inside the database or otherwise, without the help of an outsider like cron or windows task scheduler?
PostgreSQL has not integrated scheduler now. There are two usual solutions:
cron
pgagent - it is auxiallary application, that can work as scheduler - and it is controlled by SQL commands - pgAdminIII has support for this application http://www.pgadmin.org/docs/dev/pgagent-jobs.html

Cron not working automatically for Drupal 7

I configured cron in Drupal 7 for every 1 hour to delete "watchdog" table data. However, it is not working fine as expected when done automatically, even though it is working fine manually. What could be the problem with cron running automatically for specified intervals of time? Please, kindly help me with any alternate options, if possible.
Good morning.
Maybe one of your installed modules has a bad implementation of hook_cron(). An error in this hook would provoke the whole cron process to fail. You can use Cron Debug module to check which of the modules is failing during the cron execution. After that, you may consider disabling the module, or checking what is going wrong and fixing it.
Hope it helps.

Replicating AppEngine's task queue facility on EC2 / Elastic Beanstalk

I'm considering moving from AppEngine to EC2/Elastic Beanstalk as I need my servers located within the EU [AppEngine doesn't offer a server location option AFAIK]. I've run the Elastic Beanstalk sample application, which is good as far as it goes; however one of the AppEngine features I rely on heavily is the offline task queues / cron facility, as I periodically fetch a lot of data from other sites. I'm wondering what I would need to setup on Elastic Beanstalk / EC2 to replicate this task queue facility, whether there are any best practices yet, how much work it would take etc.
Thanks!
A potential problem with cron services in Beanstalk is that a given scheduled command might be invoked by more than one service if the application is running on more than one instance. Coordination is needed between the running Tomcat instances to ensure that jobs are run by only one, and that if one of them dies the cron service doesn't get interrupted.
How I'm implementing it is like this:
Package the cron job "config file" with the WAR. This file should contain frequencies and URLs (as each actual cron is simply an invocation of a specific URL, as AE does it)
Use a single database table to maintain coordination. It requires at least two columns.
a primary or unique key which (string) to hold the command along with its frequency. (e.g. "#daily http://your-app/some/cron/handler/url")
a second column which holds the last execution time.
each tomcat instance will run a cron thread which should read the configuration from the WAR and schedule itself to sleep as long as needed until the next service invocation. once the time hits, the instance should first attempt to "claim" the invocation by first grabbing the last invocation time for that command from the database, then updating it to get the "lock".
query(SELECT last_execution_time FROM crontable WHERE command = ?)
if(NOW() - last_execution_time < reasonable window) skip;
query(UPDATE crontable SET last_execution_time = NOW() WHERE command = ? AND last_execution_time = ?)
if(number of rows updated == 0) skip;
run task()
The key element here is that we also include the last_execution_time in the WHERE clause, ensuring that if some other instance updates it between when we SELECT and UPDATE, the update will return that no rows were affected and this instance will skip executing that task.
If you're moving your app, you're probably better off simply using TyphoonAE or AppScale. Both are alternate environments in which you can run your App Engine app unmodified, and both support EC2.

Resources