[ 
https://issues.apache.org/jira/browse/ARTEMIS-5745?focusedWorklogId=991990&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-991990
 ]

ASF GitHub Bot logged work on ARTEMIS-5745:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Nov/25 10:47
            Start Date: 17/Nov/25 10:47
    Worklog Time Spent: 10m 
      Work Description: GChuf commented on PR #6027:
URL: 
https://github.com/apache/activemq-artemis/pull/6027#issuecomment-3541120171

   This was a bit harder to test that I thought (had some issues with 
reproducing results and puppeteer memory usage, and so on).
   
   For now I have 3 comparisons. I used the same broker instance for testing 
this, with this bootstrap.xml config:
   
   ```
          <binding name="artemis" uri="http://0.0.0.0:8162";>
              <app name="console" url="console" war="console.war"/>
          </binding>
          <binding name="artemis2" uri="unix:///tmp/jetty.sock">
              <app name="console" url="console" war="console.war"/>
          </binding>
   ```
   
   I proxied both addresses via nginx with minimal config.
   The broker config stayed the same.
   
   I tested the "status" console page manually (with chrome dev tools) and the 
/console/artemis login screen with puppetteer.js:
   ```
   import puppeteer from "puppeteer";
   async function testAverageLoadTime(url, runs = 500) {
     const browser = await puppeteer.launch({
       headless: true,
       args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-cache']
     });
     const page = await browser.newPage();  // Reuse one page
     let totalTime = 0;
     for (let i = 1; i < runs; i++) {
       const start = Date.now();
       await page.goto(url, { waitUntil: "load" });
       const loadTime = Date.now() - start;
       console.log(`Run ${i + 1}: ${loadTime} ms`);
       totalTime += loadTime;
     }
   ```
   
     await page.close();
     await browser.close();
   
     console.log(`UNIX: Average load time over ${runs} runs: ${totalTime / 
runs} ms`);
   }
   
   The calls via puppeteer to /console/artemis made 10 requests on average. 
Manual testing the status page had 76 requests.
   I didn't test with broker under heavy loads yet, but I did try to saturate 
the loopback interface with iperf3 to see if heavy network traffic would make a 
difference.
   I made 500 runs with puppeteer and 10 manual refreshes on status page.
   If you have better ways of testing please let me know.
   Otherwise - this comparison really lacks a test where the broker itself is 
under heavy load (consumers, producers, messages).
   Results:
   
   
   | mode  | TCP | Unix socket |
   | ------

Issue Time Tracking
-------------------

    Worklog Id:     (was: 991990)
    Time Spent: 1.5h  (was: 1h 20m)

> Add support for exposing Jetty on Unix domain socket
> ----------------------------------------------------
>
>                 Key: ARTEMIS-5745
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5745
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>    Affects Versions: 2.44.0
>            Reporter: Gašper Čefarin
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> I'd like to add support for exposing Jetty on Unix domain sockets.
> The code in the PR is open to adjustments since this is just a "proof of 
> concept" so to say, and a lot of things are not as elegant as I'd like them 
> to be. I want to hear your opinions first. 
> There's 1 major change, and that's the removal of virtual hosts, and removal 
> of connector names.
> From what I understand, virtual host names should match connector names for 
> jetty "routing" to work - but this only works for http and https connectors, 
> not for unix sockets.
> I had the issue of unix socket being created but the /console URL returning 
> 404 - and the issue was resolved when I changed this code:
> {code:java}
> webapp.setVirtualHosts(new String[]{virtualHost}){code}
> to this:
> {code:java}
> webapp.setVirtualHosts(null);{code}
> I've had some help from AI, otherwise I couldn't find the source of the 404 
> "error":
> _"Using null for virtual hosts makes the context respond to all connectors, 
> including Unix domain sockets."_
> Since all connector names were added to virtualHost array, and all virtual 
> hosts were added to all contexts, the functionality should be the same after 
> this change ... Please correct me if I'm wrong.
> You can test this PR by adding this into {{bootstrap.xml}}:
> {code:xml}
>    <binding name="artemis" uri="unix:///tmp/jetty.sock">
>        <app name="console" url="console" war="console.war"/>
>    </binding>{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to