Mongodb performance tuning

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:34:19 +0000.
Sender:Senthil Muniswamy.
Date:Wednesday, 18 November 2015 22:59:00 UTC.

Hi Martin,

We have about 250k documents in tyk_analytics collection and are experiencing slow response for the tykdash API queries. Mongodb database operation performance analysis shows that some queries take as much as 1100 ms. Do you have a setup guide or suggestion for tuning the tyk_analysis database performance?

Thanks,
Senthil

Imported Google Group message.
Sender:Martin Buhr.
Date:Thursday, 19 November 2015 07:26:33 UTC.

Hi Senthil,

See this thread:

https://groups.google.com/d/msgid/tyk-community-support/b52681f5-6254-444f-8b25-c3d58df887ce%40googlegroups.com?utm_medium=email&utm_source=footer

You will need more RAM on your mongodb instance to handle the large aggregations and porentially expire older data using an index

Finally, using SSD backed instances for mongo is much advised.

Thanks,
Martin

  • show quoted text -

  • show quoted text -


You received this message because you are subscribed to the Google Groups “Tyk Community Support” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/99b5d6e9-486d-4678-a94c-708856cd40d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Imported Google Group message.
Sender:Senthil Muniswamy.
Date:Wednesday, 9 December 2015 23:04:07 UTC.

Hi Martin,

I am setting up analytics data expiry. In handler_success.go, GetOrgSession(thisOrg) is not finding the organization session. FYI, I have only one organization. Do you think of any reason when it would not be available?

Thanks,
Senthil

  • show quoted text -

Imported Google Group message.
Sender:Martin Buhr.
Date:Wednesday, 9 December 2015 23:12:09 UTC.

Have you added the org session to Tyk? You need to add it as a key with this:

https://tyk.io/v1.9/rest-api/organisation_quotas/#create-org-keys:4a49335e00a9a54968892fb5dc0a2a44

If the org is not added then the timeout isn’t respected.

You can also use the data expiry at the API definition level:

https://tyk.io/v1.9/api-management/api-definition-detail/

(See expire_analytics_after)

Let me know if that helps.

Cheers,
Martin


From: Senthil Muniswamy [email protected]
Sent: Wednesday, December 9, 2015 23:04
Subject: Re: Mongodb performance tuning
To: Tyk Community Support [email protected]
Cc: [email protected]

  • show quoted text -

To view this discussion on the web, visit https://groups.google.com/d/msgid/tyk-community-support/b027c2e2-c05e-424e-83f0-e1311d4495c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Imported Google Group message.
Sender:Senthil Muniswamy.
Date:Thursday, 10 December 2015 15:19:44 UTC.

Hi Martin,

Added the org session and works as expected. BTW, documentation has a typo in the resource url “/tyk/orgs/keys/”.

I have couple of APIs which are imported from swagger, so adding org session one time is easier approach for my case. What do you think?

Thanks,
Senthil

  • show quoted text -

Imported Google Group message.
Sender:Martin Buhr.
Date:Thursday, 10 December 2015 15:47:55 UTC.

Hi Senthil,

Definitely - as it will affect all of your owned APIs to manage the data.

Remember to create the indexes in mongo too, otherwise the data won’t be deleted by the DB.

Cheers,
Martin