DeadlineExceededError for Google Cloud SQL after 60 secs - google-cloud-sql

We have an script that calls a procedure that sometimes takes more than 60 seconds to execute. When the procedure goes above 60 secs, we get a DeadlineExceededError. The error message looks like this:
DeadlineExceededError: The API call rdbms.Exec() took too long to respond and was cancelled.
This script is scheduled as a cron and using B8 class back end. Does using a back end have any effect on the timeout limit of a query? What can I do in case of a query taking more than 60 secs to execute?

Yes, using a cron or backend would give you a longer deadline. See this FAQ entry:
https://developers.google.com/cloud-sql/faq#sizeqps

There's obviously a bug, because I run query on backend instance and it also raises DeadlineExceededError after 60 seconds.
Here's the ticket in googleappengine https://code.google.com/p/googleappengine/issues/detail?id=9479 and on googlecloudsql https://code.google.com/p/googlecloudsql/issues/detail?id=71
No response yet.

Related

How to speed up queries to grafana loki?

I met the problem that when I try to use filter logs by logQL query I wait response from server about 13 seconds? Is there any way to decrease this value?
For example, request without logQL query "https://someurl/6/loki/api/v1/query_range?limit=5000&query={container=%22test%22}&start=1673902800000000000&end=1673989199999000000" I wait about 3 seconds but to 'https://someurl/6/loki/api/v1/query_range?limit=5000&query={container=%22test%22}|="message"&start=1673902800000000000&end=1673989199999000000' I got 11-13 seconds
I tried to discover google for something useful but didn't find anything

Jmeter Throughput shaping timer Questions

So, I am using JMeter's throughput shaping timer to test the performance of our REST Server. I noticed a few things i did not expect.
First of all my setup details :
1)JMeter Version : 3.0 r1743807
2)JMX file : DropBox Link
Now , my questions :
1)The throughput shaping timer is configured to run for 60 seconds(100rps - 30 secs, 200 rps - next 30 secs). But the actual test runs only for 3 seconds as shown below. Why?
2) As per the plan the number of requests per second should go from 100 - 200. But here it seems to decrease , as in above.
3)As per this plugin's documentation , the number of thread groups = desired requests per second * server response time / 1000 . Is it because how this plugin internally works or is it a simple logic i am missing?
The issue is with the Thread Group settings.
You only one have 1 iteration and ramp up 300 users in 1 second. So if Jmeter can send all the 300 requests and get the response, JMeter will finish the test immediately. Those timer settings will apply only if the test is running.
If you need the test to run for some duration (say 60 seconds), then set the loop count to forever & duration to 60

Procedure executing 10 times faster using job agent

I have got procedure that does some inserts with selects. When i try to run it from Access or even in management studio it takes 4 minutes. With job checking every 40 sec if there is that procedure to execute and executing it it took around 15 sec.
What can cause a problem? Why the same procedure executed from job is 10 times faster than procedure executed from access or query in management studio?
I doubt there is any time difference here. The problem is that after the job runs a few times, then the data is likely cached in memory, and thus it runs very fast.
You do a fresh re-boot and then check the time for the run, it should be the SAME from all sources.
It is not clear how you are calling this routine, but is it possible that the job scheduling is NOT waiting for the routine to finish?
And does the routine return any data to the client application? Perhaps the difference is that when run from Access (or SSMS) then lots of data is returned from the stored procedure, but when run using job agent, then NO provisions exist to consume the returned data, so the returning of data is ignored and thus the result(s) run faster.

How to test the page loading time with Gatling

For example- I need to check that for 1000 users it responds in 3 seconds.
Is the number of users and response times configurable?
This answer targets Gatling 2.
You can set the target number of users by configuring the "injection profile" of your simulation:
setUp(scn.inject(atOnceUsers(1000)) // To start all users at the same time
setUp(scn.inject(rampUsers(1000) over (30 seconds) // To start gradually, over 30 seconds
For more information, please refer to the injection DSL documentation
If you want to check that all your users responds in less than 3 seconds, one way to ensure this is Gatling's assertions:
setUp(...).assertions(global.responseTime.max.lessThan(3000))
If this assertion fails, meaning at least one user responded in more than 3 seconds, Gatling will clearly indicate the failure after your simulation is completed.

java quartz cron expression with hh:mm start/end time and every X minutes

I'm trying to create a cron expression that will trigger a job according to the time I get, and every X minutes. both start/end time and the minutes intervals are parametrs I get from the user. for example:
start time: 09:15
end time: 19:35
minutes interval: 15
I want the job to start at 09:15 and to be triggred every 15 minutes, so the last job will actually be at 19:30 (because it can't be after 19:35).
my problem is that I dont know how to include the minutes of the start/end time..
How is it possible to create this kind of expression?
Thank's In advance.
I don't think that it is possible to meet your requirements in a single cron expression, as each time component (hours/minutes/seconds etc) is handled independently.
Perhaps the simplest approach would be to have a trigger for running every 15 minutes, and enable/disable this trigger at 09:15 and 19:35 (e.g. using additional triggers).
Alternatively you could have a trigger fire every 15 minutes, and procedural logic attached to this trigger which checks if the current time is between 09:15 and 19:35 before doing any work.
You don't need CRON, simple trigger will do. Check out Lesson 5: SimpleTrigger. This should work for your situation:
trigger = newTrigger()
.startAt(nineFifteen)
.endAt(nineteenThirtyFive)
.withSchedule(simpleSchedule().withIntervalInMinutes(15))
.forJob(someJob)
.build();