Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check on the HTTP performance issue with Java 21 migration #7488

Closed
TharmiganK opened this issue Jan 7, 2025 · 3 comments
Closed

Check on the HTTP performance issue with Java 21 migration #7488

TharmiganK opened this issue Jan 7, 2025 · 3 comments

Comments

@TharmiganK
Copy link
Contributor

Description

A load test for the following scenario with 500 concurrent users seems to be hanging:

H1(client - jmeter) <-> H2(passthrough service - Ballerina) <-> H1(backend - netty echo server)

Version

Ballerina SwanLake Update 11

@TharmiganK
Copy link
Contributor Author

Passthrough service:

import ballerina/http;
import ballerina/log;

configurable string epKeyPath = "./ballerinaKeystore.p12";
configurable string epTrustStorePath = "./ballerinaTruststore.p12";
configurable string epKeyPassword = "ballerina";

listener http:Listener securedEP = new (9090,
    secureSocket = {
        key: {
            path: epKeyPath,
            password: epKeyPassword
        }
    }
);

final http:Client nettyEP = check new ("https://localhost:8688",
    secureSocket = {
        cert: {
            path: epTrustStorePath,
            password: epKeyPassword
        },
        verifyHostName: false
    }
);

service /passthrough on securedEP {
    isolated resource function post .(http:Request clientRequest) returns http:Response {
        log:printInfo("request received");
        http:Response|http:ClientError response = nettyEP->forward("/service/EchoService", clientRequest);
        if (response is http:Response) {
            return response;
        } else {
            log:printError("Error at h1_h1_passthrough", 'error = response);
            http:Response res = new;
            res.statusCode = 500;
            res.setPayload(response.message());
            return res;
        }
    }
}

Backend - Docker command:

docker run -d -p 8688:8688 -e "SSL=true" ldclakmal/netty-echo-backend:latest

JMeter client - JMX file: https://gist.github.com/TharmiganK/af4ba00cc1771dc4db2271b6a763c7bd

@TharmiganK
Copy link
Contributor Author

Thread dump during the hanging issue: (Generated from jcmd command since jstack does not show the virtual threads)
threaddump.txt
fastthreadreport.pdf

The issue seems to be with this synchronized block. It seems the synchronized blocks are not loom-friendly

@TharmiganK
Copy link
Contributor Author

Fixed with this PR: ballerina-platform/module-ballerina-http#2285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant