hyperledger / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
https://hyperledger.github.io/caliper/
Apache License 2.0
650 stars 403 forks source link

EndorseError: 2 UNKNOWN: too many requests for /gateway.Gateway, exceeding concurrency limit (500) in Hyperledger Caliper #1483

Closed gowthami1610 closed 1 year ago

gowthami1610 commented 1 year ago

Which Caliper version are you using?

0.5.0

Which Node.JS version are you using?

v16.18.0

Which operating system are you using?

Ubuntu 18.04.6

Please provide some context for your error. For example, when did the error occur? What were you trying to achieve, and how?

I tried to execute the Caliper tool for creating records with the following commands, $npm install --only=prod @hyperledger/caliper-cli

$npx caliper bind --caliper-bind-sut fabric:2.4

$npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/networkConfig.yaml --caliper-benchconfig benchmarks/2benchmark.yaml --caliper-flow-only-test --caliper-fabric-gateway-enabled

What was the observed incorrect behavior?

I executed Hyperledger Fabric test network and it had no errors. When I benchmarked its performance with Hyperledger Caliper tool, it was successful. Caliper works fine for reading the records from my fabric network with any number of transaction.

When the records were created it worked fine for fixed-rate controller with transaction numbers 100,300,500, 800 but when the transactions count is increased to 1000 or above it throws the error.

To rectify the error I changed the value of gatewayService to 2500 from its default value 500 in the core.yaml file but still the error not rectified.

Please provide the error logs and their surroundings.

`2023.02.13-11:49:56.059 error [caliper] [connectors/peer-gateway/PeerGateway]   Failed to perform submit transaction [Admin_createPatient] using arguments [Client3_CAR557,Toyota,S,brown,Shotaro,29,123456890],  with error: EndorseError: 2 UNKNOWN: too many requests for /gateway.Gateway, exceeding concurrency limit (500)`

Please provide your benchmark configuration file content, if possible.

test:
  workers:
    number: 5
  rounds:
    - label: Create
      # 5000 transactions should create around 1000 cars per worker but not guaranteed
      # so need to set asset limits to less than 1000 for the other tests
      txNumber: 3000
      rateControl:
          type: fixed-rate
          opts:
            tps: 100
      workload:
        module: workload/chaincare/createrec.js

Please provide your network configuration file content, if possible.

No response

Please provide your workload module content, if possible.

'use strict';

const { WorkloadModuleBase } = require('@hyperledger/caliper-core');

const colors = ['blue', 'red', 'green', 'yellow', 'black', 'purple', 'white', 'violet', 'indigo', 'brown'];
const makes = ['Toyota', 'Ford', 'Hyundai', 'Volkswagen', 'Tesla', 'Peugeot', 'Chery', 'Fiat', 'Tata', 'Holden'];
const models = ['Prius', 'Mustang', 'Tucson', 'Passat', 'S', '205', 'S22L', 'Punto', 'Nano', 'Barina'];
const owners = ['Tomoko', 'Brad', 'Jin Soo', 'Max', 'Adrianna', 'Michel', 'Aarav', 'Pari', 'Valeria', 'Shotaro'];

/**
 * Workload module for the benchmark round.
 */
class CreateCarWorkload extends WorkloadModuleBase {
    /**
     * Initializes the workload module instance.
     */
    constructor() {
        super();
        this.txIndex = 0;
    }

    /**
     * Assemble TXs for the round.
     * @return {Promise<TxStatus[]>}
     */
    async submitTransaction() {
        this.txIndex++;
        let MRNID = 'Client' + this.workerIndex + '_CAR' + this.txIndex.toString();
        let carColor = colors[Math.floor(Math.random() * colors.length)];
        let carMake = makes[Math.floor(Math.random() * makes.length)];
        let carModel = models[Math.floor(Math.random() * models.length)];
        let carOwner = owners[Math.floor(Math.random() * owners.length)];

        let args = {
            contractId: 'chaincare',
            contractVersion: 'v1',
            contractFunction: 'Admin_createPatient',
            contractArguments: [MRNID, carMake, carModel, carColor, carOwner,'29', '123456890'],
            timeout: 60
        };

Please provide any additional information you deem relevant to the error.

No response

davidkel commented 1 year ago

This is not an issue with caliper, but how you configure your fabric network. See my answer to the same question in stackoverflow https://stackoverflow.com/questions/75433691/endorseerror-2-unknown-too-many-requests-for-gateway-gateway-exceeding-concu

As this is not an issue with caliper, closing