[#463] Regarding email we got from support

Migrated from Redmine #463 | Author: P P
Status: New | Priority: High, I’m very impatient | Created: 2020-01-22


Hello,
We have had API set up for 4 months now with no issues. It is set to ping every 5 minutes about 288 times a day.

Please advise what this email is about:
Hello,

It seems that your API scripts are making heavy load on our common servers, and you have now about 120.000 API calls/day while generally we only allow maximum 25.000 calls per day. Please reduce this in the next 7 days before we apply the limit. If you move to enterprise servers, which have considerably fewer users and can take more load, you can have up to 50.000 calls per day on Basic enterprise subscription and up to 200.000 calls per day on Standard enterprise subscription..

By using our call back function to update availabilities, API calls can be reduced dramatically and you could be within limits on our common servers, however if this is not used, then enterprise version can solve this.
All the best

Ingi

Redmine Admin wrote:

Hi, what is your company login?

P P wrote:

Redmine Admin wrote:

Hi, what is your company login?

Foodtruckeats

Redmine Admin wrote:

you did 24981 during last 4 hours which is about 6K per hour 150K per day. This is far too much.
You should optimize your code using suggestions in this email.
We can’t offer such load on common servers unfortunately

P P wrote:

Redmine Admin wrote:

you did 24981 during last 4 hours which is about 6K per hour 150K per day. This is far too much.
You should optimize your code using suggestions in this email.
We can’t offer such load on common servers unfortunately

Hi,
Can you tell us how this is? We have it set to ping once every 5 minutes I thought. What do you see that it is doing?
We want to correct this ASAP! I have no reason to run this many pings.

Please advise.

Redmine Admin wrote:

Unfortunately I can’t answer this question because do not know what your code is. This is data from API calls counter.
Please check your code and cron settings to correct this. Try to increase internal from 5 minutes to 1 hour, use caching to not query same data over and over, use booking hooks to update availability when you get New booking not by getting full availability every 5 minutes.

P P wrote:

I have forwarded this to our programmers - and will be looking at straightening this out ASAP.

One more follow up - are you able to look at past logs over the last 1 month and see when you started seeing this spike?

I want to see if there was a change in coding on our end (recently) that is causing this. We’ve been utilizing this for the past 4-5 months with no issues mentioned by you. So I’m seeing if this is something recent.

Thanks for your help in troubleshooting.

Masud Hasan wrote:

Is there any API method by which we can get all the data at a time and and can store the response in our local storage? right now we have to call
getAvailableTimeIntervals($start_new_date,$end_new_date,$serviceId,$providerId,1) this method many time for getting result.

Redmine Admin wrote:

there is no other API method, you have to optimize your code somehow. providerId can be null if it doesn’t matter who should provide event.
You may try to use getUnitWorkingDurations($dateStart = null, $dateEnd = null, $unitGroupId = null) method

Masud Hasan wrote:

getUnitWorkingDurations($dateStart = null, $dateEnd = null, $unitGroupId = null) will return all values ? or Empty values?

Redmine Admin wrote:

it will return available intervals

P P wrote:

Redmine Admin wrote:

it will return available intervals

Hello we are running a couple of diagnostic scripts. Can you please RESET the 10K limit?
We need to diagnose the exact issue.
Would greatly appreciate it!

Thanks

Redmine Admin wrote:

Hi, we did set it to 30K for you already as understood it can be very bad for you business. This limit is already reached. Decreased it, so you now have 10K for next 8 hours.

P P wrote:

Redmine Admin wrote:

Hi, we did set it to 30K for you already as understood it can be very bad for you business. This limit is already reached. Decreased it, so you now have 10K for next 8 hours.

Thank you guys! We are almost there - we have a few more hairs to pull out :slight_smile:

Once again - our sincere apologies with this. Never knew this was happening on your end and was not our intentions whatsoever!

Parag

P P wrote:

Hi,
We are getting this:

ust
24.01.2020 20:20:02. getCompanyInfo Array
Array
(
)

Request error: Too many requests

And you just turned the 10K on…

Redmine Admin wrote:

Please try now

(Short original content)

P P wrote:

Redmine Admin wrote:

Please try now

Ok we have reduced this down to a theoretical 11K… but are testing it. Took your suggestion to bring this down to 1 hr… We will continue working on this tomorrow. I wanted to keep you filled in on our efforts.

P P wrote:

Hello,
We are having a really slow go at getting the data via API. Is there a way we can request 3 or 4 months in one go rather than the 1 month?

Currently to get 1 month of data is taking a rather long 12 seconds… getting 2 or 3 months just gets that much longer. Clients think the system is broken.

Thanks

Redmine Admin wrote:

Hi, unfortunately it is not possible. In all our interfaces we trying to show max 1 week in advance to optimize speed.

P P wrote:

Hello,
Suddenly at 1:30 (About 2 hours ago)
the API on our account stopped. Can you advise if there is an outage on your end - or what may be going on?

Thanks