GithubHelp home page GithubHelp logo

kmanav / 3scale-jdg-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pszuster/3scale-jdg-demo

0.0 1.0 0.0 85 KB

Use RH Datagrid to cache API requests in 3scale API Manager

Lua 100.00%

3scale-jdg-demo's Introduction

3scale-JDG-Demo

The idea of this demo is setup an example of how to use RH DataGrid to cache API requests in 3scale API Manager.

Demo Architecture

Pre-Requisites

You need to have: * Openshift cluster up & running (you can use oc cluster up or minishift) * OC binary installed * Admin access to the Openshift cluster * Ansible

Demo Instructions

  1. Edit the playbook (3scale-config.yml) and change the domain var to match your Openshift cluster's domain (ie: example.com)

  2. Execute the playbook (foo@bar:~$ ansible-playbook 3scale-config.yml)

  3. You can test performance improvements on a local backend API by executing:

    • Run a performance test (with caching enabled)
      • ab -n 1000 -c 20 https://products-apicast-production.gateway.<replace with your domain>:443/rest/services/products?user_key=<replace with a user_key for this API>
    • Take note of the results
    • Disable caching in Apicast
      • foo@bar:~$ oc set env dc/apicast-production APICAST_MODULE=cors.apicast_cors -n 3scale
    • Run a second performance test (without caching)
      • ab -n 1000 -c 20 https://products-apicast-production.gateway.<replace with your domain>:443/rest/services/products?user_key=<replace with a user_key for this API>
    • Compare results with/without caching.
  4. You can test the performance improvements on a remote backend API by executing:

    • Run a performance test (without caching)
      • ab -n 1000 -c 20 https://api-3scale-apicast-production.<replace with your domain>:443?user_key=<replace with a user_key for this API>
    • Take note of the results
    • Enable caching again
      • foo@bar:~$ oc set env dc/apicast-production APICAST_MODULE=jdg.apicast_jdg -n 3scale
    • Run a seconf performance test (with caching enabled)
      • ab -n 1000 -c 20 https://api-3scale-apicast-production.<replace with your domain>:443?user_key=<replace with a user_key for this API>
    • Compare results with/without caching.

Notes

  • JDG expiration for objects is hardcoded to 60sec (this could be made configurable)
  • You can easily check the existing cached objects at http://datagrid./rest/default
  • 3scale admin console:
  • URL: https://3scale-admin.< replace with your domain >
    • User: admin
    • Password: admin

3scale-jdg-demo's People

Contributors

pstlatam avatar pszuster avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.