Drupal timeout - how to amend timeout length? - drupal-6

I'm looking to create a custom module which hooks into the Drupal timeout procedure. It needs to fire a quick ping to another server when a user times out - so that they are logged out of the systems on the second server too.
Thing is... I can't find any documentation about how Drupal manages it's timeout. What I have been able to find is all related to PHP.ini.
This leads me to wonder if it's possible to fire an event on timeout at all? Has anyone got experience with this?
Thanks,
Hugh

In /sites/default/settings.php change
ini_set('session.cookie_lifetime', 2000000);
2000000 seconds is 23 days which seems a really stupid default timeout, so you can change it to something like:
3600 (1 hour)
10800 (3 hours)
86400 (1 day)

Related

puppeteer issue on CentOs 7 problem after exactly 30 minutes

i have a script that use node js and puppeteer, the script run wonderful on my windows 10 for as long as i dont close it from command line, when i`m using it .
on my VPS it is working for exactly 30 minute , i tried few times and all the time it is exactly 30 minutes, the node js is still functioning but no data is received after 30 minutes, i`m scraping web socket just for the info .
i have tried any args on launch but nothing is keep the connection alive.
Have you tried resetting the websocket connection yourself to bypass the issue? Not sure the application here, but a simple "disconnect - reconnect" every 29 minutes (or every minute for that matter) might just do the trick?
finally i found a solution :)
i guess the sites checking your activity and if you are not active for 30 minutes then they closing any connection that is open , so with puppeteer you can use mouse movement and that is the solution , i put movement in interval and all are fine now, if someone have that issue then just use this method and all are good.

Nginx access log with milli seconds

Currently Im having the time in my access logs as
2018-03-20T04:11:42-07:00
Actually Im bit confused on this notation. What is the T part about? How can I add the time part with milliseconds ?

How frequently the Traffic Manager monitors endpoints

How frequently the Traffic Manager monitors endpoints? It's very obvious that it's not event driven (when an endpoint is down it takes up-to 30 secs - 2.5 mins to identify the status of the endpoint as per my observations). Can we configure this frequency, I cannot see any configuration for this.
Is there a relationship between Traffic Manager Monitoring interval and TTL?
This may look like a general question, but my real issue is that I experience a service downtime in a fail over scenario (fail over of the primary). I understand the effect in TTL where until the client DNS cache expires they are calling the cached endpoint. I spent a lot of time on this and now I have narrowed down it to a specific question.
Issue is that there is a delay in Traffic Manager identifying the endpoint status after it's stopped or started. I need a logical explanation for this, could not find any Azure reference which explains this.
Traffic manager settings
I need to understand this delay and plan for that down time.
I have gone through the same issue. Check this link, it explains the Monitoring behaviour
Traffic Manager Monitoring
The monitoring system performs a GET, but does not receive a response in 10 seconds or less. It then performs three more tries at 30 second intervals. This means that at most, it takes approximately 1.5 minutes for the monitoring system to detect when a service becomes unavailable. If one of the tries is successful, then the number of tries is reset. Although not shown in the diagram, if the 200 OK message(s) come back more than 10 seconds after the GET, the monitoring system will still count this as a failed check.
This explains the 30-2 mins delay.
basically the maximum delay would be 1.5 mins + TTL as per the details.

Herkoku "must sleep 6 hours in a 24 hour period", showing custom text?

Heroku says (free)
Must sleep 6 hours in a 24 hour period
Ok, that´s fine.
But can I influence the message or any text shown to the user like: "Hello user, unfurtunately the the website needs some rest, please try again from 6 a.m to 2 a.m ".
I can influence the uptime, because of sending a ping every 20 min.
I just found this:
... free dynos are allowed 18 hours awake per 24 hour period, and over the next few weeks we will begin to notify users of apps that exceed that limit ...
If you're using a CDN you could create a scheduled task that replaces the root page by a static page at a certain time of day, make sure the CDN updates to that page, and then spin down the app for 6 hours.
The docs for CloudFlare might be a good place to start learning how a CDN works and how to set it up (see: CloudFlare Support > Getting Started). Of course you could also use a different Content Delivery Network (CDN) service.

How to set timeout in IIS 6 when ColdFusion is unresponsive

This maybe related to platforms other than ColdFusion.
IIS 6 Log reports "time-taken" much longer (30 minutes) than 120 seconds set in Connection Timeout for several requests to ColdFusion page.
I assume that ColdFusion was unresponsive at the moment. I would like IIS to stop the request rather than wait this long.
Is there an IIS setting that would force this?
Not really because iis is no longer handling the request once it has been passed to cf. You could try playing with application pool timeout and see if you can get that to throw an error.
This scenario can also be considered as the slow HTTP DoS attack when caused by the client. IIS doesn't provide much protection against it (at least for slow POST body) because Microsoft considers it a protocol bug, not an IIS weakness. Although I think in this case it is your server doing it to itself.
Things to check:
You didn't mention whether it is the request that is slow or the
server's response. You could try tweaking your
MinFileBytesPerSec parameter if it's the response that is slow. By
default it will drop the connection if the client is downloading at
less than 240 bytes per second.
Remember, that 120 second IIS timeout is an idle timeout. As long as the client sends or receives a few bytes inside 120 seconds, that timer will keep getting reset.
You didn't mention if this long wait is happening on all pages or always in a few specific ones. It is possible that your CF script is making another external
connection, e.g. CFQUERY, which is not subject to CF timeouts, but to the timeouts
of the server it is connecting to. Using the timeout attribute inside CFQUERY may prevent this.
You also didn't mention what your Coldfusion settings are. Maybe the IIS timeout setting is being ignored by the Coldfusion
JRUN Connector ISAPI filter, so you should check the settings in
Coldfusion Administrator. Especially check if Timeout Requests
after has been changed. If its still at the default of 60
seconds, check your code to see if it has been overridden there, e.g.
<cfsetting requestTimeOut = "3600">
Finally, there is the matter of the peculiar behavior of CF's requestTimeout that you might have to workaround by replacing some cfscript tags with CFML.

Resources