question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

async subscription Thread creation

See original GitHub issue

currently async subscriptions create a Thread per active subscription - this is problematic for even moderately large numbers of active subscriptions - with a 64-bit vm default Thread stack size of 1MB then 10k connections leads to a minimum 10GB memory requirement before doing any actual processing

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ColinSullivan1commented, May 11, 2017

@mccraigmccraig , @jtdudley2 , Thank you for raising and evaluating this issue. This is an issue that spans a few of our clients. While it’s been addressed elsewhere, unfortunately it has not been addressed here in the java client yet. I’ve opened #114 to add this feature by the next release.

1reaction
jtdudley2commented, May 11, 2017

I was evaluating nats-io and ran across the same thing.

I did a quick proof of concept to change this behavior to use a single dispatch thread for async subscriptions.

https://github.com/jtdudley2/java-nats/commit/d075adf67b853ef73d5b949f4280b88848708106

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does the use of async/await create a new thread?
In short NO. From Asynchronous Programming with Async and Await : Threads. The async and await keywords don't cause additional threads to be...
Read more >
Asynchronous Subscriptions - NATS Docs
Asynchronous subscriptions use callbacks of some form to notify an application when a message arrives. These subscriptions are usually easier to work with, ......
Read more >
Using thread pools for asynchronous processing
A thread pool can reuse previously created threads to execute the current task so that the thread is already available when the request...
Read more >
Getting Started | Creating Asynchronous Methods - Spring
This guide walks you through creating asynchronous queries to GitHub. ... Spring's @Async annotation, indicating that it should run on a separate thread....
Read more >
Pull subscriptions | Cloud Pub/Sub Documentation
You can use the pull mode to perform asynchronous or synchronous message processing. The pull mode runs in a client library that can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found