Layer7 API Management

 View Only
  • 1.  how to know scale my LAC and my API Gateway considering the number of transactions?

    Posted May 23, 2020 02:07 PM
    Hi,

    I would like to know how to scale my LAC and my API Gateway considering the number of transaccions for each component. at this point we have 2 nodes for LAC (32core, 32GB ram each one) and 2 nodes for API Gateway (8 cores, 32GB).
    is this a good configuration??? maybe we should configure 4 nodes for each component or maybe 1 node for each component but upgrading the hardware.
    there is any calculator to know how many nodes o the hardware requirements necesary considering 1M or 500K transactions per day.

    Regards.

    ------------------------------
    Luis Huallpa.
    ------------------------------


  • 2.  RE: how to know scale my LAC and my API Gateway considering the number of transactions?

    Broadcom Employee
    Posted May 26, 2020 11:11 AM
    Luis;
    I would like to understand the expected 'peak load' before giving a standard answer. Also, what type of transactions will LAC be returning (e.g. mostly simple GET's or more complex PUT/POST with rules and JavaScript)? Using standard tools like JUNIT or CURL to test a specific REST request - you can measure the response time, for example:
    for i in {1..10000}
    do
    #demo_full is the pre-defined APIKEY (security/apikey).
    curl -H "Authorization: CALiveAPICreator demo_full:1" "http://localhost:8080/rest/default/demo/v1/TestJS" -s -o /dev/null -w "%{time_total}\n" --keepalive-time 1000
    #sleep 1
    done
    echo "done"
    We would recommend upgrading to the latest release v5.4 and configure the Java startup options to reflect a pre-production setup. (see Performance and Configuration)

    ------------------------------
    Principal Engineer
    Broadcom
    ------------------------------



  • 3.  RE: how to know scale my LAC and my API Gateway considering the number of transactions?

    Posted May 27, 2020 04:09 PM
    Hi Tyler,

    Until now our peak load is 7,000,000 transaction per day. Our transactions are get and post, 10% of them (15) are stored procedure and scripts.

    Regards


  • 4.  RE: how to know scale my LAC and my API Gateway considering the number of transactions?

    Broadcom Employee
    Posted Jun 01, 2020 10:08 AM
    Luis;
    1) You do not need 32g of memory - this is too large and will lead to long GC pauses as memory fills.  1g should be more than enough.
    2) If you can scale horizontally - that is, run multiple nodes on each machine - and have the Gateway connect to each node as a load balancer would be ideal.
    3) We highly recommend setting your Java options to turn off in memory logging (used by developers for debugging) and turn off the Scheduler (this has a known memory.leak found in 5.2 and fixed in 5.4) 
       -DLAC_USE_IN_MEMORY_LOGGING=false
       -DLAC_SCHEDULING_DISABLE=true
       note: if you need a scheduled task - setup a stand-alone instance for that task or use an external scheduler to post to LAC. 
    4) We are not sure of your configuration - but make sure that you are using an SQL database for APIKEY storage so that each node can share the same credentials (unless the GW is using fixed APIKEY management). 

    5) Finally, LAC 5.2 should be able to handle 100-200 transactions per second per node on a 1g box.  Remember - these are stateless servers so memory is not being consumed except when processing a request.  So 2 nodes should be able to handle 15,000/minute.  The performance link I posted above reminds us to measure the SQL query time for requests to optimize the response time between LAC and the SQL database. This step is usually done in the pre-release phase with in memory logging turned on and looking at the SQL response time for each query.

    ------------------------------
    Principal Engineer
    Broadcom
    ------------------------------



  • 5.  RE: how to know scale my LAC and my API Gateway considering the number of transactions?

    Posted Jun 04, 2020 12:21 PM
    Hi Tyler, 

    thanks so much for your response, i would like ask you about CPU consumption, for this case (peak load or quantity of transactions) how many cores are recommended?? or how many cpu??

    Regards.


  • 6.  RE: how to know scale my LAC and my API Gateway considering the number of transactions?
    Best Answer

    Broadcom Employee
    Posted Jun 05, 2020 03:48 PM
    Luis;

    Sizing a production application without doing some local testing would be difficult.  I would suggest that you configure each node with 1g of RAM and 4 cores.  You should be able to scale horizontally (with 4 instances running) and then simulate peak load to see if the CPU for each node remains below 75% and memory/GC is a steady rise and fall (a saw shape). You can use tools like JUNIT or BlazeMeter API Monitoring (aka Runscope) to generate transactions. You want to make sure that your load balancer is spreading out each request and that the overall load is even and balanced. Since you have a very large machine - you could run all these instances on a single box. Make sure to add some think time and stagger your request rate to reflect realistic load.  You could spin up a Docker container for each instance on your box and use a load balancer like 'Consul' to round-robin the requests.

    ------------------------------
    Principal Engineer
    Broadcom
    ------------------------------